From 01bdeaf03b0ebab99a196b512340568a36663930 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 6 Feb 2024 11:11:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=E9=A1=B9=E7=9B=AE=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=BA=BA=E5=88=97=E8=A1=A8=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/service/NoticeMessageTaskService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 a98255052b..ba5f3c45a5 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 @@ -470,16 +470,19 @@ public class NoticeMessageTaskService { public List getUserList(String projectId, String keyword) { List projectUserSelectList = extProjectUserRoleMapper.getProjectUserSelectList(projectId, keyword); + ArrayList collect = projectUserSelectList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OptionDTO::getId))), ArrayList::new)); Map defaultRelatedUserMap = MessageTemplateUtils.getDefaultRelatedUserMap(); defaultRelatedUserMap.forEach((k, v) -> { OptionDTO optionDTO = new OptionDTO(); optionDTO.setId(k); optionDTO.setName(v); - projectUserSelectList.add(optionDTO); + collect.add(optionDTO); }); - return projectUserSelectList; + return collect; } + + public MessageTemplateConfigDTO getTemplateDetail(String projectId, String taskType, String event, String robotId) { MessageTaskExample messageTaskExample = new MessageTaskExample(); messageTaskExample.createCriteria().andProjectIdEqualTo(projectId).andTaskTypeEqualTo(taskType).andEventEqualTo(event);