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
6c0b619c
Commit
6c0b619c
authored
Aug 06, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步-同步没有打的标签加锁
parent
d729d0fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
QywxTagServiceImpl.java
...aoban/manage/service/service/impl/QywxTagServiceImpl.java
+4
-0
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+4
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/QywxTagServiceImpl.java
View file @
6c0b619c
...
...
@@ -12,6 +12,7 @@ import com.gic.haoban.manage.service.entity.TabQywxTag;
import
com.gic.haoban.manage.service.entity.TabQywxTagItem
;
import
com.gic.haoban.manage.service.entity.TabQywxTagRelation
;
import
com.gic.haoban.manage.service.service.QywxTagService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.QywxTagDTO
;
import
com.gic.wechat.api.dto.qywx.QywxTagGroupDTO
;
import
org.apache.commons.lang3.tuple.Pair
;
...
...
@@ -61,6 +62,8 @@ public class QywxTagServiceImpl implements QywxTagService {
@Override
public
Pair
<
TabQywxTag
,
List
<
TabQywxTagItem
>>
saveQywxTagByQywxGroupKey
(
String
wxEnterpriseId
,
QywxTagGroupDTO
groupDTO
)
{
String
lockKey
=
"group-add-"
+
groupDTO
.
getGroupId
();
RedisUtil
.
lock
(
lockKey
,
3L
);
//判断保存 分组
TabQywxTag
qywxTag
=
this
.
getQywxTagByQywxGroupKey
(
wxEnterpriseId
,
groupDTO
.
getGroupId
());
if
(
null
==
qywxTag
)
{
...
...
@@ -116,6 +119,7 @@ public class QywxTagServiceImpl implements QywxTagService {
}
items
.
add
(
qywxTagItem
);
}
RedisUtil
.
unlock
(
lockKey
);
return
Pair
.
of
(
qywxTag
,
items
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
6c0b619c
...
...
@@ -279,6 +279,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
QywxTagRelationTypeEnum
relationTypeEnum
=
QywxTagRelationTypeEnum
.
getByTagType
(
callbackDTO
.
getTagType
());
//标签组
if
(
relationTypeEnum
.
getTagType
()
==
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getTagType
())
{
logger
.
info
(
"新增标签组无需操作:{}"
,
callbackDTO
.
getTagId
());
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
callbackDTO
.
getTagId
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
wxEnterpriseDto
.
getCorpid
(),
config
.
getWxSuiteid
(),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
());
...
...
@@ -286,8 +287,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"没有关联,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
return
;
}
QywxTagGroupDTO
qywxTagGroupDTO
=
tagDetail
.
getTagGroup
().
get
(
0
);
//保存标签项
qywxTagService
.
saveQywxTagByQywxGroupKey
(
wxEnterpriseDto
.
getWxEnterpriseId
(),
tagDetail
.
getTagGroup
().
get
(
0
)
);
qywxTagService
.
saveQywxTagByQywxGroupKey
(
wxEnterpriseDto
.
getWxEnterpriseId
(),
qywxTagGroupDTO
);
//标签项
}
else
if
(
relationTypeEnum
.
getTagType
()
==
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getTagType
())
{
//查找对应的标签组 如果标签组关联了
...
...
@@ -306,6 +308,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//保存标签项
qywxTagService
.
saveQywxTagByQywxGroupKey
(
wxEnterpriseDto
.
getWxEnterpriseId
(),
qywxTagGroupDTO
);
}
}
...
...
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