Commit 8bd7ece9 by zhiwj

修改审核员的管理员数量

parent 12178ad4
......@@ -79,13 +79,15 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
return Collections.emptyMap();
}
// 获取 受审组 -> 审核员 的map
Map<Integer, Integer> groupAuditorMap = getAuditedGroupBelongAuditor(relList);
Map<Integer, Set<Integer>> groupAuditorMap = getAuditedGroupBelongAuditor(relList);
Map<Integer, Set<Integer>> tmpMap = new HashMap<>();
for (TabAuditedGroupUserRel userRel : userList) {
Integer auditedGroupId = userRel.getAuditedGroupId();
Integer auditorId = groupAuditorMap.get(auditedGroupId);
Set<Integer> set = tmpMap.computeIfAbsent(auditorId, k -> new HashSet<>());
set.add(userRel.getUserId());
Set<Integer> auditorIdSet = groupAuditorMap.get(auditedGroupId);
for (Integer auditorId : auditorIdSet) {
Set<Integer> set = tmpMap.computeIfAbsent(auditorId, k -> new HashSet<>());
set.add(userRel.getUserId());
}
}
Map<Integer, Integer> resultMap = new HashMap<>();
for (Map.Entry<Integer, Set<Integer>> entry : tmpMap.entrySet()) {
......@@ -100,10 +102,13 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
return tabAuditorAuditedGroupRelMapper.listRelByAuditedGroupIdAndAuditId(enterpriseId, auditedGroupIds, projectAuditorIds);
}
private Map<Integer, Integer> getAuditedGroupBelongAuditor(List<TabAuditorAuditedGroupRel> relList) {
Map<Integer, Integer> groupAuditorMap = new HashMap<>();
private Map<Integer, Set<Integer>> getAuditedGroupBelongAuditor(List<TabAuditorAuditedGroupRel> relList) {
Map<Integer, Set<Integer>> groupAuditorMap = new HashMap<>();
for (TabAuditorAuditedGroupRel tabAuditorAuditedGroupRel : relList) {
groupAuditorMap.put(tabAuditorAuditedGroupRel.getAuditedGroupId(), tabAuditorAuditedGroupRel.getAuditorId());
// 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