Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
order-group-application
order-group
Commits
a26afbde
Commit
a26afbde
authored
Aug 12, 2021
by
李学兴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt@feature/20210810_callbackUrgentPlan_lxx:# 紧急方案增加日志打印
parent
6f7024a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
call-back-service/src/main/java/cn/freemud/service/impl/OrderCallBackServiceImpl.java
+8
-3
No files found.
call-back-service/src/main/java/cn/freemud/service/impl/OrderCallBackServiceImpl.java
View file @
a26afbde
...
...
@@ -62,15 +62,20 @@ public class OrderCallBackServiceImpl implements OrderCallBackService{
RedisLock
redisLock
=
RedisLock
.
getInstance
(
redisTemplate
);
String
lockKey
=
String
.
format
(
RedisKeyConstant
.
URGENT_CALLBACK_LOCK_KEY
,
requestVo
.
getOrderCode
(),
requestVo
.
getOrderState
(),
requestVo
.
getOperateType
(),
requestVo
.
getMsgType
());
boolean
lockSucc
=
false
;
try
{
//简单控制,不考虑解他锁问题
if
(!
redisLock
.
lock
(
lockKey
,
Long
.
valueOf
(
TimeUnit
.
MINUTES
.
toSeconds
(
configConstants
.
getUrgentCallbackLockMinutes
())).
intValue
()))
{
ApiLog
.
infoMessage
(
"订单orderCode:{} callback获取锁失败,lockKey:{}"
,
requestVo
.
getOrderCode
(),
lockKey
);
lockSucc
=
redisLock
.
lock
(
lockKey
,
Long
.
valueOf
(
TimeUnit
.
MINUTES
.
toSeconds
(
configConstants
.
getUrgentCallbackLockMinutes
())).
intValue
());
if
(!
lockSucc
)
{
ApiLog
.
infoMessage
(
"紧急方案 orderCode:{} 获取锁失败,lockKey:{}"
,
requestVo
.
getOrderCode
(),
lockKey
);
return
;
}
mqService
.
sendOrderMQ
(
requestVo
);
}
finally
{
redisLock
.
unlock
(
lockKey
);
if
(
lockSucc
){
ApiLog
.
infoMessage
(
"紧急方案 orderCode:{} 理论成功lockKey:{}"
,
requestVo
.
getOrderCode
(),
requestVo
.
getRequestId
(),
lockKey
);
redisLock
.
unlock
(
lockKey
);
}
}
}
...
...
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