|
@@ -266,6 +266,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public ExamRoom updateExamRoom(ExamRoom examRoom) {
|
|
|
if(Objects.isNull(examRoom.getId())){
|
|
|
throw new BizException("请指定考场");
|
|
@@ -363,8 +364,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
throw new BizException("考试地址不存在");
|
|
|
}
|
|
|
List<ExamRoomStudentRelation> examRoomStudents = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoom.getId());
|
|
|
- List<Long> registIds = examRoomStudents.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toList());
|
|
|
- examCertificationDao.updateExamAddress(examLocation.getAddress(), registIds);
|
|
|
+ if(!CollectionUtils.isEmpty(examRoomStudents)){
|
|
|
+ List<Long> registIds = examRoomStudents.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toList());
|
|
|
+ examCertificationDao.updateExamAddress(examLocation.getAddress(), registIds);
|
|
|
+ }
|
|
|
}
|
|
|
return examRoom;
|
|
|
}
|