refactor(项目管理): 获取项目消息通知人列表去重

This commit is contained in:
guoyuqi 2024-02-06 11:11:37 +08:00 committed by Craftsman
parent 104d472d82
commit 01bdeaf03b
1 changed files with 5 additions and 2 deletions

View File

@ -470,16 +470,19 @@ public class NoticeMessageTaskService {
public List<OptionDTO> getUserList(String projectId, String keyword) {
List<OptionDTO> projectUserSelectList = extProjectUserRoleMapper.getProjectUserSelectList(projectId, keyword);
ArrayList<OptionDTO> collect = projectUserSelectList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OptionDTO::getId))), ArrayList::new));
Map<String, String> 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);