Commit 8f95c000 by zhiwj

修改代码结构

parent 1ffa3555
......@@ -79,7 +79,7 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
return Collections.emptyMap();
}
// 获取 受审组 -> 审核员 的map
Map<Integer, Set<Integer>> groupAuditorMap = getAuditedGroupBelongAuditor(relList);
Map<Integer, Set<Integer>> groupAuditorMap = relList.stream().collect(Collectors.groupingBy(TabAuditorAuditedGroupRel::getAuditedGroupId, Collectors.mapping(TabAuditorAuditedGroupRel::getAuditorId, Collectors.toSet())));
Map<Integer, Set<Integer>> tmpMap = new HashMap<>();
for (TabAuditedGroupUserRel userRel : userList) {
Integer auditedGroupId = userRel.getAuditedGroupId();
......@@ -101,16 +101,4 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
public List<Integer> listRelByAuditedGroupIdAndAuditId(Integer enterpriseId, List<Integer> auditedGroupIds, List<Integer> projectAuditorIds) {
return tabAuditorAuditedGroupRelMapper.listRelByAuditedGroupIdAndAuditId(enterpriseId, auditedGroupIds, projectAuditorIds);
}
private Map<Integer, Set<Integer>> getAuditedGroupBelongAuditor(List<TabAuditorAuditedGroupRel> relList) {
Map<Integer, Set<Integer>> groupAuditorMap = new HashMap<>();
for (TabAuditorAuditedGroupRel tabAuditorAuditedGroupRel : relList) {
// Set<Integer> set = tmpMap.computeIfAbsent(auditorId, k -> new HashSet<>());
// groupAuditorMap.computeIfAbsent(tabAuditorAuditedGroupRel.getAuditedGroupId(), tabAuditorAuditedGroupRel.getAuditorId());
Set<Integer> set = groupAuditorMap.computeIfAbsent(tabAuditorAuditedGroupRel.getAuditedGroupId(), k -> new HashSet<>());
set.add(tabAuditorAuditedGroupRel.getAuditorId());
}
return groupAuditorMap;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment