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
ac41b26d
Commit
ac41b26d
authored
Apr 25, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业门店初始化
parent
fc98fd5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
12 deletions
+37
-12
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+37
-12
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
ac41b26d
...
...
@@ -362,18 +362,43 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
}
}
@Override
public
ServiceResponse
flushBindStoreByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
optStaffId
,
int
channalCode
)
{
ServiceResponse
resp
=
new
ServiceResponse
();
String
key
=
FLUSH_HAOBAN_BIND_STORE
+
enterpriseId
;
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
null
!=
cache
)
{
logger
.
info
(
"已经有人在操作刷新,不能同步操作:{},{}"
,
enterpriseId
,
optStaffId
);
resp
.
setCode
(
2
);
resp
.
setMessage
(
"有正在执行,不能同时操作"
);
return
resp
;
}
RedisUtil
.
setCache
(
key
,
wxEnterpriseId
,
120L
,
TimeUnit
.
SECONDS
);
/**
* 校验是否有同时执行 刷新企业
*
* @param enterpriseId
* @param wxEnterpriseId
* @return
*/
private
boolean
checkFlush
(
String
enterpriseId
,
String
wxEnterpriseId
)
{
String
key
=
FLUSH_HAOBAN_BIND_STORE
+
enterpriseId
;
String
lockKey
=
FLUSH_HAOBAN_BIND_STORE
+
"lock:"
+
enterpriseId
;
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
null
!=
cache
)
{
logger
.
info
(
"已经有人在操作刷新,不能同步操作:{}"
,
enterpriseId
);
return
false
;
}
RedisUtil
.
lock
(
lockKey
,
2L
);
cache
=
RedisUtil
.
getCache
(
key
);
if
(
null
==
cache
)
{
RedisUtil
.
setCache
(
key
,
wxEnterpriseId
,
120L
,
TimeUnit
.
SECONDS
);
RedisUtil
.
unlock
(
lockKey
);
return
true
;
}
else
{
RedisUtil
.
unlock
(
lockKey
);
return
false
;
}
}
@Override
public
ServiceResponse
flushBindStoreByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
optStaffId
,
int
channalCode
)
{
ServiceResponse
resp
=
new
ServiceResponse
();
String
key
=
FLUSH_HAOBAN_BIND_STORE
+
enterpriseId
;
//校验是否有同时执行
if
(!
checkFlush
(
enterpriseId
,
wxEnterpriseId
))
{
resp
.
setCode
(
2
);
resp
.
setMessage
(
"有正在执行,不能同时操作"
);
return
resp
;
}
logger
.
info
(
"刷新绑定门店:eid:{},staffid:{}"
,
enterpriseId
,
optStaffId
);
List
<
TabStoreRange
>
groupInfoDTOS
=
storeRangeService
.
queryAllBindRangeByEnterpriseId
(
enterpriseId
);
...
...
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