Commit 33e49908 by 徐高华

Merge branch 'feature/自建应用验证' into 'developer'

Feature/自建应用验证

See merge request !1195
parents 34f45e1e 9362d993
package com.gic.haoban.manage.service.service.content.impl; 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.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil; import com.gic.commons.util.DateUtil;
...@@ -24,6 +40,7 @@ import com.gic.haoban.manage.service.service.content.ClerkShareLogService; ...@@ -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.GroupMessageService;
import com.gic.haoban.manage.service.service.content.TriggerCustomerDetailService; 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.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.QywxGroupMessageQDTO;
import com.gic.wechat.api.dto.qdto.group.QywxGroupMsgSendResultQDTO; import com.gic.wechat.api.dto.qdto.group.QywxGroupMsgSendResultQDTO;
import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO; import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO;
...@@ -35,21 +52,6 @@ import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO; ...@@ -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.dto.qywx.group.QywxMomentSendResultRespDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.google.common.collect.Lists; 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 * @Author MUSI
...@@ -199,7 +201,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -199,7 +201,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
} }
// 发送到群 // 发送到群
List<QywxGroupMessageInfoDTO> sendWithGroupMsg = this.queryGroupMsg(corpId, GroupMsgChatType.group, List<QywxGroupMessageInfoDTO> sendWithGroupMsg = this.queryGroupMsg(corpId, GroupMsgChatType.group,
groupMessageInfoBo.getStartTime(), groupMessageInfoBo.getEndTime()); groupMessageInfoBo.getStartTime(), groupMessageInfoBo.getEndTime(),qwInfo);
// 匹配msgId // 匹配msgId
List<ClerkShareLogBO> shareLogWithGroup = clerkShareLogBos List<ClerkShareLogBO> shareLogWithGroup = clerkShareLogBos
.stream() .stream()
...@@ -227,7 +229,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -227,7 +229,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
} }
String msgId = qywxGroupMessageInfoDTO.getMsgId(); String msgId = qywxGroupMessageInfoDTO.getMsgId();
List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo> groupMsgSendResultInfos = List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo> groupMsgSendResultInfos =
this.queryGroupMsgSendResult(corpId, msgId, userId, null); this.queryGroupMsgSendResult(corpId, msgId, userId, null,qwInfo);
if (CollectionUtils.isEmpty(groupMsgSendResultInfos)) { if (CollectionUtils.isEmpty(groupMsgSendResultInfos)) {
log.info("根据msgId: {}查询群发结果异常.staffId: {}", msgId, shareLogInfo.getStaffId()); log.info("根据msgId: {}查询群发结果异常.staffId: {}", msgId, shareLogInfo.getStaffId());
continue; continue;
...@@ -274,7 +276,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -274,7 +276,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
} }
// 发送给客户的消息 // 发送给客户的消息
List<QywxGroupMessageInfoDTO> sendWithCustomerMsg = this.queryGroupMsg(corpId, GroupMsgChatType.single, List<QywxGroupMessageInfoDTO> sendWithCustomerMsg = this.queryGroupMsg(corpId, GroupMsgChatType.single,
groupMessageInfoBo.getStartTime(), groupMessageInfoBo.getEndTime()); groupMessageInfoBo.getStartTime(), groupMessageInfoBo.getEndTime(),qwInfo);
List<ClerkShareLogBO> shareLogsWithCustomer = clerkShareLogBos List<ClerkShareLogBO> shareLogsWithCustomer = clerkShareLogBos
.stream() .stream()
...@@ -303,7 +305,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -303,7 +305,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
userId = staff.getWxOpenUseId(); userId = staff.getWxOpenUseId();
} }
List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo> groupMsgSendResultInfos = List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo> groupMsgSendResultInfos =
this.queryGroupMsgSendResult(corpId, qywxGroupMessageInfoDTO.getMsgId(), userId, null); this.queryGroupMsgSendResult(corpId, qywxGroupMessageInfoDTO.getMsgId(), userId, null,qwInfo);
this.saveTriggerCustomerDetailLogWithSingle(shareLogInfo, groupMsgSendResultInfos); this.saveTriggerCustomerDetailLogWithSingle(shareLogInfo, groupMsgSendResultInfos);
} }
} }
...@@ -340,7 +342,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -340,7 +342,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if (qwInfo.needOpenUserId3th()) { if (qwInfo.needOpenUserId3th()) {
userId = staff.getWxOpenUseId(); 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)) { if (CollectionUtils.isEmpty(externalUserIds)) {
log.info("处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}", clerkShareLogBo.getStaffId()); log.info("处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}", clerkShareLogBo.getStaffId());
return; return;
...@@ -402,17 +404,17 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -402,17 +404,17 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param endTime * @param endTime
* @return * @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<>(); List<QywxGroupMessageInfoDTO> groupMessageInfos = new ArrayList<>();
QywxGroupMessageQDTO groupMessageQDTO = new QywxGroupMessageQDTO(); QywxGroupMessageQDTO groupMessageQDTO = new QywxGroupMessageQDTO();
groupMessageQDTO.setCorpid(corpid); groupMessageQDTO.setCorpid(corpid);
groupMessageQDTO.setStartTime(startTime.getTime() / 1000); groupMessageQDTO.setStartTime(startTime.getTime() / 1000);
groupMessageQDTO.setEndTime(endTime.getTime() / 1000); groupMessageQDTO.setEndTime(endTime.getTime() / 1000);
groupMessageQDTO.setSuiteid(config.getWxSuiteid()); groupMessageQDTO.setSuiteid(QwUtils.getSecret(qwDTO, config.getWxSuiteid()));
groupMessageQDTO.setChatType(groupMsgChatType.getCode()); groupMessageQDTO.setChatType(groupMsgChatType.getCode());
groupMessageQDTO.setPageSize(100); groupMessageQDTO.setPageSize(100);
ServiceResponse<QywxGroupMsgResp> serviceResponse = ServiceResponse<QywxGroupMsgResp> serviceResponse =
qywxSuiteApiService.queryQywxGroupMessageList(groupMessageQDTO); qywxSuiteApiService.queryQywxGroupMessageList(groupMessageQDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getGroupMessageInfos())) { if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getGroupMessageInfos())) {
log.info("获取群发任务记录异常 {}", JSON.toJSONString(serviceResponse)); log.info("获取群发任务记录异常 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList(); return Collections.emptyList();
...@@ -427,7 +429,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -427,7 +429,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
log.info("查询群消息 第{}次查询", loopTimes); log.info("查询群消息 第{}次查询", loopTimes);
groupMessageQDTO.setCursor(cursor); groupMessageQDTO.setCursor(cursor);
ServiceResponse<QywxGroupMsgResp> tempResponse = ServiceResponse<QywxGroupMsgResp> tempResponse =
qywxSuiteApiService.queryQywxGroupMessageList(groupMessageQDTO); qywxSuiteApiService.queryQywxGroupMessageList(groupMessageQDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
if (!tempResponse.isSuccess() || CollectionUtils.isEmpty(tempResponse.getResult().getGroupMessageInfos())) { if (!tempResponse.isSuccess() || CollectionUtils.isEmpty(tempResponse.getResult().getGroupMessageInfos())) {
log.info("查询群消息异常 跳出循环 {}", loopTimes); log.info("查询群消息异常 跳出循环 {}", loopTimes);
break; break;
...@@ -446,15 +448,15 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -446,15 +448,15 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param userId * @param userId
* @param cursor * @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(); QywxGroupMsgSendResultQDTO searchQDTO = new QywxGroupMsgSendResultQDTO();
searchQDTO.setCorpid(corpid); searchQDTO.setCorpid(corpid);
searchQDTO.setSuiteid(config.getWxSuiteid()); searchQDTO.setSuiteid(QwUtils.getSecret(qwDTO, config.getWxSuiteid()));
searchQDTO.setPageSize(1000); searchQDTO.setPageSize(1000);
searchQDTO.setMsgId(msgId); searchQDTO.setMsgId(msgId);
searchQDTO.setUserId(userId); searchQDTO.setUserId(userId);
searchQDTO.setCursor(cursor); 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())) { if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getSendResultInfos())) {
return Collections.emptyList(); return Collections.emptyList();
} }
...@@ -463,7 +465,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -463,7 +465,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if (StringUtils.isNotBlank(serviceResponse.getResult().getCursor())) { if (StringUtils.isNotBlank(serviceResponse.getResult().getCursor())) {
log.info("递归获取成员群发结果 >>>>> "); log.info("递归获取成员群发结果 >>>>> ");
String tempCursor = serviceResponse.getResult().getCursor(); String tempCursor = serviceResponse.getResult().getCursor();
groupMsgSendResultInfos.addAll(this.queryGroupMsgSendResult(corpid, msgId, userId, tempCursor)); groupMsgSendResultInfos.addAll(this.queryGroupMsgSendResult(corpid, msgId, userId, tempCursor,qwDTO));
} }
return groupMsgSendResultInfos; return groupMsgSendResultInfos;
} }
...@@ -475,16 +477,16 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -475,16 +477,16 @@ public class GroupMessageServiceImpl implements GroupMessageService {
* @param userId * @param userId
* @return * @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 qywxMomentInfoQDTO = new QywxMomentInfoQDTO();
qywxMomentInfoQDTO.setCorpid(corpid); qywxMomentInfoQDTO.setCorpid(corpid);
qywxMomentInfoQDTO.setSuiteid(config.getWxSuiteid()); qywxMomentInfoQDTO.setSuiteid(QwUtils.getSecret(qwDTO, config.getWxSuiteid()));
qywxMomentInfoQDTO.setStartTime(DateUtil.addNumForSecond(createTime, -60).getTime() / 1000); qywxMomentInfoQDTO.setStartTime(DateUtil.addNumForSecond(createTime, -60).getTime() / 1000);
qywxMomentInfoQDTO.setEndTime((createTime.getTime() / 1000) + 10); qywxMomentInfoQDTO.setEndTime((createTime.getTime() / 1000) + 10);
qywxMomentInfoQDTO.setCreatorId(userId); qywxMomentInfoQDTO.setCreatorId(userId);
qywxMomentInfoQDTO.setPageSize(20); 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())) { if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getQywxMomentInfos())) {
log.info("查询客户发表朋友圈记录失败 {}", JSON.toJSONString(serviceResponse)); log.info("查询客户发表朋友圈记录失败 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList(); return Collections.emptyList();
...@@ -495,19 +497,19 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -495,19 +497,19 @@ public class GroupMessageServiceImpl implements GroupMessageService {
.stream() .stream()
.min((first, second) -> (int) (Math.abs(first.getCreateTime() - filterTime) - Math.abs(second.getCreateTime() - filterTime))); .min((first, second) -> (int) (Math.abs(first.getCreateTime() - filterTime) - Math.abs(second.getCreateTime() - filterTime)));
if (min.isPresent()) { if (min.isPresent()) {
return this.queryMomentSendResultList(corpid, userId, min.get().getMomentId()); return this.queryMomentSendResultList(corpid, userId, min.get().getMomentId(),qwDTO);
} }
return Collections.emptyList(); 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 qywxMomentSendResultQDTO = new QywxMomentSendResultQDTO();
qywxMomentSendResultQDTO.setCorpid(corpid); qywxMomentSendResultQDTO.setCorpid(corpid);
qywxMomentSendResultQDTO.setSuiteid(config.getWxSuiteid()); qywxMomentSendResultQDTO.setSuiteid(QwUtils.getSecret(qwDTO, config.getWxSuiteid()));
qywxMomentSendResultQDTO.setMomentId(momentId); qywxMomentSendResultQDTO.setMomentId(momentId);
qywxMomentSendResultQDTO.setUserId(userId); qywxMomentSendResultQDTO.setUserId(userId);
qywxMomentSendResultQDTO.setPageSize(1000); 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())) { if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getQywxMomentSendResults())) {
log.info("查询朋友圈发送结果异常 {}", JSON.toJSONString(serviceResponse)); log.info("查询朋友圈发送结果异常 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList(); return Collections.emptyList();
...@@ -525,7 +527,7 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -525,7 +527,7 @@ public class GroupMessageServiceImpl implements GroupMessageService {
loopTimes++; loopTimes++;
log.info("查询群消息 第{}次查询", loopTimes); log.info("查询群消息 第{}次查询", loopTimes);
qywxMomentSendResultQDTO.setCursor(cursor); 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())) { if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getQywxMomentSendResults())) {
break; break;
} }
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -68,12 +67,10 @@ import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; ...@@ -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.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; 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.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.TabExternalMemberLog;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated; import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; 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.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.exception.WxApiLimitException; import com.gic.haoban.manage.service.exception.WxApiLimitException;
...@@ -112,7 +109,6 @@ import com.gic.member.tag.api.dto.outapi.MemberTagSingleDTO; ...@@ -112,7 +109,6 @@ import com.gic.member.tag.api.dto.outapi.MemberTagSingleDTO;
import com.gic.member.tag.api.service.MemberTagOpenApiService; import com.gic.member.tag.api.service.MemberTagOpenApiService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil; 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.dto.qywx.UnionidToExternalUseridDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
...@@ -163,8 +159,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -163,8 +159,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired @Autowired
private CustomerApiService customerApiService; private CustomerApiService customerApiService;
@Autowired @Autowired
private WxApplicationMapper wxApplicationMapper;
@Autowired
private MemberApiService memberApiService; private MemberApiService memberApiService;
@Autowired @Autowired
private TabHaobanExternalClerkRelatedMapper externalClerkRelatedMapper; private TabHaobanExternalClerkRelatedMapper externalClerkRelatedMapper;
...@@ -1151,7 +1145,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1151,7 +1145,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if (qwDTO == null) { if (qwDTO == null) {
return 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 @Override
......
...@@ -94,7 +94,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -94,7 +94,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("企业标签所在企业不存在"); logger.info("企业标签所在企业不存在");
return; 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) { if (corpTagListResp.getErrcode() != 0) {
logger.info("企业微信标签有问题:{}", wxEnterpriseId); logger.info("企业微信标签有问题:{}", wxEnterpriseId);
return; return;
...@@ -205,7 +205,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -205,7 +205,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if(qwDTO.isSelf()) { if(qwDTO.isSelf()) {
secret = qwDTO.getSelfSecret() ; secret = qwDTO.getSelfSecret() ;
} }
return qywxSuiteApiService.saveCorpTag(corpid, secret, qywxTagGroupDTO , qwDTO.isSelf()); return qywxSuiteApiService.saveCorpTag(corpid, secret, qywxTagGroupDTO , qwDTO.isSelf(),qwDTO.getUrlHost());
} }
@Override @Override
...@@ -225,7 +225,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -225,7 +225,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if(qwDTO.isSelf()) { if(qwDTO.isSelf()) {
secret = qwDTO.getSelfSecret() ; 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)); logger.info("关闭同步:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) { if (responseDTO.getErrcode() != 0) {
resp.setMessage(responseDTO.getErrmsg()); resp.setMessage(responseDTO.getErrmsg());
...@@ -253,7 +253,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -253,7 +253,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
if(qwDTO.isSelf()) { if(qwDTO.isSelf()) {
secret = qwDTO.getSelfSecret() ; 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)); logger.info("删除标签项:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) { if (responseDTO.getErrcode() != 0) {
resp.setMessage(responseDTO.getErrmsg()); resp.setMessage(responseDTO.getErrmsg());
...@@ -297,7 +297,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -297,7 +297,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("新增标签组无需操作:{}", callbackDTO.getTagId()); logger.info("新增标签组无需操作:{}", callbackDTO.getTagId());
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(callbackDTO.getTagId()); 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) { if (tagDetail.getErrcode() != 0) {
logger.info("没有关联,无需操作:{}", JSONObject.toJSONString(tagDetail)); logger.info("没有关联,无需操作:{}", JSONObject.toJSONString(tagDetail));
return; return;
...@@ -310,7 +310,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -310,7 +310,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//查找对应的标签组 如果标签组关联了 //查找对应的标签组 如果标签组关联了
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(callbackDTO.getTagId()); 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) { if (tagDetail.getErrcode() != 0) {
logger.info("查询失败,无需操作:{}", JSONObject.toJSONString(tagDetail)); logger.info("查询失败,无需操作:{}", JSONObject.toJSONString(tagDetail));
return; return;
...@@ -417,7 +417,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -417,7 +417,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO.setId(callbackDTO.getTagId()); qywxTagDTO.setId(callbackDTO.getTagId());
qywxTagDTO.setName(qywxGroupKey.getQywxGroupName()); qywxTagDTO.setName(qywxGroupKey.getQywxGroupName());
qywxTagDTO.setOrder(qywxGroupKey.getOrder()); 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())) { } else if (Objects.equals(relationTypeEnum.getTagType(), QywxTagRelationTypeEnum.TAG_ITEM.getTagType())) {
...@@ -437,7 +437,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -437,7 +437,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO.setId(callbackDTO.getTagId()); qywxTagDTO.setId(callbackDTO.getTagId());
qywxTagDTO.setName(qywxTagItem.getQywxTagName()); qywxTagDTO.setName(qywxTagItem.getQywxTagName());
qywxTagDTO.setOrder(qywxTagItem.getOrder()); 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 { ...@@ -776,7 +776,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
qywxTagDTO.setId(renameQywxKey); qywxTagDTO.setId(renameQywxKey);
qywxTagDTO.setName(name); qywxTagDTO.setName(name);
qywxTagDTO.setOrder(order); 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)); logger.info("同步名称:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) { if (responseDTO.getErrcode() != 0) {
resp.setMessage(responseDTO.getErrmsg()); resp.setMessage(responseDTO.getErrmsg());
...@@ -859,7 +859,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -859,7 +859,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(relation.getWxEnterpriseId()) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(relation.getWxEnterpriseId()) ;
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
ids.add(tabQywxTag.getQywxGroupKey()); 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) { if (tagDetail.getErrcode() != 0) {
logger.info("查询失败,无需操作:{}", JSONObject.toJSONString(tagDetail)); logger.info("查询失败,无需操作:{}", JSONObject.toJSONString(tagDetail));
ret.put("描述", "查询失败:" + tagDetail.getErrmsg()); ret.put("描述", "查询失败:" + tagDetail.getErrmsg());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment