待办去重

This commit is contained in:
苏竹红
2024-05-26 16:27:07 +08:00
parent c085c50623
commit f1d813efa7
2 changed files with 7 additions and 6 deletions

View File

@@ -5,9 +5,8 @@ import com.cool.store.enums.AuditStatusEnum;
import com.cool.store.enums.NodeNoEnum;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import javax.persistence.*;
@Data
@@ -120,7 +119,9 @@ public class PointAuditRecordDO {
public static List<PointTodoInfoDO> convertTODO(PointAuditRecordDO nextAuditRecord){
List<PointTodoInfoDO> resultList = new ArrayList<>();
List<String> handlerUserIds = JSONObject.parseArray(nextAuditRecord.getHandlerUserIds(), String.class);
for (String userId : handlerUserIds) {
//去重
List<String> finalHandlerUserIds = new ArrayList<>(new HashSet<>(handlerUserIds));
for (String userId : finalHandlerUserIds) {
PointTodoInfoDO todo = new PointTodoInfoDO();
todo.setPointId(nextAuditRecord.getPointId());
todo.setNodeNo(nextAuditRecord.getNodeNo());

View File

@@ -1108,7 +1108,7 @@ public class PointServiceImpl implements PointService {
* @return
*/
private List<String> getUserIdsByPositionIds(Pair<List<String>, List<String>> userIdsAndPositionIds, Map<String, List<String>> userIdsMap) {
List<String> userIds = new ArrayList<>();
Set<String> userIds = new HashSet<>();
if(CollectionUtils.isNotEmpty(userIdsAndPositionIds.getKey())){
userIds.addAll(userIdsAndPositionIds.getKey());
}
@@ -1120,7 +1120,7 @@ public class PointServiceImpl implements PointService {
}
});
}
return userIds;
return new ArrayList<>(userIds);
}
private PointAuditRecordDO getNextAuditRecord(Integer currentNodeNo, Map<Integer, PointAuditRecordDO> auditRecordMap){