|
@@ -911,11 +911,17 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
examRoomDao.batchUpdate(examRooms);
|
|
|
}
|
|
|
|
|
|
- List<Long> registIds = examRoomStudentRelationDao.findNoFinishedExamRegistIdsWIthExamRooms();
|
|
|
- if(!CollectionUtils.isEmpty(registIds)){
|
|
|
- examRoomStudentRelationDao.deleteStudentRoomRegistRelations(registIds);
|
|
|
- examCertificationDao.deleteWithRegist(registIds);
|
|
|
- studentExamResultDao.deleteWithRegists(registIds);
|
|
|
+ List<ExamRoomStudentRelation> students = examRoomStudentRelationDao.findNoFinishedExamRegistsWIthExamRooms();
|
|
|
+ if(CollectionUtils.isEmpty(students)){
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+ Set<Long> registIds = students.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toSet());
|
|
|
+ examRoomStudentRelationDao.deleteStudentRoomRegistRelations(new ArrayList<>(registIds));
|
|
|
+ examCertificationDao.deleteWithRegist(new ArrayList<>(registIds));
|
|
|
+ studentExamResultDao.deleteWithRegists(new ArrayList<>(registIds));
|
|
|
+
|
|
|
+ Set<Long> examIds = students.stream().map(ExamRoomStudentRelation::getExaminationBasicId).collect(Collectors.toSet());
|
|
|
+ examRoomDao.updateExamRoomStudentNumWithExams(new ArrayList<>(examIds));
|
|
|
}
|
|
|
}
|