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
4a26711b
authored
Nov 08, 2019
by
patpat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整离线支付重复限制
parent
22987824
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/src/main/java/com/bgycc/smartcanteen/action/PayOfflineAction.java
+7
-4
app/src/main/java/com/bgycc/smartcanteen/action/PayOnlineAction.java
+1
-0
No files found.
app/src/main/java/com/bgycc/smartcanteen/action/PayOfflineAction.java
View file @
4a26711b
...
...
@@ -81,8 +81,7 @@ public class PayOfflineAction extends Action {
setState
(
State
.
FAIL
,
"请不要重复扫码"
);
return
;
}
mPayCodeHistory
.
add
(
payCode
);
clearTimeoutPayCodeHistory
();
addPayCodeHistory
(
payCode
);
try
{
JSONObject
params
=
new
JSONObject
();
...
...
@@ -119,8 +118,12 @@ public class PayOfflineAction extends Action {
LogUtil
.
i
(
TAG
,
list
.
toString
());
}
private
void
clearTimeoutPayCodeHistory
()
{
if
(
mPayCodeHistory
.
size
()
>
100
)
{
public
void
addPayCodeHistory
(
String
payCode
)
{
if
(
mPayCodeHistory
.
contains
(
payCode
))
{
mPayCodeHistory
.
remove
(
payCode
);
}
mPayCodeHistory
.
add
(
payCode
);
if
(
mPayCodeHistory
.
size
()
>
300
)
{
mPayCodeHistory
.
remove
(
0
);
}
}
...
...
app/src/main/java/com/bgycc/smartcanteen/action/PayOnlineAction.java
View file @
4a26711b
...
...
@@ -92,6 +92,7 @@ public class PayOnlineAction extends Action {
setState
(
State
.
STARTED
,
""
);
setActionResult
(
result
);
mPayCode
=
payCode
;
PayOfflineAction
.
getDefault
().
addPayCodeHistory
(
payCode
);
mTimeoutId
=
TimerHelper
.
INSTANCE
.
loop
(
new
TimerHelper
.
LoopTask
()
{
@Override
...
...
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