|
@@ -255,16 +255,28 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void autoSplitStudentToRoom(Long examRoomId, Integer selfOrganId) {
|
|
|
- ExaminationBasic examinationBasic = examinationBasicDao.get(examRoomId);
|
|
|
+ public void autoSplitStudentToRoom(Long examId, Integer selfOrganId) {
|
|
|
+ ExaminationBasic examinationBasic = examinationBasicDao.get(examId);
|
|
|
if(Objects.isNull(examinationBasic)){
|
|
|
throw new BizException("考级项目不存在");
|
|
|
}
|
|
|
- int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examRoomId);
|
|
|
+ int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId);
|
|
|
if(sendExamPlanRooms>0){
|
|
|
throw new BizException("已发送考试安排,请手动处理未排考学员");
|
|
|
}
|
|
|
-// examRegistrationDao.getStuRecordDetail()
|
|
|
+ //未排考学员
|
|
|
+ List<ExamRegistration> notInRoomStudents = examRegistrationDao.getNotInRoomStudents(examId);
|
|
|
+ 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<ExamRoomStudentRelation> examRoomStudents = examRoomStudentRelationDao.getWithExamAndRoomSubjects(examId, new ArrayList<>(subjectIds));
|
|
|
+ Map<Long, List<ExamRoomStudentRelation>> roomStudentsMap = examRoomStudents.stream().collect(Collectors.groupingBy(ExamRoomStudentRelation::getExamRoomId));
|
|
|
+ Set<Long> roomIds = roomStudentsMap.keySet();
|
|
|
+ //考场数量
|
|
|
+ Integer roomNum = roomIds.size();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|