|
@@ -113,7 +113,10 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
throw new BizException("考级结果已确认");
|
|
|
}
|
|
|
Date now=new Date();
|
|
|
- if(now.compareTo(examRoom.getExamStartTime())>0||DateUtil.isSameDay(now, examRoom.getExamStartTime())){
|
|
|
+ if(DateUtil.isSameDay(now, examRoom.getExamStartTime())){
|
|
|
+ throw new BizException("考试当天不可添加学员");
|
|
|
+ }
|
|
|
+ if(now.compareTo(examRoom.getExamStartTime())>0){
|
|
|
throw new BizException("无法添加学员");
|
|
|
}
|
|
|
|
|
@@ -252,6 +255,31 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public void autoSplitStudentToRoom(Long examId, Integer selfOrganId) {
|
|
|
+ ExaminationBasic examinationBasic = examinationBasicDao.get(examId);
|
|
|
+ if(Objects.isNull(examinationBasic)){
|
|
|
+ throw new BizException("考级项目不存在");
|
|
|
+ }
|
|
|
+ int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId);
|
|
|
+ if(sendExamPlanRooms>0){
|
|
|
+ throw new BizException("已发送考试安排,请手动处理未排考学员");
|
|
|
+ }
|
|
|
+ //未排考学员
|
|
|
+ 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
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void changeStudentExamRoom(Long registId, Long examRoomId, Integer organId) {
|
|
|
if(Objects.isNull(registId)){
|
|
@@ -424,7 +452,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
HashMap<Integer, String> map = new HashMap<>();
|
|
|
map.put(studentListDto.getStudentId(),studentListDto.getStudentId().toString());
|
|
|
String url = "3?examRegistrationId=" + studentListDto.getExamRegistrationId();
|
|
|
- sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_WILL_START_PUSH,map,null,null,url, JiguangPushPlugin.PLUGIN_NAME,actionExamPush);
|
|
|
+ sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_WILL_START_PUSH,map,null,0,url, JiguangPushPlugin.PLUGIN_NAME,actionExamPush);
|
|
|
}
|
|
|
}
|
|
|
//将当前学员退踢出教室
|
|
@@ -578,7 +606,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
HashMap<Integer, String> map = new HashMap<>();
|
|
|
map.put(studentListDto.getStudentId(),studentListDto.getStudentId().toString());
|
|
|
String url = "3?examRegistrationId=" + studentListDto.getExamRegistrationId();
|
|
|
- sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_WILL_START_PUSH,map,null,null,url, JiguangPushPlugin.PLUGIN_NAME,actionExamPush);
|
|
|
+ sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_WILL_START_PUSH,map,null,0,url, JiguangPushPlugin.PLUGIN_NAME,actionExamPush);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -597,7 +625,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
HashMap<Integer, String> map = new HashMap<>(1);
|
|
|
map.put(examRoomStudentRelation.getStudentId(),examRoomStudentRelation.getStudentId().toString());
|
|
|
ExaminationBasic examinationBasic = examinationBasicDao.get(examRoomStudentRelation.getExaminationBasicId());
|
|
|
- sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_ROOM_STUDENT_SIGN_IN_AGAIN_PUSH,map,null,null,null,JiguangPushPlugin.PLUGIN_NAME,examinationBasic.getName());
|
|
|
+ sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_ROOM_STUDENT_SIGN_IN_AGAIN_PUSH,map,null,0,null,JiguangPushPlugin.PLUGIN_NAME,examinationBasic.getName());
|
|
|
}else {
|
|
|
imFeignService.kickRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId(),examRoomStudentRelation.getStudentId().toString()));
|
|
|
//结束考试
|
|
@@ -616,8 +644,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
HashMap<Integer, String> map = new HashMap<>(1);
|
|
|
map.put(examRoomStudentRelation.getStudentId(),examRoomStudentRelation.getStudentId().toString());
|
|
|
- String url = "3?examRegistrationId=" + nextExamRoomStudentRelationId;
|
|
|
- sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_STARTED_PUSH,map,null,null,url,JiguangPushPlugin.PLUGIN_NAME);
|
|
|
+ String url = "3?examRegistrationId=" + examRoomStudentRelation.getExamRegistrationId();
|
|
|
+ sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_STARTED_PUSH,map,null,0,url,JiguangPushPlugin.PLUGIN_NAME);
|
|
|
|
|
|
//状态变更为呼叫中
|
|
|
studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),1);
|