fix[project]: 同步待办时,根据待办名称去重(待办号不同时,名称存在相同的情况)

This commit is contained in:
2026-03-22 14:58:38 +08:00
parent b2179aa5d3
commit 579134ad28

View File

@@ -2412,9 +2412,9 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
// 根据todoId去重保留首次出现的待办
todoInfoList = todoInfoList.stream()
// 过滤掉todoId为null的数据
.filter(dm -> dm.getTodoId() != null)
.filter(dm -> dm.getSubject() != null)
.collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(LyricVTodoEmulationInfoDM::getTodoId))),
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(LyricVTodoEmulationInfoDM::getSubject))),
ArrayList::new
));
@@ -2425,14 +2425,14 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
}
// 过滤已同步的待办
Set<String> existDemandCodeSet = demandMapper.getAllCodeList();
if (CollectionUtils.isEmpty(existDemandCodeSet)) {
Set<String> existDemandNameSet = demandMapper.getAllCodeList();
if (CollectionUtils.isEmpty(existDemandNameSet)) {
return todoInfoList;
}
List<LyricVTodoEmulationInfoDM> filterTodoList = todoInfoList.stream()
.filter(todoInfo -> !existDemandCodeSet.contains(String.valueOf(todoInfo.getTodoId())))
.filter(todoInfo -> !existDemandNameSet.contains(String.valueOf(todoInfo.getSubject())))
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(filterTodoList)) {