Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
d41bea82
Commit
d41bea82
authored
Jul 19, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量办理 & 批量审核 分布式锁
parent
1a9dea92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
TDispatchInfoController.java
...us/v1/yifu/social/controller/TDispatchInfoController.java
+47
-2
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TDispatchInfoController.java
View file @
d41bea82
...
...
@@ -477,7 +477,30 @@ public class TDispatchInfoController {
@RequestParam
(
name
=
"auditStatus"
,
required
=
true
)
String
auditStatus
,
@RequestParam
(
name
=
"auditRemark"
,
required
=
false
)
String
auditRemark
,
@RequestParam
(
name
=
"remark"
,
required
=
false
)
String
remark
)
{
return
tDispatchInfoService
.
addApplyAudit
(
idList
,
auditStatus
,
auditRemark
,
remark
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
DISPATCH_BATCH_AUDIT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//主动释放锁
return
tDispatchInfoService
.
addApplyAudit
(
idList
,
auditStatus
,
auditRemark
,
remark
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -501,7 +524,29 @@ public class TDispatchInfoController {
@RequestParam
(
name
=
"handleRemark"
,
required
=
false
)
String
handleRemark
,
@RequestParam
(
name
=
"socialType"
,
required
=
false
)
String
socialType
,
@RequestParam
(
name
=
"remark"
,
required
=
false
)
String
remark
)
{
return
tDispatchInfoService
.
addApplyHandle
(
idList
,
typeSub
,
handleStatus
,
handleRemark
,
socialType
,
remark
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
DISPATCH_BATCH_HANDLED
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//主动释放锁
return
tDispatchInfoService
.
addApplyHandle
(
idList
,
typeSub
,
handleStatus
,
handleRemark
,
socialType
,
remark
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
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