fix: 88349 外来标准法规文本库--更换负责人、取消收藏后,仍然给原来的账号发消息
This commit is contained in:
+10
-11
@@ -122,34 +122,33 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
|||||||
sendMap.put("standardName", mainStandard.getStandardName());
|
sendMap.put("standardName", mainStandard.getStandardName());
|
||||||
sendMap.put("implementationDate", simpleDateFormat.format(mainStandard.getImplementationDate()));
|
sendMap.put("implementationDate", simpleDateFormat.format(mainStandard.getImplementationDate()));
|
||||||
|
|
||||||
Set<String> userIdList = new HashSet<>();
|
Set<String> userIdSet = new HashSet<>();
|
||||||
// 拼接发送人员
|
// 拼接发送人员
|
||||||
for (String standard : replacedStandardNumberList) {
|
for (String standard : replacedStandardNumberList) {
|
||||||
// 如果有书名号的话只取书名号前的内容
|
// 如果有书名号的话只取书名号前的内容
|
||||||
standard = standard.split("《")[0];
|
standard = standard.split("《")[0];
|
||||||
LawsEnterpriseStandard replaceStandard = standardMap.get(standard);
|
LawsEnterpriseStandard replaceStandard = standardMap.get(standard);
|
||||||
// 被代替标准的主起草人,责任人,收藏标准的人员
|
// 被代替标准的主起草人,责任人,收藏标准的人员
|
||||||
userIdList.add(replaceStandard.getMainDraftingUser());
|
userIdSet.add(replaceStandard.getMainDraftingUser());
|
||||||
// 获取收藏标准的所有人员
|
// 获取收藏标准的所有人员
|
||||||
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(LawsStandardCollection::getStandardId, replaceStandard.getId());
|
wrapper.eq(LawsStandardCollection::getStandardId, replaceStandard.getId());
|
||||||
List<LawsStandardCollection> standardCollectionList = collectionService.list(wrapper);
|
List<LawsStandardCollection> standardCollectionList = collectionService.list(wrapper);
|
||||||
for (LawsStandardCollection standardCollection : standardCollectionList) {
|
for (LawsStandardCollection standardCollection : standardCollectionList) {
|
||||||
userIdList.add(standardCollection.getCollectorId());
|
userIdSet.add(standardCollection.getCollectorId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 去除最后一个分号
|
// 去除最后一个分号
|
||||||
if (CollUtil.isEmpty(userIdList)) {
|
if (CollUtil.isEmpty(userIdSet)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sendMessageDTO.setToUserId(String.join(",", userIdList));
|
sendMessageDTO.setToUserId(String.join(",", userIdSet));
|
||||||
sendMessageDTO.setMap(sendMap);
|
sendMessageDTO.setMap(sendMap);
|
||||||
sendMessageAPI.sendMessage(sendMessageDTO);
|
sendMessageAPI.sendMessage(sendMessageDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendGbStandardMsg() {
|
private void sendGbStandardMsg() {
|
||||||
// 新标准到实施日期后,老标准状态变为废止
|
|
||||||
List<String> allExpireStandardNumberList = new ArrayList<>();
|
List<String> allExpireStandardNumberList = new ArrayList<>();
|
||||||
// 获取所有已经到了外部标准
|
// 获取所有已经到了外部标准
|
||||||
List<LawsDomesticStandard> standardList = dsService.list();
|
List<LawsDomesticStandard> standardList = dsService.list();
|
||||||
@@ -211,7 +210,7 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
|||||||
sendMap.put("standardName", mainStandard.getStandardName());
|
sendMap.put("standardName", mainStandard.getStandardName());
|
||||||
sendMap.put("implementationDate", simpleDateFormat.format(mainStandard.getImplementationDate()));
|
sendMap.put("implementationDate", simpleDateFormat.format(mainStandard.getImplementationDate()));
|
||||||
|
|
||||||
Set<String> userIdList = new HashSet<>();
|
Set<String> userIdSet = new HashSet<>();
|
||||||
// 拼接发送人员
|
// 拼接发送人员
|
||||||
for (String standard : replacedStandardNumberList) {
|
for (String standard : replacedStandardNumberList) {
|
||||||
// 如果有书名号的话只取书名号前的内容
|
// 如果有书名号的话只取书名号前的内容
|
||||||
@@ -229,7 +228,7 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
|||||||
masterPlanList.stream().map(LawsStandardMasterPlan::getId).collect(Collectors.toList()));
|
masterPlanList.stream().map(LawsStandardMasterPlan::getId).collect(Collectors.toList()));
|
||||||
List<LawsStandardMasterPlanSublist> sublistList = masterPlanSublistService.list(sublistWrapper);
|
List<LawsStandardMasterPlanSublist> sublistList = masterPlanSublistService.list(sublistWrapper);
|
||||||
for (LawsStandardMasterPlanSublist sublist : sublistList) {
|
for (LawsStandardMasterPlanSublist sublist : sublistList) {
|
||||||
userIdList.add(sublist.getResponsiblePerson());
|
userIdSet.add(sublist.getResponsiblePerson());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取收藏标准的所有人员
|
// 获取收藏标准的所有人员
|
||||||
@@ -237,14 +236,14 @@ public class ReplaceImplementationDateMsgJob implements Job {
|
|||||||
wrapper.eq(LawsStandardCollection::getStandardId, replaceStandard.getId());
|
wrapper.eq(LawsStandardCollection::getStandardId, replaceStandard.getId());
|
||||||
List<LawsStandardCollection> standardCollectionList = collectionService.list(wrapper);
|
List<LawsStandardCollection> standardCollectionList = collectionService.list(wrapper);
|
||||||
for (LawsStandardCollection standardCollection : standardCollectionList) {
|
for (LawsStandardCollection standardCollection : standardCollectionList) {
|
||||||
userIdList.add(standardCollection.getCollectorId());
|
userIdSet.add(standardCollection.getCollectorId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 去除最后一个分号
|
// 去除最后一个分号
|
||||||
if (CollUtil.isEmpty(userIdList)) {
|
if (CollUtil.isEmpty(userIdSet)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sendMessageDTO.setToUserId(String.join(",", userIdList));
|
sendMessageDTO.setToUserId(String.join(",", userIdSet));
|
||||||
sendMessageDTO.setMap(sendMap);
|
sendMessageDTO.setMap(sendMap);
|
||||||
sendMessageAPI.sendMessage(sendMessageDTO);
|
sendMessageAPI.sendMessage(sendMessageDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user