From ffa1ebc9f790812ac869e61493d3ef6820c81a6e Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Tue, 20 Sep 2022 10:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=E9=9C=80=E6=B1=82?= =?UTF-8?q?=EF=BC=9A=E9=80=9A=E7=9F=A5=E6=B6=88=E6=81=AF=E4=BD=93=E7=8E=B0?= =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/aspect/ActivitiNoticeAspect.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java index 97d6b10c..3a81594d 100644 --- a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java +++ b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java @@ -135,6 +135,10 @@ public class ActivitiNoticeAspect { } else if (kv.containsKey("_id")) { key = kv.getOrDefault("_id", "").toString(); } + final StringBuilder resourceName = new StringBuilder(); + if (kv.containsKey("resourceDTO")) { + resourceName.append(((Map) kv.get("resourceDTO")).get("name")); + } final String workKey = TaskListener.EVENTNAME_COMPLETE + key; if (work.contains(workKey)) { LOGGER.error("------------出现重放------------"); @@ -174,7 +178,7 @@ public class ActivitiNoticeAspect { String finalResult = result; CompletableFuture.runAsync(() -> { // 发起人 SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); - String content = "【通知】" + userDTO.getRealName() + ",您发起的" + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult; + String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult; SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); dto.setTitle("流程节点系统通知"); @@ -220,6 +224,10 @@ public class ActivitiNoticeAspect { } else if (kv.containsKey("_id")) { key = kv.getOrDefault("_id", "").toString(); } + final StringBuilder resourceName = new StringBuilder(); + if (kv.containsKey("resourceDTO")) { + resourceName.append(((Map) kv.get("resourceDTO")).get("name")); + } final String workKey = ExecutionListener.EVENTNAME_END + key; if (work.contains(workKey)) { LOGGER.error("------------出现重放------------"); @@ -259,7 +267,7 @@ public class ActivitiNoticeAspect { String finalResult = result; CompletableFuture.runAsync(() -> { // 发起人 SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); - String content = "【通知】" + userDTO.getRealName() + ",您发起的" + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; + String content = "【通知】" + userDTO.getRealName() + ",您发起的"+resourceName + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); dto.setTitle("流程结束系统通知"); @@ -334,6 +342,10 @@ public class ActivitiNoticeAspect { } else if (kv.containsKey("_id")) { key = kv.getOrDefault("_id", "").toString(); } + final StringBuilder resourceName = new StringBuilder(); + if (kv.containsKey("resourceDTO")) { + resourceName.append(((Map) kv.get("resourceDTO")).get("name")); + } final String workKey = TaskListener.EVENTNAME_ASSIGNMENT + key; if (work.contains(workKey)) { LOGGER.error("------------出现重放------------"); @@ -357,7 +369,7 @@ public class ActivitiNoticeAspect { try { SysUserDTO assignee = sysUserService.get(Long.valueOf(delegateTask.getAssignee())); LOGGER.error("审核人:{}", assignee.getId()); - String content = "【通知】您发起的流程 " + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\""; + String content = "【通知】您发起的流程 " +resourceName+ activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\""; LOGGER.info("通知内容:{}", content); SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); @@ -378,7 +390,7 @@ public class ActivitiNoticeAspect { }, EXECUTOR).thenRunAsync(() -> { // 审批者 try { SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator)); - String content = "【通知】" + owner.getRealName() + "发起的流程" + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您"; + String content = "【通知】" + owner.getRealName() + "发起的流程"+resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您"; SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); dto.setTitle("流程流转系统通知");