|
@@ -28,6 +28,7 @@ import com.keao.edu.user.api.enums.ExamModeEnum;
|
|
|
import com.keao.edu.user.dao.*;
|
|
|
import com.keao.edu.user.dto.*;
|
|
|
import com.keao.edu.user.entity.*;
|
|
|
+import com.keao.edu.user.enums.ExamStatusEnum;
|
|
|
import com.keao.edu.user.page.ExamRoomListQueryInfo;
|
|
|
import com.keao.edu.user.page.ExamRoomQueryInfo;
|
|
|
import com.keao.edu.user.service.*;
|
|
@@ -172,7 +173,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
throw new BizException("线下考试请指定考试地址");
|
|
|
}
|
|
|
if(StringUtils.isBlank(examRoom.getSubjectIdList())){
|
|
|
- throw new BizException("请指定考试专业");
|
|
|
+ examRoom.setSubjectIdList("0");
|
|
|
}
|
|
|
if(Objects.isNull(examRoom.getMainTeacherUserId())){
|
|
|
throw new BizException("请指定主考老师");
|
|
@@ -430,6 +431,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
throw new BizException("考级项目不存在");
|
|
|
}
|
|
|
|
|
|
+ if(exam.getStatus().getOrder()< ExamStatusEnum.APPLIED.getOrder()){
|
|
|
+ throw new BizException("请等待报名结束");
|
|
|
+ }
|
|
|
+
|
|
|
ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(exam.getId(), organId);
|
|
|
if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
|
|
|
throw new BizException("无权操作");
|
|
@@ -896,15 +901,28 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void cleanExamRoom() {
|
|
|
List<ExamRoom> examRooms = examRoomDao.getHistoryOpenExamRoom();
|
|
|
- if(CollectionUtils.isEmpty(examRooms)){
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
for (ExamRoom examRoom : examRooms) {
|
|
|
examRoom.setOpenFlag(0);
|
|
|
-// imFeignService.dismissGroup(examRoom.getMainTeacherUserId().toString(),examRoom.getId().toString());
|
|
|
imFeignService.destroyRoom(examRoom.getId(),examRoom.getMainTeacherUserId().toString());
|
|
|
studentExamResultService.calculateStudentExamAvgScore(examRoom.getId());
|
|
|
}
|
|
|
- examRoomDao.batchUpdate(examRooms);
|
|
|
+ if(!CollectionUtils.isEmpty(examRooms)){
|
|
|
+ examRoomDao.batchUpdate(examRooms);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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));
|
|
|
+ examReviewDao.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));
|
|
|
}
|
|
|
}
|