|
@@ -293,17 +293,33 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId) {
|
|
|
- if(examRoomStudentRelationId != null){
|
|
|
- ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
+ public void recorded(Long roomId) {
|
|
|
+ List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
|
|
|
+ if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
|
|
|
+ RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
|
|
|
+ if(roomStudentListDto.getFinishedExam() != 0){
|
|
|
+ throw new BizException("操作失败:当前学员状态不支持录播");
|
|
|
+ }
|
|
|
+ ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(roomStudentListDto.getExamRoomStudentRelationId());
|
|
|
+
|
|
|
+ //修改学员考试状态
|
|
|
+ StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
|
|
|
+ studentExamResult.setRecordFlag(1);
|
|
|
+ studentExamResult.setIsFinishedExam(4);
|
|
|
+ studentExamResultDao.update(studentExamResult);
|
|
|
+ //关闭学员房间入口
|
|
|
examRoomStudentRelation.setClassroomSwitch(0);
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
- StudentExamResult byRegistrationId = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
|
|
|
- byRegistrationId.setRecordFlag(1);
|
|
|
- studentExamResultDao.update(byRegistrationId);
|
|
|
publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true);
|
|
|
+ if(roomStudentListDtos.size() > 1){
|
|
|
+ RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
|
|
|
+ if(roomStudentListDto1.getFinishedExam() == 2){
|
|
|
+ nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //将当前学员退出教室
|
|
|
+ imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
}
|
|
|
- nextStudent(nextExamRoomStudentRelationId,false);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -388,23 +404,22 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void stuEndRecord(Long examRegistrationId, String videoUrl) {
|
|
|
StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
|
|
|
- //当前学员是否完成考试
|
|
|
if(studentExamResult.getIsFinishedExam() == 1){
|
|
|
throw new BizException("提交失败:您的考试已完成");
|
|
|
}
|
|
|
- //是否允许录播
|
|
|
- if(studentExamResult.getRecordFlag() == 0){
|
|
|
- throw new BizException("提交失败:当前考试不允许录播");
|
|
|
+ //当前学员是否完成考试
|
|
|
+ if(studentExamResult.getIsFinishedExam() != 4){
|
|
|
+ throw new BizException("提交失败:当前考试状态不允许录播");
|
|
|
}
|
|
|
studentExamResult.setVideoUrl(videoUrl);
|
|
|
- studentExamResult.setIsFinishedExam(1);
|
|
|
+ studentExamResult.setIsFinishedExam(5);
|
|
|
studentExamResultDao.update(studentExamResult);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void actionExam(Long examRoomStudentRelationId) {
|
|
|
- ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
+ /*ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
examRoomStudentRelation.setClassroomSwitch(1);
|
|
|
|
|
|
ExamRoom examRoom = examRoomDao.get(examRoomStudentRelation.getExamRoomId());
|
|
@@ -414,38 +429,47 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
examRoom.setExamFlag(1);
|
|
|
examRoomDao.update(examRoom);
|
|
|
- publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);*/
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
|
|
|
- Boolean isPush = true;
|
|
|
- if(currentExamRoomStudentRelationId != null){
|
|
|
- ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
|
|
|
- //将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
|
|
|
- imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
- if(examStatus == 0){
|
|
|
- //未完成
|
|
|
- examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
|
|
|
- }else {
|
|
|
- //结束考试
|
|
|
- studentExamResultDao.endExam(examRoomStudentRelation.getExamRegistrationId());
|
|
|
+ public void nextBit(Integer examStatus,Long examRoomId) {
|
|
|
+ List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(examRoomId);
|
|
|
+ if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
|
|
|
+ RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
|
|
|
+ if(roomStudentListDto.getFinishedExam() == 0 || roomStudentListDto.getFinishedExam() == 1){
|
|
|
+ //考试中
|
|
|
+ currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus);
|
|
|
+ if(roomStudentListDtos.size() > 1){
|
|
|
+ RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
|
|
|
+ if(roomStudentListDto1.getFinishedExam() == 2){
|
|
|
+ nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(roomStudentListDto.getFinishedExam() == 2){
|
|
|
+ //未开始
|
|
|
+ nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true);
|
|
|
}
|
|
|
- //关闭学员房间入口
|
|
|
- examRoomStudentRelation.setClassroomSwitch(0);
|
|
|
- examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
- publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
|
|
|
}
|
|
|
- nextStudent(nextExamRoomStudentRelationId,false);
|
|
|
+ }
|
|
|
|
|
|
- /*try {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
|
|
|
- WebSocketServer.sendInfo(message,sysUser.getId().toString());
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }*/
|
|
|
+ private void currentStudent(Long examRoomStudentRelationId,Boolean isPush,Integer examStatus){
|
|
|
+ ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
+ //将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
|
|
|
+ imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
+ if(examStatus == 0){
|
|
|
+ //未完成
|
|
|
+ examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
|
|
|
+ studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),2);
|
|
|
+ }else {
|
|
|
+ //结束考试
|
|
|
+ studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),4);
|
|
|
+ }
|
|
|
+ //关闭学员房间入口
|
|
|
+ examRoomStudentRelation.setClassroomSwitch(0);
|
|
|
+ examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
|
|
|
}
|
|
|
|
|
|
private void nextStudent(Long nextExamRoomStudentRelationId,Boolean isPush){
|
|
@@ -539,6 +563,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
// msg.setAppParamJson(needCheckingDetailDto.getWaitNum());
|
|
|
msg.setWaitNum(needCheckingDetailDto.getWaitNum());
|
|
|
publishMessageDto.setMemberChangedMessage(msg);
|
|
|
+ //修改签到状态
|
|
|
+ studentExamResultDao.updateFinishedExam(examRegistrationId,2);
|
|
|
imFeignService.publishMessage(publishMessageDto);
|
|
|
}
|
|
|
}
|