Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
364299f5
Commit
364299f5
authored
Feb 04, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orderPay 加锁
parent
277dd4bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
apply-net/src/main/java/com/winsun/controller/DankuanController.java
+13
-1
apply-net/src/main/java/com/winsun/controller/RongHeController.java
+8
-1
No files found.
apply-net/src/main/java/com/winsun/controller/DankuanController.java
View file @
364299f5
...
...
@@ -423,10 +423,22 @@ public class DankuanController {
* @return
* @throws Exception
*/
@
Reque
stMapping
(
value
=
"orderPay"
)
@
Po
stMapping
(
value
=
"orderPay"
)
public
ResponseData
<
Object
>
toPaymentPlatformPage
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestParam
(
"ipay"
)
String
ipay
,
@RequestParam
(
"userId"
)
String
userId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
try
{
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderId
,
uuid
,
10
);
if
(!
boo1
){
return
ResponseData
.
error
(
"已在支付中"
);
}
String
result
=
JsoupMethodZhifu
(
orderId
,
ipay
,
userId
,
request
,
response
);
return
ResponseData
.
success
(
result
);
}
catch
(
Exception
e
){
e
.
getMessage
();
}
finally
{
redisLockUtil
.
deleteLock
(
orderId
);
}
return
ResponseData
.
error
(
"订单异常"
);
}
/**
...
...
apply-net/src/main/java/com/winsun/controller/RongHeController.java
View file @
364299f5
...
...
@@ -373,15 +373,22 @@ public class RongHeController {
*/
@PostMapping
(
value
=
"orderPay"
)
public
ResponseData
<
Object
>
toPaymentPlatformPage
(
HttpServletRequest
request
,
HttpServletResponse
response
){
try
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
String
orderId
=
request
.
getParameter
(
"orderId"
);
String
ipay
=
request
.
getParameter
(
"ipay"
);
String
userId
=
request
.
getParameter
(
"userId"
);
String
rhTime
=
request
.
getParameter
(
"rhTime"
);
try
{
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderId
,
uuid
,
10
);
if
(!
boo1
){
return
ResponseData
.
error
(
"已在支付中"
);
}
String
result
=
JsoupMethodZhifu
(
orderId
,
ipay
,
userId
,
request
,
response
,
rhTime
);
return
ResponseData
.
success
(
result
);
}
catch
(
Exception
e
){
e
.
getMessage
();
}
finally
{
redisLockUtil
.
deleteLock
(
orderId
);
}
return
ResponseData
.
error
(
"订单异常"
);
}
...
...
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