|
@@ -137,7 +137,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
ser.setExamRegistrationId(examRegistration.getId().longValue());
|
|
|
ser.setExaminationBasicId(examRegistration.getExaminationBasicId());
|
|
|
ser.setStudentId(examRegistration.getStudentId());
|
|
|
- ser.setIsFinishedExam(0);
|
|
|
+ ser.setIsFinishedExam(3);
|
|
|
ser.setConfirmStatus(0);
|
|
|
ser.setTenantId(TenantContextHolder.getTenantId());
|
|
|
studentExamResults.add(ser);
|
|
@@ -368,8 +368,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
public StuRecordDetailDto stuRecordDetail(Long examRegistrationId) {
|
|
|
StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
|
|
|
//当前学员是否完成考试
|
|
|
- if(studentExamResult.getIsFinishedExam() == 1){
|
|
|
- throw new BizException("操作失败:您已完成考试");
|
|
|
+ if(studentExamResult.getIsFinishedExam() != 4){
|
|
|
+ throw new BizException("操作失败:当前状态不允许录播");
|
|
|
}
|
|
|
//是否允许录播
|
|
|
if(studentExamResult.getRecordStartTime() == null){
|
|
@@ -383,12 +383,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
StuRecordDetailDto stuRecordDetailDto = examRegistrationDao.getStuRecordDetail(examRegistrationId);
|
|
|
int recordMinutes = Integer.parseInt(sysConfigService.findByParamName("record_minutes").getParanValue());
|
|
|
- Date date = studentExamResult.getRecordStartTime();
|
|
|
- date = DateUtil.addMinutes(date,recordMinutes);
|
|
|
+ Date date = DateUtil.addMinutes(stuRecordDetailDto.getRecordStartTime(),recordMinutes);
|
|
|
stuRecordDetailDto.setExamEndTime(date);
|
|
|
- int secondsBetween = DateUtil.secondsBetween(stuRecordDetailDto.getRecordStartTime(), date);
|
|
|
+ int secondsBetween = DateUtil.secondsBetween(stuRecordDetailDto.getRecordStartTime(), new Date());
|
|
|
if(secondsBetween <= 0){
|
|
|
throw new BizException("操作失败:录制超时");
|
|
|
}
|
|
@@ -404,9 +404,6 @@ 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.getIsFinishedExam() != 4){
|
|
|
throw new BizException("提交失败:当前考试状态不允许录播");
|
|
@@ -480,14 +477,20 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (!isPush){
|
|
|
return;
|
|
|
}
|
|
|
PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
- String userId = examRoomStudentRelation.getStudentId().toString();
|
|
|
+ String userId = sysUser.getId().toString();
|
|
|
publishMessageDto.setUserId(userId);
|
|
|
publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
|
|
|
- MemberChangedMessage msg = new MemberChangedMessage(action, userId,3);
|
|
|
+ MemberChangedMessage msg;
|
|
|
+ if(action == 3 || action == 4){
|
|
|
+ msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId().toString(),3);
|
|
|
+ }else {
|
|
|
+ msg = new MemberChangedMessage(action, userId,3);
|
|
|
+ }
|
|
|
// String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
|
|
|
msg.setWaitNum(needCheckingDetailDto.getWaitNum());
|
|
@@ -504,9 +507,10 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
|
|
|
public PublishMessageDto getPublishMessage(Long examRegistrationId){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.getStudentExamRoom(examRegistrationId);
|
|
|
PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
- String userId = examRoomStudentRelation.getStudentId().toString();
|
|
|
+ String userId = sysUser.getId().toString();
|
|
|
publishMessageDto.setUserId(userId);
|
|
|
publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
|
|
|
MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, userId,3);
|