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
9362d993
Commit
9362d993
authored
Apr 23, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自建
parent
bfb69aad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
53 deletions
+49
-53
GroupMessageServiceImpl.java
...service/service/content/impl/GroupMessageServiceImpl.java
+38
-36
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+1
-7
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+10
-10
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/GroupMessageServiceImpl.java
View file @
9362d993
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
content
.
impl
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.DateUtil
;
...
...
@@ -24,6 +40,7 @@ import com.gic.haoban.manage.service.service.content.ClerkShareLogService;
import
com.gic.haoban.manage.service.service.content.GroupMessageService
;
import
com.gic.haoban.manage.service.service.content.TriggerCustomerDetailService
;
import
com.gic.haoban.manage.service.service.content.adaptor.MaterialEnterpriseAdaptor
;
import
com.gic.haoban.manage.service.util.QwUtils
;
import
com.gic.wechat.api.dto.qdto.group.QywxGroupMessageQDTO
;
import
com.gic.wechat.api.dto.qdto.group.QywxGroupMsgSendResultQDTO
;
import
com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO
;
...
...
@@ -35,21 +52,6 @@ import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO;
import
com.gic.wechat.api.dto.qywx.group.QywxMomentSendResultRespDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @Author MUSI
...
...
@@ -199,7 +201,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
}
// 发送到群
List
<
QywxGroupMessageInfoDTO
>
sendWithGroupMsg
=
this
.
queryGroupMsg
(
corpId
,
GroupMsgChatType
.
group
,
groupMessageInfoBo
.
getStartTime
(),
groupMessageInfoBo
.
getEndTime
());
groupMessageInfoBo
.
getStartTime
(),
groupMessageInfoBo
.
getEndTime
()
,
qwInfo
);
// 匹配msgId
List
<
ClerkShareLogBO
>
shareLogWithGroup
=
clerkShareLogBos
.
stream
()
...
...
@@ -227,7 +229,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
}
String
msgId
=
qywxGroupMessageInfoDTO
.
getMsgId
();
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>
groupMsgSendResultInfos
=
this
.
queryGroupMsgSendResult
(
corpId
,
msgId
,
userId
,
null
);
this
.
queryGroupMsgSendResult
(
corpId
,
msgId
,
userId
,
null
,
qwInfo
);
if
(
CollectionUtils
.
isEmpty
(
groupMsgSendResultInfos
))
{
log
.
info
(
"根据msgId: {}查询群发结果异常.staffId: {}"
,
msgId
,
shareLogInfo
.
getStaffId
());
continue
;
...
...
@@ -274,7 +276,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
}
// 发送给客户的消息
List
<
QywxGroupMessageInfoDTO
>
sendWithCustomerMsg
=
this
.
queryGroupMsg
(
corpId
,
GroupMsgChatType
.
single
,
groupMessageInfoBo
.
getStartTime
(),
groupMessageInfoBo
.
getEndTime
());
groupMessageInfoBo
.
getStartTime
(),
groupMessageInfoBo
.
getEndTime
()
,
qwInfo
);
List
<
ClerkShareLogBO
>
shareLogsWithCustomer
=
clerkShareLogBos
.
stream
()
...
...
@@ -303,7 +305,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
userId
=
staff
.
getWxOpenUseId
();
}
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>
groupMsgSendResultInfos
=
this
.
queryGroupMsgSendResult
(
corpId
,
qywxGroupMessageInfoDTO
.
getMsgId
(),
userId
,
null
);
this
.
queryGroupMsgSendResult
(
corpId
,
qywxGroupMessageInfoDTO
.
getMsgId
(),
userId
,
null
,
qwInfo
);
this
.
saveTriggerCustomerDetailLogWithSingle
(
shareLogInfo
,
groupMsgSendResultInfos
);
}
}
...
...
@@ -340,7 +342,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if
(
qwInfo
.
needOpenUserId3th
())
{
userId
=
staff
.
getWxOpenUseId
();
}
List
<
String
>
externalUserIds
=
this
.
queryMomentResult
(
corpId
,
userId
,
clerkShareLogBo
.
getCreateTime
());
List
<
String
>
externalUserIds
=
this
.
queryMomentResult
(
corpId
,
userId
,
clerkShareLogBo
.
getCreateTime
()
,
qwInfo
);
if
(
CollectionUtils
.
isEmpty
(
externalUserIds
))
{
log
.
info
(
"处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}"
,
clerkShareLogBo
.
getStaffId
());
return
;
...
...
@@ -402,17 +404,17 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param endTime
* @return
*/
private
List
<
QywxGroupMessageInfoDTO
>
queryGroupMsg
(
String
corpid
,
GroupMsgChatType
groupMsgChatType
,
Date
startTime
,
Date
endTime
)
{
private
List
<
QywxGroupMessageInfoDTO
>
queryGroupMsg
(
String
corpid
,
GroupMsgChatType
groupMsgChatType
,
Date
startTime
,
Date
endTime
,
WxEnterpriseQwDTO
qwDTO
)
{
List
<
QywxGroupMessageInfoDTO
>
groupMessageInfos
=
new
ArrayList
<>();
QywxGroupMessageQDTO
groupMessageQDTO
=
new
QywxGroupMessageQDTO
();
groupMessageQDTO
.
setCorpid
(
corpid
);
groupMessageQDTO
.
setStartTime
(
startTime
.
getTime
()
/
1000
);
groupMessageQDTO
.
setEndTime
(
endTime
.
getTime
()
/
1000
);
groupMessageQDTO
.
setSuiteid
(
config
.
getWxSuiteid
(
));
groupMessageQDTO
.
setSuiteid
(
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()
));
groupMessageQDTO
.
setChatType
(
groupMsgChatType
.
getCode
());
groupMessageQDTO
.
setPageSize
(
100
);
ServiceResponse
<
QywxGroupMsgResp
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxGroupMessageList
(
groupMessageQDTO
);
qywxSuiteApiService
.
queryQywxGroupMessageList
(
groupMessageQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getGroupMessageInfos
()))
{
log
.
info
(
"获取群发任务记录异常 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
Collections
.
emptyList
();
...
...
@@ -427,7 +429,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
log
.
info
(
"查询群消息 第{}次查询"
,
loopTimes
);
groupMessageQDTO
.
setCursor
(
cursor
);
ServiceResponse
<
QywxGroupMsgResp
>
tempResponse
=
qywxSuiteApiService
.
queryQywxGroupMessageList
(
groupMessageQDTO
);
qywxSuiteApiService
.
queryQywxGroupMessageList
(
groupMessageQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
tempResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
tempResponse
.
getResult
().
getGroupMessageInfos
()))
{
log
.
info
(
"查询群消息异常 跳出循环 {}"
,
loopTimes
);
break
;
...
...
@@ -446,15 +448,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param userId
* @param cursor
*/
private
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>
queryGroupMsgSendResult
(
String
corpid
,
String
msgId
,
String
userId
,
String
cursor
)
{
private
List
<
QywxGroupMsgSendResultDTO
.
GroupMsgSendResultInfo
>
queryGroupMsgSendResult
(
String
corpid
,
String
msgId
,
String
userId
,
String
cursor
,
WxEnterpriseQwDTO
qwDTO
)
{
QywxGroupMsgSendResultQDTO
searchQDTO
=
new
QywxGroupMsgSendResultQDTO
();
searchQDTO
.
setCorpid
(
corpid
);
searchQDTO
.
setSuiteid
(
config
.
getWxSuiteid
(
));
searchQDTO
.
setSuiteid
(
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()
));
searchQDTO
.
setPageSize
(
1000
);
searchQDTO
.
setMsgId
(
msgId
);
searchQDTO
.
setUserId
(
userId
);
searchQDTO
.
setCursor
(
cursor
);
ServiceResponse
<
QywxGroupMsgSendResultDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxGroupMsgSendResult
(
searchQDTO
);
ServiceResponse
<
QywxGroupMsgSendResultDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxGroupMsgSendResult
(
searchQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getSendResultInfos
()))
{
return
Collections
.
emptyList
();
}
...
...
@@ -463,7 +465,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if
(
StringUtils
.
isNotBlank
(
serviceResponse
.
getResult
().
getCursor
()))
{
log
.
info
(
"递归获取成员群发结果 >>>>> "
);
String
tempCursor
=
serviceResponse
.
getResult
().
getCursor
();
groupMsgSendResultInfos
.
addAll
(
this
.
queryGroupMsgSendResult
(
corpid
,
msgId
,
userId
,
tempCursor
));
groupMsgSendResultInfos
.
addAll
(
this
.
queryGroupMsgSendResult
(
corpid
,
msgId
,
userId
,
tempCursor
,
qwDTO
));
}
return
groupMsgSendResultInfos
;
}
...
...
@@ -475,16 +477,16 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param userId
* @return
*/
public
List
<
String
>
queryMomentResult
(
String
corpid
,
String
userId
,
Date
createTime
)
{
public
List
<
String
>
queryMomentResult
(
String
corpid
,
String
userId
,
Date
createTime
,
WxEnterpriseQwDTO
qwDTO
)
{
QywxMomentInfoQDTO
qywxMomentInfoQDTO
=
new
QywxMomentInfoQDTO
();
qywxMomentInfoQDTO
.
setCorpid
(
corpid
);
qywxMomentInfoQDTO
.
setSuiteid
(
config
.
getWxSuiteid
(
));
qywxMomentInfoQDTO
.
setSuiteid
(
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()
));
qywxMomentInfoQDTO
.
setStartTime
(
DateUtil
.
addNumForSecond
(
createTime
,
-
60
).
getTime
()
/
1000
);
qywxMomentInfoQDTO
.
setEndTime
((
createTime
.
getTime
()
/
1000
)
+
10
);
qywxMomentInfoQDTO
.
setCreatorId
(
userId
);
qywxMomentInfoQDTO
.
setPageSize
(
20
);
ServiceResponse
<
QywxMomentRespDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxMomentList
(
qywxMomentInfoQDTO
);
ServiceResponse
<
QywxMomentRespDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxMomentList
(
qywxMomentInfoQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getQywxMomentInfos
()))
{
log
.
info
(
"查询客户发表朋友圈记录失败 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
Collections
.
emptyList
();
...
...
@@ -495,19 +497,19 @@ public class GroupMessageServiceImpl implements GroupMessageService {
.
stream
()
.
min
((
first
,
second
)
->
(
int
)
(
Math
.
abs
(
first
.
getCreateTime
()
-
filterTime
)
-
Math
.
abs
(
second
.
getCreateTime
()
-
filterTime
)));
if
(
min
.
isPresent
())
{
return
this
.
queryMomentSendResultList
(
corpid
,
userId
,
min
.
get
().
getMomentId
());
return
this
.
queryMomentSendResultList
(
corpid
,
userId
,
min
.
get
().
getMomentId
()
,
qwDTO
);
}
return
Collections
.
emptyList
();
}
public
List
<
String
>
queryMomentSendResultList
(
String
corpid
,
String
userId
,
String
momentId
)
{
public
List
<
String
>
queryMomentSendResultList
(
String
corpid
,
String
userId
,
String
momentId
,
WxEnterpriseQwDTO
qwDTO
)
{
QywxMomentSendResultQDTO
qywxMomentSendResultQDTO
=
new
QywxMomentSendResultQDTO
();
qywxMomentSendResultQDTO
.
setCorpid
(
corpid
);
qywxMomentSendResultQDTO
.
setSuiteid
(
config
.
getWxSuiteid
(
));
qywxMomentSendResultQDTO
.
setSuiteid
(
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()
));
qywxMomentSendResultQDTO
.
setMomentId
(
momentId
);
qywxMomentSendResultQDTO
.
setUserId
(
userId
);
qywxMomentSendResultQDTO
.
setPageSize
(
1000
);
ServiceResponse
<
QywxMomentSendResultRespDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxMomentSendResult
(
qywxMomentSendResultQDTO
);
ServiceResponse
<
QywxMomentSendResultRespDTO
>
serviceResponse
=
qywxSuiteApiService
.
queryQywxMomentSendResult
(
qywxMomentSendResultQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getQywxMomentSendResults
()))
{
log
.
info
(
"查询朋友圈发送结果异常 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
Collections
.
emptyList
();
...
...
@@ -525,7 +527,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
loopTimes
++;
log
.
info
(
"查询群消息 第{}次查询"
,
loopTimes
);
qywxMomentSendResultQDTO
.
setCursor
(
cursor
);
ServiceResponse
<
QywxMomentSendResultRespDTO
>
tempResponse
=
qywxSuiteApiService
.
queryQywxMomentSendResult
(
qywxMomentSendResultQDTO
);
ServiceResponse
<
QywxMomentSendResultRespDTO
>
tempResponse
=
qywxSuiteApiService
.
queryQywxMomentSendResult
(
qywxMomentSendResultQDTO
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
()
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getQywxMomentSendResults
()))
{
break
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
9362d993
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -68,12 +67,10 @@ import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabExternalMemberLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.exception.WxApiLimitException
;
...
...
@@ -112,7 +109,6 @@ import com.gic.member.tag.api.dto.outapi.MemberTagSingleDTO;
import
com.gic.member.tag.api.service.MemberTagOpenApiService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.QywxNewExternalUseridDTO
;
import
com.gic.wechat.api.dto.qywx.UnionidToExternalUseridDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
...
...
@@ -163,8 +159,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired
private
CustomerApiService
customerApiService
;
@Autowired
private
WxApplicationMapper
wxApplicationMapper
;
@Autowired
private
MemberApiService
memberApiService
;
@Autowired
private
TabHaobanExternalClerkRelatedMapper
externalClerkRelatedMapper
;
...
...
@@ -1151,7 +1145,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
qwDTO
==
null
)
{
return
null
;
}
return
qywxSuiteApiService
.
resultExternalMessage
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
wxMessageId
,
qwDTO
.
isSelf
());
return
qywxSuiteApiService
.
resultExternalMessage
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
wxMessageId
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
}
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
9362d993
...
...
@@ -94,7 +94,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"企业标签所在企业不存在"
);
return
;
}
QywxGetCorpTagListDTO
corpTagListResp
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
null
,
-
1
,
qwDTO
.
isSelf
());
QywxGetCorpTagListDTO
corpTagListResp
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
null
,
-
1
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
if
(
corpTagListResp
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"企业微信标签有问题:{}"
,
wxEnterpriseId
);
return
;
...
...
@@ -205,7 +205,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
return
qywxSuiteApiService
.
saveCorpTag
(
corpid
,
secret
,
qywxTagGroupDTO
,
qwDTO
.
isSelf
());
return
qywxSuiteApiService
.
saveCorpTag
(
corpid
,
secret
,
qywxTagGroupDTO
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
}
@Override
...
...
@@ -225,7 +225,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
0
,
qwDTO
.
isSelf
());
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
0
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"关闭同步:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -253,7 +253,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if
(
qwDTO
.
isSelf
())
{
secret
=
qwDTO
.
getSelfSecret
()
;
}
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
1
,
qwDTO
.
isSelf
());
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
delCorpTag
(
qwDTO
.
getThirdCorpid
(),
secret
,
delIds
,
1
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"删除标签项:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -297,7 +297,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"新增标签组无需操作:{}"
,
callbackDTO
.
getTagId
());
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
callbackDTO
.
getTagId
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"没有关联,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
return
;
...
...
@@ -310,7 +310,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//查找对应的标签组 如果标签组关联了
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
callbackDTO
.
getTagId
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getType
()
,
qwDTO
.
isSelf
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getType
()
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"查询失败,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
return
;
...
...
@@ -417,7 +417,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
callbackDTO
.
getTagId
());
qywxTagDTO
.
setName
(
qywxGroupKey
.
getQywxGroupName
());
qywxTagDTO
.
setOrder
(
qywxGroupKey
.
getOrder
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
//标签项
}
else
if
(
Objects
.
equals
(
relationTypeEnum
.
getTagType
(),
QywxTagRelationTypeEnum
.
TAG_ITEM
.
getTagType
()))
{
...
...
@@ -437,7 +437,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
callbackDTO
.
getTagId
());
qywxTagDTO
.
setName
(
qywxTagItem
.
getQywxTagName
());
qywxTagDTO
.
setOrder
(
qywxTagItem
.
getOrder
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
());
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
}
}
...
...
@@ -776,7 +776,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO
.
setId
(
renameQywxKey
);
qywxTagDTO
.
setName
(
name
);
qywxTagDTO
.
setOrder
(
order
);
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
());
QywxResponseDTO
responseDTO
=
qywxSuiteApiService
.
editCorpTagNameOrOrder
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
qywxTagDTO
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"同步名称:{}"
,
JSONObject
.
toJSONString
(
responseDTO
));
if
(
responseDTO
.
getErrcode
()
!=
0
)
{
resp
.
setMessage
(
responseDTO
.
getErrmsg
());
...
...
@@ -859,7 +859,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
relation
.
getWxEnterpriseId
())
;
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
tabQywxTag
.
getQywxGroupKey
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
());
QywxGetCorpTagListDTO
tagDetail
=
qywxSuiteApiService
.
getCorpTagList
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
ids
,
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
()
);
if
(
tagDetail
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"查询失败,无需操作:{}"
,
JSONObject
.
toJSONString
(
tagDetail
));
ret
.
put
(
"描述"
,
"查询失败:"
+
tagDetail
.
getErrmsg
());
...
...
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