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
1
Merge Requests
1
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
43bf1d61
Commit
43bf1d61
authored
Oct 07, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签同步
parent
138644f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
56 deletions
+1
-56
QywxTagApiService.java
.../com/gic/haoban/manage/api/service/QywxTagApiService.java
+0
-8
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+1
-48
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/QywxTagApiService.java
View file @
43bf1d61
...
...
@@ -30,14 +30,6 @@ public interface QywxTagApiService {
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
);
/**
* 更新标签同步更新企微侧
* @param enterpriseId
* @param memberTagId
* @return
*/
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
syncTagToQywx
(
String
enterpriseId
,
String
memberTagId
);
/**
* 关闭同步
*
* @param wxEnterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
43bf1d61
...
...
@@ -113,33 +113,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
@Override
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
syncTagToQywx
(
String
enterpriseId
,
String
memberTagId
)
{
logger
.
info
(
"更新企微标签,memberTagId={}"
,
memberTagId
);
List
<
TabQywxTagRelation
>
relationList
=
this
.
qywxTagRelationMapper
.
listByMemberTagId
(
null
,
memberTagId
)
;
if
(
CollectionUtils
.
isEmpty
(
relationList
))
{
logger
.
info
(
"标签未同步过企微"
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
()
;
}
String
wxEnterpriseId
=
relationList
.
get
(
0
).
getWxEnterpriseId
()
;
com
.
gic
.
member
.
tag
.
api
.
dto
.
MemberTagDTO
memberTagDTO
=
memberTagApiService
.
getMemberTagById
(
memberTagId
);
List
<
MemberTagItemDTO
>
tagItems
=
memberTagApiService
.
queryMemberTagItem
(
memberTagId
);
QywxTagInfoDTO
qywxTagInfoDTO
=
new
QywxTagInfoDTO
();
qywxTagInfoDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
qywxTagInfoDTO
.
setMemberTagId
(
memberTagDTO
.
getTagId
());
qywxTagInfoDTO
.
setQywxGroupName
(
memberTagDTO
.
getTagName
());
List
<
QywxTagItemDTO
>
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
());
//保存同步
this
.
syncTagToQywx
(
wxEnterpriseId
,
enterpriseId
,
qywxTagInfoDTO
,
items
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
()
;
}
@Override
public
ServiceResponse
syncTagToQywx
(
String
wxEnterpriseId
,
String
enterpriseId
,
QywxTagInfoDTO
infoDTO
,
List
<
QywxTagItemDTO
>
items
)
{
String
memberTagId
=
infoDTO
.
getMemberTagId
()
;
logger
.
info
(
"标签同步到企业微信,wxEnterpriseId={},memberTagId={}"
,
wxEnterpriseId
,
memberTagId
);
...
...
@@ -154,9 +127,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
ServiceResponse
ret
=
new
ServiceResponse
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
// 判断更新
List
<
String
>
needDelList
=
new
ArrayList
<>()
;
List
<
QywxTagItemDTO
>
needAddList
=
new
ArrayList
<>()
;
List
<
String
>
memberTagItemIdList
=
items
.
stream
().
map
(
o
->
o
.
getMemberTagItemId
()).
collect
(
Collectors
.
toList
());
;
List
<
TabQywxTagRelation
>
relationList
=
this
.
qywxTagRelationMapper
.
listByMemberTagId
(
wxEnterpriseId
,
memberTagId
)
;
if
(
CollectionUtils
.
isNotEmpty
(
relationList
))
{
String
hbTagId
=
relationList
.
get
(
0
).
getQywxTagId
()
;
...
...
@@ -165,26 +136,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"已经存在企微标签,进行更新处理={}"
,
qwGroupKey
);
QywxGetCorpTagListDTO
tagListDTO
=
this
.
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
Arrays
.
asList
(
qwGroupKey
),
0
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
())
;
logger
.
info
(
"企微侧标签={}"
,
JSONObject
.
toJSONString
(
tagListDTO
));
List
<
TabQywxTagItem
>
tagItemList
=
this
.
qywxTagService
.
listByQywxTagId
(
wxEnterpriseId
,
hbTagId
)
;
Map
<
String
,
TabQywxTagItem
>
tagItemMap
=
tagItemList
.
stream
().
collect
(
Collectors
.
toMap
(
TabQywxTagItem:
:
getQywxTagItemId
,
o
->
o
,(
k1
,
k2
)->
k1
))
;
// 更新赋值
infoDTO
.
setQywxGroupKey
(
qwGroupKey
);
// 需要删除的标签值
/* for(TabQywxTagRelation relation : relationList) {
String memberItemTagId = relation.getTagItemId() ;
if(!memberTagItemIdList.contains(memberItemTagId) && relation.getRelationType()==1) {
this.qywxTagRelationMapper.deleteByPrimaryKey(relation.getQywxTagRelationId()) ;
String hbTagItemId = relation.getQywxTagItemId() ;
this.qywxTagService.delQywxTagItemById(wxEnterpriseId,hbTagItemId) ;
TabQywxTagItem tagItem = tagItemMap.get(hbTagItemId) ;
if(null != tagItem) {
needDelList.add(tagItem.getQywxTagKey()) ;
}
}
}
if(CollectionUtils.isNotEmpty(needDelList)) {
this.qywxSuiteApiService.delCorpTag(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), needDelList, 1, qwDTO.isSelf(),qwDTO.getUrlHost());
}*/
// 需要添加的标签值
List
<
String
>
existMemberTagIdList
=
relationList
.
stream
().
map
(
o
->
o
.
getTagItemId
()).
collect
(
Collectors
.
toList
());
for
(
QywxTagItemDTO
memberTag
:
items
)
{
...
...
@@ -193,7 +146,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
}
items
=
needAddList
;
logger
.
info
(
"更新标签,
删除={},新增={}"
,
needDelList
,
needAddList
);
logger
.
info
(
"更新标签,
新增={}"
,
needAddList
);
}
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
info
(
"没有需要处理的标签"
);
...
...
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