|
@@ -296,6 +296,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
public void recorded(Long roomId) {
|
|
|
List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
|
|
|
if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
|
|
|
if(roomStudentListDto.getFinishedExam() != 0){
|
|
|
throw new BizException("操作失败:当前学员状态不支持录播");
|
|
@@ -310,15 +311,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
//关闭学员房间入口
|
|
|
examRoomStudentRelation.setClassroomSwitch(0);
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
- publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true,sysUser.getId());
|
|
|
if(roomStudentListDtos.size() > 1){
|
|
|
RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
|
|
|
if(roomStudentListDto1.getFinishedExam() == 2){
|
|
|
- nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
|
|
|
+ nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false,sysUser.getId());
|
|
|
}
|
|
|
}
|
|
|
- //将当前学员退出教室
|
|
|
- imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
+ //将当前学员退踢出教室
|
|
|
+ imFeignService.kickRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId(),roomStudentListDto.getStudentId().toString()));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -388,7 +389,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
int recordMinutes = Integer.parseInt(sysConfigService.findByParamName("record_minutes").getParanValue());
|
|
|
Date date = DateUtil.addMinutes(stuRecordDetailDto.getRecordStartTime(),recordMinutes);
|
|
|
stuRecordDetailDto.setExamEndTime(date);
|
|
|
- int secondsBetween = DateUtil.secondsBetween(stuRecordDetailDto.getRecordStartTime(), new Date());
|
|
|
+ int secondsBetween = DateUtil.secondsBetween(new Date(),date);
|
|
|
if(secondsBetween <= 0){
|
|
|
throw new BizException("操作失败:录制超时");
|
|
|
}
|
|
@@ -431,26 +432,27 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(examRoomId);
|
|
|
if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
|
|
|
RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if(roomStudentListDto.getFinishedExam() == 0 || roomStudentListDto.getFinishedExam() == 1){
|
|
|
//考试中
|
|
|
- currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus);
|
|
|
+ currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus,sysUser.getId());
|
|
|
if(roomStudentListDtos.size() > 1){
|
|
|
RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
|
|
|
if(roomStudentListDto1.getFinishedExam() == 2){
|
|
|
- nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
|
|
|
+ nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false,sysUser.getId());
|
|
|
}
|
|
|
}
|
|
|
}else if(roomStudentListDto.getFinishedExam() == 2){
|
|
|
//未开始
|
|
|
- nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true);
|
|
|
+ nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,sysUser.getId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void currentStudent(Long examRoomStudentRelationId,Boolean isPush,Integer examStatus){
|
|
|
+ private void currentStudent(Long examRoomStudentRelationId,Boolean isPush,Integer examStatus,Integer operator){
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
|
|
|
- imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
+ imFeignService.kickRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId(),examRoomStudentRelation.getStudentId().toString()));
|
|
|
if(examStatus != null && examStatus == 0){
|
|
|
//未完成
|
|
|
examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
|
|
@@ -462,35 +464,33 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
//关闭学员房间入口
|
|
|
examRoomStudentRelation.setClassroomSwitch(0);
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
- publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush,operator);
|
|
|
}
|
|
|
|
|
|
- private void nextStudent(Long nextExamRoomStudentRelationId,Boolean isPush){
|
|
|
+ private void nextStudent(Long nextExamRoomStudentRelationId,Boolean isPush,Integer operator){
|
|
|
if(nextExamRoomStudentRelationId != null){
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(nextExamRoomStudentRelationId);
|
|
|
//开启学员房间入口
|
|
|
examRoomStudentRelation.setClassroomSwitch(1);
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
- publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush,operator);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush,Integer operator){
|
|
|
if (!isPush){
|
|
|
return;
|
|
|
}
|
|
|
PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
- String userId = sysUser.getId().toString();
|
|
|
- publishMessageDto.setUserId(userId);
|
|
|
+ publishMessageDto.setUserId(operator.toString());
|
|
|
publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
|
|
|
- MemberChangedMessage msg;
|
|
|
- if(action == 3 || action == 4){
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId().toString(),3);
|
|
|
+ /*if(action == 3 || action == 4){
|
|
|
msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId().toString(),3);
|
|
|
}else {
|
|
|
- msg = new MemberChangedMessage(action, userId,3);
|
|
|
- }
|
|
|
+ msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId(),3);
|
|
|
+ }*/
|
|
|
// String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
|
|
|
msg.setWaitNum(needCheckingDetailDto.getWaitNum());
|
|
@@ -513,7 +513,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
String userId = sysUser.getId().toString();
|
|
|
publishMessageDto.setUserId(userId);
|
|
|
publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
|
|
|
- MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, userId,3);
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, examRoomStudentRelation.getStudentId().toString(),3);
|
|
|
// String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
// msg.setAppParamJson(jsonString);
|
|
|
NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
|