From 1f45a09a869dffcf9cc0340e3cde0a1af08480f2 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 10 Jun 2022 10:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BussDocumentLibraryEOServiceImpl.java | 112 ++++++++++++------ 1 file changed, 73 insertions(+), 39 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 5dd0cceba..bc920141d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -2124,11 +2124,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl dictItemList = sysDictItemServiceImpl.selectItemsAll(); + String finalCategory = category; + List stateDictItemList = dictItemList.stream() + .filter(e -> "type".equals(e.getDictCode()) && finalCategory.equals(e.getItemValue())) + .collect(Collectors.toList()); + if(stateDictItemList.size() != 0){ + category = stateDictItemList.get(0).getEnName(); + } + }else{ + category = ""; + } //只要修改了标准,就需要向订阅用户发送消息(内容为-->XXX对“GB 7258 进行了修改请及时查看”) //向订阅领域管理中订阅了该技术领域的人和文档库中订阅了该条文档的人发送消息 Map mapTemp = new HashMap<>(); @@ -3014,8 +3030,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp); //订阅技术领域发消息 List domainUserRelList = domainManageService.list(); - List thirdIdListAll = new ArrayList<>(); - List userListAll = new ArrayList<>(); +// List thirdIdListAll = new ArrayList<>(); +// List userListAll = new ArrayList<>(); List thirdIdList = new ArrayList<>(); List userList = new ArrayList<>(); String technologyTerritoryNameEn = ""; @@ -3031,12 +3047,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl", "").replaceAll("", ""); //您订阅的XXX已被修改 - 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(); + String contentInfo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to," +sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString(); +// String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString(); //封装消息的实体类 - SysAnnouncement sysAnnouncement = getSysAnnouncement(userListAll, content, contentInfo); + SysAnnouncement sysAnnouncement = getSysAnnouncement(userList, contentInfoFei, contentInfo); + sysAnnouncementService.saveAnnouncement(sysAnnouncement); + sendWebsocket((String) map.get("id"), contentInfo); + } + } + + //文档订阅 + if(CollectionUtils.isNotEmpty(userIdListUpdate)){ +// userListAll = userListAll.stream().distinct().collect(Collectors.toList()); + String title = (String) map.get("title"); + String href = "" + serialNumber + ""; + String content = ""; + if (StringUtils.isNotBlank(sbStr.toString())) { + //去掉a标签 + sbStr = sbStr.replaceAll("", "").replaceAll("", ""); + //您订阅的XXX已被修改 + content = "In the "+category + " " + serialNumber+" you subscribed to, has been modified,Please pay attention to check."; + String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString(); + //封装消息的实体类 + SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, content, contentInfo); sysAnnouncementService.saveAnnouncement(sysAnnouncement); sendWebsocket((String) map.get("id"), contentInfo); } //订阅文档的飞书消息 -// try { + 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("文档新增飞书消息推送失败"); -// } + //跳转文档详情 + String url = backUrl + "/docManage/library/detail?id=" + id; + iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), content, MessageTypeEnum.READ.getName(), url); + } catch (IOException e) { + log.error("文档新增飞书消息推送失败"); + } } // } //2. 处理修改代替标准的发送消息(法规负责人)