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
90c57853
Commit
90c57853
authored
Oct 07, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签同步
parent
6fab5b6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+17
-8
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
90c57853
...
@@ -141,14 +141,23 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -141,14 +141,23 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
@Override
@Override
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
logger
.
info
(
"标签同步到企业微信,wxEnterpriseId={},memberTagId={}"
,
wxEnterpriseId
,
infoDTO
.
getMemberTagId
());
String
memberTagId
=
infoDTO
.
getMemberTagId
()
;
logger
.
info
(
"标签同步到企业微信,wxEnterpriseId={},memberTagId={}"
,
wxEnterpriseId
,
memberTagId
);
List
<
MemberTagItemDTO
>
tagItems
=
memberTagApiService
.
queryMemberTagItem
(
memberTagId
);
items
=
tagItems
.
stream
().
map
(
item
->
{
QywxTagItemDTO
mid
=
new
QywxTagItemDTO
();
mid
.
setMemberTagItemId
(
item
.
getTagItemId
());
mid
.
setQywxTagKey
(
item
.
getTagItemId
());
mid
.
setQywxTagName
(
item
.
getTagItemName
());
return
mid
;
}).
collect
(
Collectors
.
toList
());
ServiceResponse
ret
=
new
ServiceResponse
();
ServiceResponse
ret
=
new
ServiceResponse
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
// 判断更新
// 判断更新
List
<
String
>
needDelList
=
new
ArrayList
<>()
;
List
<
String
>
needDelList
=
new
ArrayList
<>()
;
List
<
QywxTagItemDTO
>
needAddList
=
new
ArrayList
<>()
;
List
<
QywxTagItemDTO
>
needAddList
=
new
ArrayList
<>()
;
List
<
String
>
memberTagItemIdList
=
items
.
stream
().
map
(
o
->
o
.
getMemberTagItemId
()).
collect
(
Collectors
.
toList
());
;
List
<
String
>
memberTagItemIdList
=
items
.
stream
().
map
(
o
->
o
.
getMemberTagItemId
()).
collect
(
Collectors
.
toList
());
;
List
<
TabQywxTagRelation
>
relationList
=
this
.
qywxTagRelationMapper
.
listByMemberTagId
(
wxEnterpriseId
,
infoDTO
.
getMemberTagId
()
)
;
List
<
TabQywxTagRelation
>
relationList
=
this
.
qywxTagRelationMapper
.
listByMemberTagId
(
wxEnterpriseId
,
memberTagId
)
;
if
(
CollectionUtils
.
isNotEmpty
(
relationList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
relationList
))
{
String
hbTagId
=
relationList
.
get
(
0
).
getQywxTagId
()
;
String
hbTagId
=
relationList
.
get
(
0
).
getQywxTagId
()
;
TabQywxTag
tag
=
this
.
qywxTagService
.
getQywxTagByQywxTagId
(
wxEnterpriseId
,
hbTagId
)
;
TabQywxTag
tag
=
this
.
qywxTagService
.
getQywxTagByQywxTagId
(
wxEnterpriseId
,
hbTagId
)
;
...
@@ -162,13 +171,15 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -162,13 +171,15 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
infoDTO
.
setQywxGroupKey
(
qwGroupKey
);
infoDTO
.
setQywxGroupKey
(
qwGroupKey
);
// 需要删除的标签值
// 需要删除的标签值
for
(
TabQywxTagRelation
relation
:
relationList
)
{
for
(
TabQywxTagRelation
relation
:
relationList
)
{
String
memberTagId
=
relation
.
getTagItemId
()
;
String
member
Item
TagId
=
relation
.
getTagItemId
()
;
if
(!
memberTagItemIdList
.
contains
(
memberTagId
))
{
if
(!
memberTagItemIdList
.
contains
(
member
Item
TagId
))
{
this
.
qywxTagRelationMapper
.
deleteByPrimaryKey
(
relation
.
getQywxTagRelationId
())
;
this
.
qywxTagRelationMapper
.
deleteByPrimaryKey
(
relation
.
getQywxTagRelationId
())
;
String
hbTagItemId
=
relation
.
getQywxTagItemId
()
;
String
hbTagItemId
=
relation
.
getQywxTagItemId
()
;
TabQywxTagItem
tagItem
=
tagItemMap
.
get
(
hbTagItemId
)
;
this
.
qywxTagService
.
delQywxTagItemById
(
wxEnterpriseId
,
hbTagItemId
)
;
this
.
qywxTagService
.
delQywxTagItemById
(
wxEnterpriseId
,
hbTagItemId
)
;
needDelList
.
add
(
tagItem
.
getQywxTagKey
())
;
TabQywxTagItem
tagItem
=
tagItemMap
.
get
(
hbTagItemId
)
;
if
(
null
!=
tagItem
)
{
needDelList
.
add
(
tagItem
.
getQywxTagKey
())
;
}
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
needDelList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
needDelList
))
{
...
@@ -260,8 +271,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -260,8 +271,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
/**
/**
* 调用企业微信接口 保存标签
* 调用企业微信接口 保存标签
*
* @param wxEnterpriseDTO
* @param infoDTO
* @param infoDTO
* @param items
* @param items
* @return
* @return
...
...
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