Commit a034a14e by 徐高华

群满处理活码30天

parent 9e1b9339
...@@ -130,6 +130,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -130,6 +130,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
return null; return null;
} }
this.updateLinkCount(hm.getWxEnterpriseId(), Arrays.asList(hmId)); this.updateLinkCount(hm.getWxEnterpriseId(), Arrays.asList(hmId));
String wxEnterpriseId = hm.getWxEnterpriseId(); ;
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.CUSTOMIZED_APP.getVal());
if (null != secretSetting && hm.getAutoCreateRoom() == 1) {
List<TabGroupChatHmRelation> chatRelation = this.groupChatHmRelationMapper.listByChatHmId(hmId);
if(CollectionUtils.isNotEmpty(chatRelation)) {
this.handleAutoCreateRoom(wxEnterpriseId, secretSetting.getSecretVal(), hm, chatRelation, null);
}
}
GroupChatHmBO bo = EntityUtil.changeEntityByJSON(GroupChatHmBO.class, hm); GroupChatHmBO bo = EntityUtil.changeEntityByJSON(GroupChatHmBO.class, hm);
return bo; return bo;
} }
...@@ -192,14 +200,16 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -192,14 +200,16 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
String configId = hm.getWxConfigId(); String configId = hm.getWxConfigId();
ServiceResponse<AddJoinWayDTO> joinResp = this.qywxChatApiService.getJoinWay(qwDTO.getDkCorpid(), secret, ServiceResponse<AddJoinWayDTO> joinResp = this.qywxChatApiService.getJoinWay(qwDTO.getDkCorpid(), secret,
configId,qwDTO.getUrlHost()); configId,qwDTO.getUrlHost());
logger.info("查询群活码={}", JSON.toJSON(joinResp)); logger.info("处理群活码满-查询群活码={}", JSON.toJSON(joinResp));
if (joinResp.isSuccess()) { if (joinResp.isSuccess()) {
AddJoinWayDTO join = joinResp.getResult(); AddJoinWayDTO join = joinResp.getResult();
List<String> qwChatIdList = join.getChat_id_list(); List<String> qwChatIdList = join.getChat_id_list();
if (CollectionUtils.isNotEmpty(qwChatIdList)) { if (CollectionUtils.isNotEmpty(qwChatIdList)) {
if (qwChatIdList.size() == 1) { if (qwChatIdList.size() == 1) {
logger.info("只有1个群"); logger.info("只有1个群");
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
return; return;
} }
List<Long> chatIdList = chatRelation.stream().map(dto -> dto.getGroupChatId()) List<Long> chatIdList = chatRelation.stream().map(dto -> dto.getGroupChatId())
...@@ -211,7 +221,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -211,7 +221,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
List<String> qwList = RolesListUtils.differenceList(qwChatIdList, hbIdList); List<String> qwList = RolesListUtils.differenceList(qwChatIdList, hbIdList);
if (qwChatIdList.size() == hbIdList.size() && CollectionUtils.isEmpty(qwList)) { if (qwChatIdList.size() == hbIdList.size() && CollectionUtils.isEmpty(qwList)) {
logger.info("群未变化"); logger.info("群未变化");
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
return; return;
} }
// 处理要踢的 // 处理要踢的
...@@ -255,7 +267,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -255,7 +267,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
List<TabGroupChat> list = this.groupChatMapper.listByWxWxChatIdListDk(wxEnterpriseId, List<TabGroupChat> list = this.groupChatMapper.listByWxWxChatIdListDk(wxEnterpriseId,
qwChatIdList); qwChatIdList);
if (CollectionUtils.isEmpty(list) || list.size() != qwChatIdList.size()) { if (CollectionUtils.isEmpty(list) || list.size() != qwChatIdList.size()) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
logger.info("查询群列表空,或数量不一致,dkList={}", qwChatIdList); logger.info("查询群列表空,或数量不一致,dkList={}", qwChatIdList);
return; return;
} }
......
...@@ -1144,7 +1144,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1144,7 +1144,7 @@ public class GroupChatServiceImpl implements GroupChatService {
if (null == chat || chat.getTotalCount() < offNum) { if (null == chat || chat.getTotalCount() < offNum) {
continue; continue;
} }
if (chat.getOffTime().getTime() + 1000 * 60 * 60 * 8 < new Date().getTime()) { if (chat.getOffTime().getTime() + 1000 * 60 * 60 * 24 * 30 < new Date().getTime()) {
logger.info("超过8小时不重试groupChatId={}", groupChatId); logger.info("超过8小时不重试groupChatId={}", groupChatId);
continue; continue;
} }
......
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