From bc045fb26aaded9ee90795e4efa5658cef8bdeb4 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 25 Jun 2024 13:21:46 +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=E6=B6=88=E6=81=AF=E6=A8=A1=E6=9D=BF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=85=B6=E4=BD=99=E6=A8=A1=E7=89=88=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1043072 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001043072 --- .../metersphere/project/service/NoticeMessageTaskService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeMessageTaskService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeMessageTaskService.java index 735103c21a..ae5ae5a066 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeMessageTaskService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeMessageTaskService.java @@ -167,11 +167,13 @@ public class NoticeMessageTaskService { MessageTaskBlobExample messageTaskBlobExample = new MessageTaskBlobExample(); messageTaskBlobExample.createCriteria().andIdIn(messageTaskIds); List messageTaskBlobs = messageTaskBlobMapper.selectByExample(messageTaskBlobExample); + ListmessageTaskEqualsRobotIDs = new ArrayList<>(); for (MessageTask messageTask : messageTasks) { messageTask.setUpdateTime(System.currentTimeMillis()); messageTask.setUpdateUser(userId); //如果有机器人id,则是修改机器人开关和消息配置 if (StringUtils.isNotBlank(messageTaskRequest.getRobotId()) && StringUtils.equalsIgnoreCase(messageTask.getProjectRobotId(), messageTaskRequest.getRobotId())) { + messageTaskEqualsRobotIDs.add(messageTask.getId()); messageTask.setEnable(enable); messageTask.setUseDefaultSubject(useDefaultSubject); messageTask.setUseDefaultTemplate(useDefaultTemplate); @@ -183,7 +185,7 @@ public class NoticeMessageTaskService { mapper.updateByPrimaryKeySelective(messageTask); } for (MessageTaskBlob messageTaskBlob : messageTaskBlobs) { - if (StringUtils.isNotBlank(messageTaskRequest.getRobotId()) && !useDefaultTemplate) { + if (StringUtils.isNotBlank(messageTaskRequest.getRobotId()) && !useDefaultTemplate && messageTaskEqualsRobotIDs.contains(messageTaskBlob.getId())) { messageTaskBlob.setTemplate(messageTaskRequest.getTemplate()); blobMapper.updateByPrimaryKeyWithBLOBs(messageTaskBlob); }