|
@@ -5,6 +5,7 @@ import com.aliyun.oss.common.utils.BinaryUtil;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.google.gson.Gson;
|
|
import com.qmth.themis.business.bean.admin.OpenExamBean;
|
|
import com.qmth.themis.business.bean.admin.OpenExamBean;
|
|
import com.qmth.themis.business.bean.exam.*;
|
|
import com.qmth.themis.business.bean.exam.*;
|
|
import com.qmth.themis.business.cache.*;
|
|
import com.qmth.themis.business.cache.*;
|
|
@@ -14,7 +15,10 @@ import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.dao.TEExamMapper;
|
|
import com.qmth.themis.business.dao.TEExamMapper;
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
-import com.qmth.themis.business.dto.response.*;
|
|
|
|
|
|
+import com.qmth.themis.business.dto.response.TEExamActivityDto;
|
|
|
|
+import com.qmth.themis.business.dto.response.TEExamActivityWaitDto;
|
|
|
|
+import com.qmth.themis.business.dto.response.TEExamQueryDto;
|
|
|
|
+import com.qmth.themis.business.dto.response.TEExamWaitDto;
|
|
import com.qmth.themis.business.entity.TBSession;
|
|
import com.qmth.themis.business.entity.TBSession;
|
|
import com.qmth.themis.business.entity.TBTaskHistory;
|
|
import com.qmth.themis.business.entity.TBTaskHistory;
|
|
import com.qmth.themis.business.entity.TEExam;
|
|
import com.qmth.themis.business.entity.TEExam;
|
|
@@ -153,49 +157,6 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
0 :
|
|
0 :
|
|
examCache.getExamCount().intValue() - (examStudentCacheBean.getAlreadyExamCount()
|
|
examCache.getExamCount().intValue() - (examStudentCacheBean.getAlreadyExamCount()
|
|
.intValue())));
|
|
.intValue())));
|
|
-// if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
|
|
|
|
-// String[] longs = v.getInProcessLivenessFixedRangeStr().trim().replaceAll(" ", "").split(",");
|
|
|
|
-// List inProcessLivenessFixedRange = new ArrayList();
|
|
|
|
-// for (int i = 0; i < longs.length; i++) {
|
|
|
|
-// Integer integer = Integer.valueOf(longs[i].trim());
|
|
|
|
-// inProcessLivenessFixedRange.add(integer);
|
|
|
|
-// }
|
|
|
|
-// if (Objects.equals(inProcessLivenessFixedRange.toString().trim().replaceAll(" ", ""), "")) {
|
|
|
|
-// v.setInProcessLivenessFixedRange(null);
|
|
|
|
-// } else {
|
|
|
|
-// v.setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if (Objects.nonNull(v.getMonitorVideoSourceStr()) && !Objects
|
|
|
|
-// .equals(v.getMonitorVideoSourceStr().toString().trim().replaceAll(" ", ""), "")) {
|
|
|
|
-// v.setMonitorVideoSource(Arrays.asList(
|
|
|
|
-// v.getMonitorVideoSourceStr().trim().toUpperCase().replaceAll(" ", "").split(",")));
|
|
|
|
-// v.setMonitorAudioEnable(examCache.getMonitorAudioEnable());
|
|
|
|
-// //加入hardwareTest逻辑
|
|
|
|
-// if (v.getMonitorVideoSourceStr().toUpperCase().contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
|
|
|
|
-// || (Objects.nonNull(v.getEntryAuthenticationPolicy()) && (
|
|
|
|
-// Objects.equals(v.getEntryAuthenticationPolicy(),
|
|
|
|
-// EntryAuthenticationPolicyEnum.LIVENESS_VERIFY.name()) || Objects
|
|
|
|
-// .equals(v.getEntryAuthenticationPolicy(),
|
|
|
|
-// EntryAuthenticationPolicyEnum.FACE_VERIFY_FORCE.name()))) || (
|
|
|
|
-// Objects.nonNull(v.getCameraPhotoUpload()) && v.getCameraPhotoUpload() == 1)) {
|
|
|
|
-// List<String> hardwareTest = v.getHardwareTest();
|
|
|
|
-// if (Objects.isNull(hardwareTest)) {
|
|
|
|
-// hardwareTest = new ArrayList<>();
|
|
|
|
-// }
|
|
|
|
-// hardwareTest.add(HardwareTestEnum.CAMERA.name());
|
|
|
|
-// //取course缓存
|
|
|
|
-// ExamCourseCacheBean examCourseCacheBean = teExamCourseService
|
|
|
|
-// .getExamCourseCacheBean(v.getExamId(), v.getCourseCode());
|
|
|
|
-// if (Objects.nonNull(examCourseCacheBean) && Objects.nonNull(examCourseCacheBean.getHasAudio())
|
|
|
|
-// && examCourseCacheBean.getHasAudio() == 1) {
|
|
|
|
-// hardwareTest.add(HardwareTestEnum.AUDIOPLAY.name());
|
|
|
|
-// }
|
|
|
|
-// v.setHardwareTest(hardwareTest);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// v.setMonitorVideoSource(null);
|
|
|
|
-// }
|
|
|
|
});
|
|
});
|
|
list.forEach(s -> {
|
|
list.forEach(s -> {
|
|
s.setActivities(new ArrayList<>(map.get(s.getId())));
|
|
s.setActivities(new ArrayList<>(map.get(s.getId())));
|
|
@@ -231,8 +192,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public ExamPrepareBean prepare(Long studentId, Long examStudentId) {
|
|
public ExamPrepareBean prepare(Long studentId, Long examStudentId) {
|
|
-
|
|
|
|
TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
|
|
TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
|
|
|
|
+ String monitorUserId = "s_" + tbSession.getId();
|
|
ExamStudentCacheBean es = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamStudentCacheBean es = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
if (es == null) {
|
|
if (es == null) {
|
|
throw new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_STUDENT);
|
|
throw new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_STUDENT);
|
|
@@ -256,23 +217,22 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
ExamPaperCacheBean ep = teExamPaperService
|
|
ExamPaperCacheBean ep = teExamPaperService
|
|
.getExamPaperCacheBean(ExamRecordCacheUtil.getPaperId(recordId));
|
|
.getExamPaperCacheBean(ExamRecordCacheUtil.getPaperId(recordId));
|
|
ExamCourseCacheBean ec = teExamCourseService.getExamCourseCacheBean(es.getExamId(), es.getCourseCode());
|
|
ExamCourseCacheBean ec = teExamCourseService.getExamCourseCacheBean(es.getExamId(), es.getCourseCode());
|
|
- ExamPrepareBean prepare = new ExamPrepareBean();
|
|
|
|
- prepare.setRecordId(recordId);
|
|
|
|
- prepare.setAudioPlayCount(ep.getAudioPlayCount());
|
|
|
|
- prepare.setHasAudio((ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setObjectiveShuffle(
|
|
|
|
- (ec.getObjectiveShuffle() == null || ec.getObjectiveShuffle().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setOptionShuffle(
|
|
|
|
- (ec.getOptionShuffle() == null || ec.getOptionShuffle().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setPaperUrl(ossUtil.getPrivateUrl(ep.getPaperPath()));
|
|
|
|
- prepare.setStructUrl(ossUtil.getPrivateUrl(ep.getStructPath()));
|
|
|
|
- prepare.setMonitorAppId(tencentYunUtil.getTencentYunDomain().getAppId());
|
|
|
|
- prepare.setMonitorKey(ExamRecordCacheUtil.getMonitorKey(recordId));
|
|
|
|
- prepare.setMonitorUserId("s_" + tbSession.getId());
|
|
|
|
- prepare.setMonitorUserSig(
|
|
|
|
- tencentYunUtil.getSign(prepare.getMonitorUserId(), SystemConstant.TENCENT_EXPIRE_TIME));
|
|
|
|
-
|
|
|
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
ExamActivityCacheBean ac = teExamActivityService.getExamActivityCacheBean(es.getExamActivityId());
|
|
ExamActivityCacheBean ac = teExamActivityService.getExamActivityCacheBean(es.getExamActivityId());
|
|
|
|
+ ExamPrepareBean prepare = new ExamPrepareBean(recordId, (ec.getObjectiveShuffle() == null || ec.getObjectiveShuffle().intValue() == 0 ? false : true),
|
|
|
|
+ (ec.getOptionShuffle() == null || ec.getOptionShuffle().intValue() == 0 ? false : true),
|
|
|
|
+ (ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true)
|
|
|
|
+ , ep.getAudioPlayCount(), ExamRecordCacheUtil.getMonitorKey(recordId), monitorUserId
|
|
|
|
+ , tencentYunUtil.getSign(monitorUserId, SystemConstant.TENCENT_EXPIRE_TIME)
|
|
|
|
+ , tencentYunUtil.getTencentYunDomain().getAppId());
|
|
|
|
+
|
|
|
|
+ TEExamActivityDto teExamActivityDto = new TEExamActivityDto(examCache, ac, examStudentCacheBean,
|
|
|
|
+ examStudentId, ec, ExamRecordCacheUtil.getStartTime(recordId),
|
|
|
|
+ ExamRecordCacheUtil.getEndTime(recordId), ExamRecordCacheUtil.getOpeningSeconds(recordId),
|
|
|
|
+ ExamRecordCacheUtil.getMinDurationSeconds(recordId),
|
|
|
|
+ ExamRecordCacheUtil.getMaxDurationSeconds(recordId), ExamRecordCacheUtil.getForceFinish(recordId));
|
|
|
|
+ prepare.setTeExamActivityDto(teExamActivityDto);
|
|
|
|
+
|
|
ExamRecordCacheUtil.setStartTime(recordId, ac.getStartTime(), false);
|
|
ExamRecordCacheUtil.setStartTime(recordId, ac.getStartTime(), false);
|
|
ExamRecordCacheUtil.setEndTime(recordId, ac.getFinishTime(), false);
|
|
ExamRecordCacheUtil.setEndTime(recordId, ac.getFinishTime(), false);
|
|
ExamRecordCacheUtil.setOpeningSeconds(recordId, ac.getOpeningSeconds(), false);
|
|
ExamRecordCacheUtil.setOpeningSeconds(recordId, ac.getOpeningSeconds(), false);
|
|
@@ -343,23 +303,14 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
es.getAlreadyExamCount() + 1);
|
|
es.getAlreadyExamCount() + 1);
|
|
|
|
|
|
es.setCurrentRecordId(recordId);
|
|
es.setCurrentRecordId(recordId);
|
|
-
|
|
|
|
- ExamPrepareBean prepare = new ExamPrepareBean();
|
|
|
|
- prepare.setRecordId(recordId);
|
|
|
|
- prepare.setAudioPlayCount(ep.getAudioPlayCount());
|
|
|
|
- prepare.setHasAudio((ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setObjectiveShuffle(
|
|
|
|
- (ec.getObjectiveShuffle() == null || ec.getObjectiveShuffle().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setOptionShuffle(
|
|
|
|
- (ec.getOptionShuffle() == null || ec.getOptionShuffle().intValue() == 0 ? false : true));
|
|
|
|
- prepare.setPaperUrl(ossUtil.getPrivateUrl(ep.getPaperPath()));
|
|
|
|
- prepare.setStructUrl(ossUtil.getPrivateUrl(ep.getStructPath()));
|
|
|
|
- prepare.setMonitorAppId(tencentYunUtil.getTencentYunDomain().getAppId());
|
|
|
|
- prepare.setMonitorKey(ExamRecordCacheUtil.getMonitorKey(recordId));
|
|
|
|
- prepare.setMonitorUserId("s_" + tbSession.getId());
|
|
|
|
- prepare.setMonitorUserSig(
|
|
|
|
- tencentYunUtil.getSign(prepare.getMonitorUserId(), SystemConstant.TENCENT_EXPIRE_TIME));
|
|
|
|
-
|
|
|
|
|
|
+ ExamPrepareBean prepare = new ExamPrepareBean(recordId, (ec.getObjectiveShuffle() == null || ec.getObjectiveShuffle().intValue() == 0 ? false : true),
|
|
|
|
+ (ec.getOptionShuffle() == null || ec.getOptionShuffle().intValue() == 0 ? false : true),
|
|
|
|
+ (ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true)
|
|
|
|
+ , ep.getAudioPlayCount(), ExamRecordCacheUtil.getMonitorKey(recordId), monitorUserId
|
|
|
|
+ , tencentYunUtil.getSign(monitorUserId, SystemConstant.TENCENT_EXPIRE_TIME)
|
|
|
|
+ , tencentYunUtil.getTencentYunDomain().getAppId());
|
|
|
|
+ TEExamActivityDto teExamActivityDto = teExamActivityService.getWaitingExam(activityId, examStudentId, es.getCourseCode());
|
|
|
|
+ prepare.setTeExamActivityDto(teExamActivityDto);
|
|
// 更新考生缓存
|
|
// 更新考生缓存
|
|
redisUtil.set(RedisKeyHelper.examStudentCacheKey(examStudentId), es);
|
|
redisUtil.set(RedisKeyHelper.examStudentCacheKey(examStudentId), es);
|
|
//更新场次-考试记录缓存
|
|
//更新场次-考试记录缓存
|