|
@@ -433,8 +433,14 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
// 同一任务是否有多个校区
|
|
|
Map<String, List<Map<String, Object>>> stringListMap = examDetailKeyList.stream().collect(Collectors.groupingBy(m -> m.get("schoolId") + "#" + m.get("printPlanId") + "#" + m.get("printPlanName") + "#" + m.get("examPlace") + "#" + m.get("examRoom") + "#" + m.get("examStartTime") + "#" + m.get("examEndTime")));
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> entry : stringListMap.entrySet()) {
|
|
|
- if(entry.getValue().size() > 1){
|
|
|
- throw ExceptionResultEnum.ERROR.exception("同一考场数据只能指派一个印刷室");
|
|
|
+ Set<Long> printHouseIds = new HashSet<>();
|
|
|
+ for (Map<String, Object> objectMap : entry.getValue()) {
|
|
|
+ Long schoolId = Long.valueOf(String.valueOf(objectMap.get("schoolId")));
|
|
|
+ String campusName = String.valueOf(objectMap.get("campusName"));
|
|
|
+ printHouseIds.add(basicCampusService.getPrintHouseIdBySchoolIdAndCampusName(schoolId, campusName));
|
|
|
+ }
|
|
|
+ if(printHouseIds.size() > 1){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("同一考场对应校区指派的印刷室只能为一个");
|
|
|
}
|
|
|
}
|
|
|
|