|
@@ -1,20 +1,14 @@
|
|
package com.qmth.themis.task.quartz.service.impl;
|
|
package com.qmth.themis.task.quartz.service.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
-import com.qmth.themis.business.dto.MqDto;
|
|
|
|
-import com.qmth.themis.business.entity.TBAttachment;
|
|
|
|
-import com.qmth.themis.business.entity.TEAudio;
|
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
|
|
|
|
-import com.qmth.themis.business.enums.MqTagEnum;
|
|
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.service.*;
|
|
import com.qmth.themis.business.util.MqUtil;
|
|
import com.qmth.themis.business.util.MqUtil;
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
@@ -26,10 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import java.io.File;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -99,14 +90,18 @@ public class QuartzLogicServiceImpl implements QuartzLogicService {
|
|
Long examStudentId = s.getExamStudentId();
|
|
Long examStudentId = s.getExamStudentId();
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
//候考阶段且没有进入考试则不交卷
|
|
//候考阶段且没有进入考试则不交卷
|
|
- if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(s.getFirstStartTime())) {
|
|
|
|
- commonService.deleteExamStudentCache(s.getId(), examStudentCacheBean.getStudentId());
|
|
|
|
- commonService.DismissRoomByStrRoomId(s.getId());
|
|
|
|
- } else {//交卷
|
|
|
|
- Long recordEndTime = s.getEndTime();
|
|
|
|
- if (Objects.nonNull(examActivityCacheBean.getFinishTime()) && Objects.nonNull(recordEndTime) && examActivityCacheBean.getFinishTime().longValue() == recordEndTime.longValue()) {
|
|
|
|
- teExamService.finish(examStudentCacheBean.getStudentId(), s.getId(), FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(s.getFirstStartTime())) {
|
|
|
|
+ commonService.deleteExamStudentCache(s.getId(), examStudentCacheBean.getStudentId());
|
|
|
|
+ commonService.DismissRoomByStrRoomId(s.getId());
|
|
|
|
+ } else {//交卷
|
|
|
|
+ Long recordEndTime = s.getEndTime();
|
|
|
|
+ if (Objects.nonNull(examActivityCacheBean.getFinishTime()) && Objects.nonNull(recordEndTime) && examActivityCacheBean.getFinishTime().longValue() == recordEndTime.longValue()) {
|
|
|
|
+ teExamService.finish(examStudentCacheBean.getStudentId(), s.getId(), FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(SystemConstant.LOG_ERROR, e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -126,11 +121,15 @@ public class QuartzLogicServiceImpl implements QuartzLogicService {
|
|
Long examStudentId = s.getExamStudentId();
|
|
Long examStudentId = s.getExamStudentId();
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
//候考阶段且没有进入考试则不交卷
|
|
//候考阶段且没有进入考试则不交卷
|
|
- if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(s.getFirstStartTime())) {
|
|
|
|
- commonService.deleteExamStudentCache(s.getId(), examStudentCacheBean.getStudentId());
|
|
|
|
- commonService.DismissRoomByStrRoomId(s.getId());
|
|
|
|
- } else {//交卷
|
|
|
|
- teExamService.finish(examStudentCacheBean.getStudentId(), s.getId(), FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(s.getFirstStartTime())) {
|
|
|
|
+ commonService.deleteExamStudentCache(s.getId(), examStudentCacheBean.getStudentId());
|
|
|
|
+ commonService.DismissRoomByStrRoomId(s.getId());
|
|
|
|
+ } else {//交卷
|
|
|
|
+ teExamService.finish(examStudentCacheBean.getStudentId(), s.getId(), FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(SystemConstant.LOG_ERROR, e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -165,15 +164,19 @@ public class QuartzLogicServiceImpl implements QuartzLogicService {
|
|
firstStartTime = tOeExamRecord.getFirstStartTime();
|
|
firstStartTime = tOeExamRecord.getFirstStartTime();
|
|
}
|
|
}
|
|
//候考阶段且没有进入考试则不交卷
|
|
//候考阶段且没有进入考试则不交卷
|
|
- if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(firstStartTime)) {
|
|
|
|
- commonService.deleteExamStudentCache(recordId, examStudentCacheBean.getStudentId());
|
|
|
|
- commonService.DismissRoomByStrRoomId(recordId);
|
|
|
|
- } else {//交卷
|
|
|
|
- Long recordEndTime = ExamRecordCacheUtil.getEndTime(recordId);
|
|
|
|
- if (examActivityCacheBean.getFinishTime().longValue() == recordEndTime.longValue()) {
|
|
|
|
- Integer durationSeconds = ExamRecordCacheUtil.getDurationSeconds(recordId);
|
|
|
|
- teExamService.finish(examStudentCacheBean.getStudentId(), recordId, FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (examRecordStatusEnum == ExamRecordStatusEnum.FIRST_PREPARE && Objects.isNull(firstStartTime)) {
|
|
|
|
+ commonService.deleteExamStudentCache(recordId, examStudentCacheBean.getStudentId());
|
|
|
|
+ commonService.DismissRoomByStrRoomId(recordId);
|
|
|
|
+ } else {//交卷
|
|
|
|
+ Long recordEndTime = ExamRecordCacheUtil.getEndTime(recordId);
|
|
|
|
+ if (examActivityCacheBean.getFinishTime().longValue() == recordEndTime.longValue()) {
|
|
|
|
+ Integer durationSeconds = ExamRecordCacheUtil.getDurationSeconds(recordId);
|
|
|
|
+ teExamService.finish(examStudentCacheBean.getStudentId(), recordId, FinishTypeEnum.AUTO.name(), durationSeconds);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(SystemConstant.LOG_ERROR, e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|