|
@@ -250,19 +250,22 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
if(Objects.isNull(examinationBasic)){
|
|
|
throw new BizException("考级项目不存在");
|
|
|
}
|
|
|
- int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId);
|
|
|
+
|
|
|
+ List<Integer> childOrganIds = organizationService.getChildOrganIds(selfOrganId, true);
|
|
|
+
|
|
|
+ int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId, childOrganIds);
|
|
|
if(sendExamPlanRooms>0){
|
|
|
throw new BizException("已发送考试安排,请手动处理未排考学员");
|
|
|
}
|
|
|
//未排考学员
|
|
|
- List<ExamRegistration> notInRoomStudents = examRegistrationDao.getNotInRoomStudents(examId);
|
|
|
+ List<ExamRegistration> notInRoomStudents = examRegistrationDao.getNotInRoomStudents(examId, childOrganIds);
|
|
|
if(CollectionUtils.isEmpty(notInRoomStudents)){
|
|
|
throw new BizException("所有学员都已安排考场");
|
|
|
}
|
|
|
Map<Integer, List<ExamRegistration>> subjectRegistMap = notInRoomStudents.stream().collect(Collectors.groupingBy(ExamRegistration::getSubjectId));
|
|
|
Set<Integer> subjectIds = subjectRegistMap.keySet();
|
|
|
//未排考学员可排考考场
|
|
|
- List<ExamRoom> examRooms = examRoomDao.getWithExamAndSubjects(examId, new ArrayList<>(subjectIds));
|
|
|
+ List<ExamRoom> examRooms = examRoomDao.getWithExamAndSubjects(examId, new ArrayList<>(subjectIds), childOrganIds);
|
|
|
if(CollectionUtils.isEmpty(examRooms)){
|
|
|
throw new BizException("请先建立考场");
|
|
|
}
|