This commit is contained in:
zhn
2022-06-09 10:29:50 +08:00
parent 32eb453e47
commit 01dd3282a9
@@ -3012,7 +3012,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
//订阅技术领域发消息
List<DomainUserRel> domainUserRelList = domainManageService.list();
List<String> thirdIdListAll = new ArrayList<>();
List<String> userListAll = new ArrayList<>();
List<String> thirdIdList = new ArrayList<>();
List<String> userList = new ArrayList<>();
String technologyTerritoryNameEn = "";
if(StringUtils.isNotBlank(technologyTerritory) && !technologyTerritory.equals(technologyTerritoryNew) && domainUserRelList.size() != 0){
List<DomainUserRel> collect = domainUserRelList.stream()
@@ -3025,6 +3028,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<SysUser> sysUsersFeishu = this.sysUserMapper.selectBatchIds(userIdList);
if(sysUsersFeishu.size() != 0){
thirdIdList = sysUsersFeishu.stream().map(SysUser::getThirdId).collect(Collectors.toList());
userList = sysUsersFeishu.stream().map(SysUser::getId).collect(Collectors.toList());
if(thirdIdList.size() != 0){
thirdIdListAll.addAll(thirdIdList);
}
if(userList.size() != 0){
userListAll.addAll(userList);
}
}
}
if(domainIdList.size() != 0){
@@ -3060,25 +3070,33 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(sysUsers)) {
userIdListUpdate = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
userIdListUpdateFeishu = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
if(userIdListUpdate.size() != 0){
userListAll.addAll(userIdListUpdate);
}
if(userIdListUpdateFeishu.size() != 0){
thirdIdListAll.addAll(userIdListUpdateFeishu);
}
}
}
}
//飞书消息
if(thirdIdList.size() != 0){
if(thirdIdListAll.size() != 0){
thirdIdListAll = thirdIdListAll.stream().distinct().collect(Collectors.toList());
try {
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
category + " " + serialNumber+" has been updated.";
//跳转文档详情
String url = backUrl + "/docManage/library/detail?id=" + id;
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
iFeishuService.batchSendMessage(thirdIdListAll.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
} catch (IOException e) {
log.error("文档新增飞书消息推送失败");
}
}
//站内消息
if(CollectionUtils.isNotEmpty(userIdListUpdate)){
if(CollectionUtils.isNotEmpty(userListAll)){
userListAll = userListAll.stream().distinct().collect(Collectors.toList());
String title = (String) map.get("title");
String href = "<a href='/docManage/library/detail?id=" + id +
"&title=" + title +
@@ -3090,20 +3108,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String content = "In the "+serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
String contentInfo = "In the "+href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, content, contentInfo);
SysAnnouncement sysAnnouncement = getSysAnnouncement(userListAll, content, contentInfo);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket((String) map.get("id"), contentInfo);
}
//订阅文档的飞书消息
try {
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
category + " " + serialNumber+" has been updated.";
//跳转文档详情
String url = backUrl + "/docManage/library/detail?id=" + id;
iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
} catch (IOException e) {
log.error("文档新增飞书消息推送失败");
}
// try {
// String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
// category + " " + serialNumber+" has been updated.";
// //跳转文档详情
// String url = backUrl + "/docManage/library/detail?id=" + id;
// iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
// } catch (IOException e) {
// log.error("文档新增飞书消息推送失败");
// }
}
// }
//2. 处理修改代替标准的发送消息(法规负责人)