|
@@ -1,43 +1,13 @@
|
|
|
package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.UUID;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListHistoryBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListProgressBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListProgressExcelBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
|
|
|
-import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
|
|
|
+import com.qmth.themis.business.bean.backend.*;
|
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
-import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
|
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
-import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
|
|
|
-import com.qmth.themis.business.cache.bean.ExamStudentAnswerCacheBean;
|
|
|
-import com.qmth.themis.business.cache.bean.ExamStudentPaperStructCacheBean;
|
|
|
-import com.qmth.themis.business.cache.bean.ObjectiveAnswerCacheBean;
|
|
|
+import com.qmth.themis.business.cache.bean.*;
|
|
|
import com.qmth.themis.business.config.SystemConfig;
|
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
@@ -46,25 +16,25 @@ import com.qmth.themis.business.dto.MqDto;
|
|
|
import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
|
|
|
import com.qmth.themis.business.entity.TOeExamAnswer;
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
-import com.qmth.themis.business.enums.ExamRecordFieldEnum;
|
|
|
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
-import com.qmth.themis.business.enums.ExamTypeEnum;
|
|
|
-import com.qmth.themis.business.enums.LivenessTypeEnum;
|
|
|
-import com.qmth.themis.business.enums.MqTagEnum;
|
|
|
-import com.qmth.themis.business.enums.MqTopicEnum;
|
|
|
-import com.qmth.themis.business.enums.ObjectiveScorePolicyEnum;
|
|
|
-import com.qmth.themis.business.enums.VerifyExceptionEnum;
|
|
|
-import com.qmth.themis.business.service.MqDtoService;
|
|
|
-import com.qmth.themis.business.service.TEExamActivityService;
|
|
|
-import com.qmth.themis.business.service.TEExamPaperService;
|
|
|
-import com.qmth.themis.business.service.TEExamService;
|
|
|
-import com.qmth.themis.business.service.TOeExamAnswerService;
|
|
|
-import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
+import com.qmth.themis.business.enums.*;
|
|
|
+import com.qmth.themis.business.service.*;
|
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
import com.qmth.themis.common.contanst.Constants;
|
|
|
import com.qmth.themis.common.util.FileUtil;
|
|
|
import com.qmth.themis.common.util.SimpleBeanUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Description: 考试记录 服务实现类
|
|
@@ -175,9 +145,9 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
er.setForceFinish(exam.getForceFinish());
|
|
|
ExamPaperCacheBean ep = examPaperService.getExamPaperCacheBean(paperId);
|
|
|
if (StringUtils.isBlank(ep.getAnswerPath())) {
|
|
|
- er.setHasAnswerFile(0);
|
|
|
- }else {
|
|
|
- er.setHasAnswerFile(1);
|
|
|
+ er.setHasAnswerFile(0);
|
|
|
+ } else {
|
|
|
+ er.setHasAnswerFile(1);
|
|
|
}
|
|
|
Map<String, Object> map = SimpleBeanUtil.objectToMap(er);
|
|
|
redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(er.getId()), map);
|
|
@@ -196,12 +166,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
Integer subIndex = (Integer) param.get("subIndex");
|
|
|
Long paperId = ExamRecordCacheUtil.getPaperId(recordId);
|
|
|
String key = RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex);
|
|
|
-
|
|
|
+
|
|
|
//考生作答缓存
|
|
|
ExamStudentAnswerCacheBean answer = (ExamStudentAnswerCacheBean) redisUtil.get(
|
|
|
- RedisKeyHelper.examAnswerKey(recordId),key);
|
|
|
+ RedisKeyHelper.examAnswerKey(recordId), key);
|
|
|
if (answer == null) {
|
|
|
- log.error("no ExamStudentAnswerCacheBean for calculateObjectiveScore key:"+key);
|
|
|
+ log.error("no ExamStudentAnswerCacheBean for calculateObjectiveScore key:" + key);
|
|
|
|
|
|
// 计算客观分总分
|
|
|
calculateTotalObjectiveScore(recordId);
|
|
@@ -210,7 +180,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
//整卷客观题标答缓存集合
|
|
|
Map<String, ObjectiveAnswerCacheBean> map = examPaperService.getObjectiveAnswerCacheBean(paperId);
|
|
|
if (map == null || map.size() == 0) {
|
|
|
- log.debug("no ObjectiveAnswerCacheBean map for calculateObjectiveScore paperId:"+paperId);
|
|
|
+ log.debug("no ObjectiveAnswerCacheBean map for calculateObjectiveScore paperId:" + paperId);
|
|
|
// 更新分数
|
|
|
answer.setScore(0.0);
|
|
|
redisUtil.set(RedisKeyHelper.examAnswerKey(recordId), key, answer);
|
|
@@ -222,8 +192,8 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
//客观题标答缓存
|
|
|
ObjectiveAnswerCacheBean cb = map.get(key);
|
|
|
if (cb == null) {
|
|
|
- log.debug("no ObjectiveAnswerCacheBean for calculateObjectiveScore key:"+key);
|
|
|
- // 更新分数
|
|
|
+ log.debug("no ObjectiveAnswerCacheBean for calculateObjectiveScore key:" + key);
|
|
|
+ // 更新分数
|
|
|
answer.setScore(0.0);
|
|
|
redisUtil.set(RedisKeyHelper.examAnswerKey(recordId), key, answer);
|
|
|
|
|
@@ -559,13 +529,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
* @param minWarningCount
|
|
|
* @param maxWarningCount
|
|
|
* @param clientWebsocketStatus
|
|
|
- * @param monitorStatusSource
|
|
|
* @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, Integer paperDownload, String status, String name, String identity, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource, Long userId) {
|
|
|
- return tOeExamRecordMapper.invigilatePageListVideo(iPage, examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
|
|
|
+ public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, Integer paperDownload, String status, String name, String identity, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, Long userId) {
|
|
|
+ return tOeExamRecordMapper.invigilatePageListVideo(iPage, examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, userId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -623,14 +592,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
* @param maxExceptionCount
|
|
|
* @param minWarningCount
|
|
|
* @param maxWarningCount
|
|
|
- * @param clientWebsocketStatus
|
|
|
- * @param monitorStatusSource
|
|
|
* @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, Integer approveStatus, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource, Long userId) {
|
|
|
- return tOeExamRecordMapper.invigilatePageWarningList(iPage, examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource, userId);
|
|
|
+ public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId, Long examActivityId, String roomCode, Integer approveStatus, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long userId) {
|
|
|
+ return tOeExamRecordMapper.invigilatePageWarningList(iPage, examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -705,10 +672,10 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
public void calculateScore(Long recordId) {
|
|
|
|
|
|
TOeExamRecord rec = this.getById(recordId);
|
|
|
-
|
|
|
+
|
|
|
ExamPaperCacheBean ep = examPaperService.getExamPaperCacheBean(rec.getPaperId());
|
|
|
- if (rec.getHasAnswerFile().intValue()==0 && StringUtils.isNotBlank(ep.getAnswerPath())) {
|
|
|
- tOeExamRecordMapper.updateHasAnswerFile(recordId, 1);
|
|
|
+ if (rec.getHasAnswerFile().intValue() == 0 && StringUtils.isNotBlank(ep.getAnswerPath())) {
|
|
|
+ tOeExamRecordMapper.updateHasAnswerFile(recordId, 1);
|
|
|
}
|
|
|
|
|
|
Map<String, ObjectiveAnswerCacheBean> map = examPaperService.getObjectiveAnswerCacheBean(rec.getPaperId());
|