Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9dfccb66
authored
May 08, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善PayOfflineViewModel注释
parent
dee7658c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
app/src/main/java/com/bgycc/smartcanteen/viewModel/PayOfflineViewModel.java
+5
-1
No files found.
app/src/main/java/com/bgycc/smartcanteen/viewModel/PayOfflineViewModel.java
View file @
9dfccb66
...
...
@@ -133,6 +133,8 @@ public class PayOfflineViewModel extends ViewModel {
}
};
// 当支付时websocket未链接,则走离线支付流程
// 此时直接标记订单为"离线支付"状态
private
class
MarkRunnable
implements
Runnable
{
private
PayData
payData
;
...
...
@@ -207,6 +209,7 @@ public class PayOfflineViewModel extends ViewModel {
return
;
}
// 保存服务器返回的结果
PayResponse
payResponse
=
gson
.
fromJson
(
response
,
PayResponse
.
class
);
payOfflineState
.
postValue
(
new
PayOfflineState
(
PayOfflineState
.
SUCCESS
,
payResponse
.
getMessage
()));
long
lastInsertId
=
payResponseRepository
.
insertPayResponse
(
payResponse
);
...
...
@@ -215,7 +218,7 @@ public class PayOfflineViewModel extends ViewModel {
}
List
<
PayData
>
dataList
=
payRequest
.
getData
();
// 设置
所有
离线支付订单状态为支付成功
// 设置离线支付订单状态为支付成功
// 同时在日志中记录所有订单的payCode
StringBuilder
ids
=
new
StringBuilder
();
for
(
PayData
data
:
dataList
)
{
...
...
@@ -238,6 +241,7 @@ public class PayOfflineViewModel extends ViewModel {
}
}
// 离线订单发送到后台超时后,重置其标志位保存到数据库
private
class
TimeoutRunnable
implements
Runnable
{
@Override
public
void
run
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment