消息
This commit is contained in:
+31
-13
@@ -3012,7 +3012,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
// List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
|
// List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
|
||||||
//订阅技术领域发消息
|
//订阅技术领域发消息
|
||||||
List<DomainUserRel> domainUserRelList = domainManageService.list();
|
List<DomainUserRel> domainUserRelList = domainManageService.list();
|
||||||
|
List<String> thirdIdListAll = new ArrayList<>();
|
||||||
|
List<String> userListAll = new ArrayList<>();
|
||||||
List<String> thirdIdList = new ArrayList<>();
|
List<String> thirdIdList = new ArrayList<>();
|
||||||
|
List<String> userList = new ArrayList<>();
|
||||||
String technologyTerritoryNameEn = "";
|
String technologyTerritoryNameEn = "";
|
||||||
if(StringUtils.isNotBlank(technologyTerritory) && !technologyTerritory.equals(technologyTerritoryNew) && domainUserRelList.size() != 0){
|
if(StringUtils.isNotBlank(technologyTerritory) && !technologyTerritory.equals(technologyTerritoryNew) && domainUserRelList.size() != 0){
|
||||||
List<DomainUserRel> collect = domainUserRelList.stream()
|
List<DomainUserRel> collect = domainUserRelList.stream()
|
||||||
@@ -3025,6 +3028,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
List<SysUser> sysUsersFeishu = this.sysUserMapper.selectBatchIds(userIdList);
|
List<SysUser> sysUsersFeishu = this.sysUserMapper.selectBatchIds(userIdList);
|
||||||
if(sysUsersFeishu.size() != 0){
|
if(sysUsersFeishu.size() != 0){
|
||||||
thirdIdList = sysUsersFeishu.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
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){
|
if(domainIdList.size() != 0){
|
||||||
@@ -3060,25 +3070,33 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(sysUsers)) {
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(sysUsers)) {
|
||||||
userIdListUpdate = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
userIdListUpdate = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||||
userIdListUpdateFeishu = sysUsers.stream().map(SysUser::getThirdId).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 {
|
try {
|
||||||
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||||
category + " " + serialNumber+" has been updated.";
|
category + " " + serialNumber+" has been updated.";
|
||||||
//跳转文档详情
|
//跳转文档详情
|
||||||
String url = backUrl + "/docManage/library/detail?id=" + id;
|
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) {
|
} catch (IOException e) {
|
||||||
log.error("文档新增飞书消息推送失败");
|
log.error("文档新增飞书消息推送失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//站内消息
|
//站内消息
|
||||||
if(CollectionUtils.isNotEmpty(userIdListUpdate)){
|
if(CollectionUtils.isNotEmpty(userListAll)){
|
||||||
|
userListAll = userListAll.stream().distinct().collect(Collectors.toList());
|
||||||
String title = (String) map.get("title");
|
String title = (String) map.get("title");
|
||||||
String href = "<a href='/docManage/library/detail?id=" + id +
|
String href = "<a href='/docManage/library/detail?id=" + id +
|
||||||
"&title=" + title +
|
"&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 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 "+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);
|
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||||
sendWebsocket((String) map.get("id"), contentInfo);
|
sendWebsocket((String) map.get("id"), contentInfo);
|
||||||
}
|
}
|
||||||
//订阅文档的飞书消息
|
//订阅文档的飞书消息
|
||||||
try {
|
// try {
|
||||||
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
// String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||||
category + " " + serialNumber+" has been updated.";
|
// category + " " + serialNumber+" has been updated.";
|
||||||
//跳转文档详情
|
// //跳转文档详情
|
||||||
String url = backUrl + "/docManage/library/detail?id=" + id;
|
// String url = backUrl + "/docManage/library/detail?id=" + id;
|
||||||
iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
// iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
||||||
} catch (IOException e) {
|
// } catch (IOException e) {
|
||||||
log.error("文档新增飞书消息推送失败");
|
// log.error("文档新增飞书消息推送失败");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
//2. 处理修改代替标准的发送消息(法规负责人)
|
//2. 处理修改代替标准的发送消息(法规负责人)
|
||||||
|
|||||||
Reference in New Issue
Block a user