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
99047dbe
Commit
99047dbe
authored
Nov 16, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
并发控制
parent
7e07f65b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+1
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+10
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
99047dbe
...
...
@@ -363,6 +363,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
RedisUtil
.
lock
(
lockKey
,
2L
,
TimeUnit
.
SECONDS
,
2L
);
StaffClerkRelationDTO
dto
=
this
.
mapper
.
getByStaffAndClerk
(
staffClerkRelation
.
getStaffId
(),
staffClerkRelation
.
getClerkId
())
;
if
(
null
!=
dto
)
{
RedisUtil
.
unlock
(
lockKey
);
return
dto
.
getStaffClerkRelationId
()
;
}
mapper
.
insert
(
relation
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
99047dbe
...
...
@@ -20,6 +20,7 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.fee.AccountListDTO
;
import
com.gic.wechat.api.dto.qywx.fee.AccountListResponseDTO
;
import
com.gic.wechat.api.dto.qywx.fee.ActiveInfoUserResponseDTO
;
...
...
@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -83,7 +85,15 @@ public class StaffServiceImpl implements StaffService {
}
tab
.
setStatusFlag
(
1
);
tab
.
setAddNum
(
0
);
String
lockKey
=
"tabstaff:"
+
tab
.
getWxEnterpriseId
()+
tab
.
getWxUserId
()
;
RedisUtil
.
lock
(
lockKey
,
2
l
,
TimeUnit
.
SECONDS
,
2
l
);
TabHaobanStaff
staff
=
this
.
mapper
.
selectByUserIdAndEnterpriseId
(
tab
.
getWxUserId
(),
tab
.
getWxEnterpriseId
())
;
if
(
null
!=
staff
)
{
RedisUtil
.
unlock
(
lockKey
);
return
staff
.
getStaffId
()
;
}
mapper
.
insertSelective
(
tab
);
RedisUtil
.
unlock
(
lockKey
);
return
tab
.
getStaffId
();
}
...
...
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