|
@@ -272,14 +272,12 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
|
|
|
|
|
List<ExamDepartTotalDTO> allList = new ArrayList<>();
|
|
|
List<ExamDepartTotalDTO> examList = baseMapper.examDepartTotal(reqDTO);
|
|
|
- List<ExamDepartTotalDTO> examList2 = baseMapper.examDepartTotal2(reqDTO);
|
|
|
List<ExamDepartTotalDTO> userList = baseMapper.selectUserTotal(reqDTO);
|
|
|
List<String> exams = examList.stream().map(ExamDepartTotalDTO::getDeptCode).collect(Collectors.toList());
|
|
|
List<String> users = userList.stream().map(ExamDepartTotalDTO::getDeptCode).collect(Collectors.toList());
|
|
|
ExamDepartTotalDTO totalDTO = null;
|
|
|
Map<String, List<ExamDepartTotalDTO>> groupexam = examList.stream().collect(Collectors.groupingBy(ExamDepartTotalDTO::getDeptCode));
|
|
|
Map<String, List<ExamDepartTotalDTO>> groupuser = userList.stream().collect(Collectors.groupingBy(ExamDepartTotalDTO::getDeptCode));
|
|
|
- Map<String, List<ExamDepartTotalDTO>> groupexam2 = examList2.stream().collect(Collectors.groupingBy(ExamDepartTotalDTO::getDeptCode));
|
|
|
|
|
|
// 差集 (list1 - list2)
|
|
|
List<String> reduce = exams.stream().filter(item -> !users.contains(item)).collect(Collectors.toList());
|
|
@@ -292,7 +290,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
|
|
totalDTO.setDeptCode(groupexam.get(key).get(0).getDeptCode());
|
|
|
totalDTO.setDeptName(groupexam.get(key).get(0).getDeptName());
|
|
|
totalDTO.setEeActualUser(groupexam.get(key).get(0).getEeActualUser()+groupuser.get(key).get(0).getEeActualUser());
|
|
|
- totalDTO.setEePassUser(null == groupexam2.get(key) ? 0 : groupexam2.get(key).get(0).getEePassUser()+groupuser.get(key).get(0).getEePassUser());
|
|
|
+ totalDTO.setEePassUser(groupexam.get(key).get(0).getEePassUser()+groupuser.get(key).get(0).getEePassUser());
|
|
|
totalDTO.setEeTotalUser(groupexam.get(key).get(0).getEeTotalUser()+groupuser.get(key).get(0).getEeTotalUser());
|
|
|
allList.add(totalDTO);
|
|
|
}
|
|
@@ -301,14 +299,13 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
|
|
|
|
|
List<ExamDepartTotalDTO> groupexams = groupexam.get(key)== null ? null : groupexam.get(key);
|
|
|
List<ExamDepartTotalDTO> groupusers = groupuser.get(key) == null ? null : groupuser.get(key);
|
|
|
- List<ExamDepartTotalDTO> groupexams2 = groupexam2.get(key)== null ? null : groupexam.get(key);
|
|
|
|
|
|
totalDTO = new ExamDepartTotalDTO();
|
|
|
totalDTO.setDeptCode(null != groupexams ? groupexams.get(0).getDeptCode() : groupusers.get(0).getDeptCode());
|
|
|
totalDTO.setDeptName(null != groupexams ? groupexams.get(0).getDeptName() : groupusers.get(0).getDeptName());
|
|
|
if (null != groupexams && groupexams.size() == 1){
|
|
|
totalDTO.setEeActualUser(groupexams.get(0).getEeActualUser());
|
|
|
- totalDTO.setEePassUser(null == groupexams2 ? 0: groupexams2.get(0).getEePassUser());
|
|
|
+ totalDTO.setEePassUser(groupexams.get(0).getEePassUser());
|
|
|
totalDTO.setEeTotalUser(groupexams.get(0).getEeTotalUser());
|
|
|
allList.add(totalDTO);
|
|
|
}
|
|
@@ -321,19 +318,6 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-//
|
|
|
-//
|
|
|
-// for (String key : intersection){
|
|
|
-// totalDTO = new ExamDepartTotalDTO();
|
|
|
-// totalDTO.setDeptCode(groupexam.get(key).get(0).getDeptCode());
|
|
|
-// totalDTO.setDeptName(groupexam.get(key).get(0).getDeptName());
|
|
|
-// totalDTO.setEeActualUser(groupexam.get(key).get(0).getEeActualUser()+groupuser.get(key).get(0).getEeActualUser());
|
|
|
-// totalDTO.setEePassUser(groupexam.get(key).get(0).getEePassUser()+groupuser.get(key).get(0).getEePassUser());
|
|
|
-// totalDTO.setEeTotalUser(groupexam.get(key).get(0).getEeTotalUser()+groupuser.get(key).get(0).getEeTotalUser());
|
|
|
-// examList.add(totalDTO);
|
|
|
-// }
|
|
|
return allList;
|
|
|
}
|
|
|
|