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);