From 9fb041e437af5949a984e5b7a0b1ccada3555d96 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 17 Apr 2024 17:59:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=AD=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=8B=BF=E5=88=B0=E6=93=8D=E4=BD=9C=E4=BA=BA=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1039626 --user=王孝刚 【项目管理】消息管理-设置开启和关闭定时任务通知,收到的通知没有获取到操作人信息 https://www.tapd.cn/55049933/s/1500068 --- .../system/schedule/ApiScheduleNoticeService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/schedule/ApiScheduleNoticeService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/schedule/ApiScheduleNoticeService.java index 393ecc6ec8..a9d0f0a44e 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/schedule/ApiScheduleNoticeService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/schedule/ApiScheduleNoticeService.java @@ -4,6 +4,7 @@ import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.SubListUtils; import io.metersphere.system.domain.Schedule; import io.metersphere.system.domain.User; +import io.metersphere.system.mapper.UserMapper; import io.metersphere.system.notice.NoticeModel; import io.metersphere.system.notice.constants.NoticeConstants; import io.metersphere.system.notice.utils.MessageTemplateUtils; @@ -26,6 +27,8 @@ public class ApiScheduleNoticeService { private NoticeSendService noticeSendService; @Resource private CommonNoticeSendService commonNoticeSendService; + @Resource + private UserMapper userMapper; public void sendScheduleNotice(Schedule schedule, String userId) { if (ObjectUtils.isNotEmpty(schedule)) { @@ -36,6 +39,8 @@ public class ApiScheduleNoticeService { } BeanMap beanMap = new BeanMap(schedule); Map paramMap = new HashMap<>(beanMap); + User user = userMapper.selectByPrimaryKey(userId); + paramMap.put(NoticeConstants.RelatedUser.OPERATOR, user != null ? user.getName() : ""); String template = defaultTemplateMap.get(NoticeConstants.TaskType.SCHEDULE_TASK + "_" + event); Map defaultSubjectMap = MessageTemplateUtils.getDefaultTemplateSubjectMap(); String subject = defaultSubjectMap.get(NoticeConstants.TaskType.SCHEDULE_TASK + "_" + event);