Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
b4bfa3f9
Commit
b4bfa3f9
authored
Jan 04, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:增加redis锁
parent
6d569a98
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+9
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
b4bfa3f9
...
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
...
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -314,12 +315,20 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
...
@@ -314,12 +315,20 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
log
.
info
(
"企业外部联系人id为空"
);
log
.
info
(
"企业外部联系人id为空"
);
return
false
;
return
false
;
}
}
String
lockKey
=
"updateNewExternalUserid_"
+
wxEnterpriseId
;
if
(
RedisUtil
.
isLocked
(
lockKey
))
{
log
.
info
(
"redis锁,lockKey:{}"
,
lockKey
);
return
false
;
}
RedisUtil
.
lock
(
lockKey
,
1L
,
TimeUnit
.
DAYS
,
0L
);
try
{
try
{
updateNewExUserId
(
tabHaobanWxEnterprise
.
getWxEnterpriseId
(),
tabHaobanWxEnterprise
.
getCorpid
());
updateNewExUserId
(
tabHaobanWxEnterprise
.
getWxEnterpriseId
(),
tabHaobanWxEnterprise
.
getCorpid
());
log
.
info
(
"企业外部联系人id end,wxEnterpriseId:{}"
,
wxEnterpriseId
);
log
.
info
(
"企业外部联系人id end,wxEnterpriseId:{}"
,
wxEnterpriseId
);
RedisUtil
.
unlock
(
lockKey
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"企业外部联系人id异常,wxEnterpriseId:{},{}"
,
wxEnterpriseId
,
e
.
getMessage
(),
e
);
log
.
info
(
"企业外部联系人id异常,wxEnterpriseId:{},{}"
,
wxEnterpriseId
,
e
.
getMessage
(),
e
);
RedisUtil
.
unlock
(
lockKey
);
return
false
;
return
false
;
}
}
}
}
...
...
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