|
@@ -1,64 +1,13 @@
|
|
package com.qmth.themis.business.service.impl;
|
|
package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.io.InputStream;
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
|
-import java.time.ZoneOffset;
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Collections;
|
|
|
|
-import java.util.Comparator;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.HashSet;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
-import java.util.Set;
|
|
|
|
-import java.util.UUID;
|
|
|
|
-import java.util.regex.Matcher;
|
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
-
|
|
|
|
-import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
|
-import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
-import org.springframework.cache.annotation.CachePut;
|
|
|
|
-import org.springframework.cache.annotation.Cacheable;
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
-
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.qmth.themis.business.bean.exam.AnswerSubmitBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.AudioLeftPlayCountSubmitBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamFileUploadBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamFinishBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamPrepareBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamResultBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamResumeBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.ExamStartBean;
|
|
|
|
-import com.qmth.themis.business.bean.exam.StudentPaperStructBean;
|
|
|
|
|
|
+import com.qmth.themis.business.bean.exam.*;
|
|
import com.qmth.themis.business.cache.ExamActivityRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamActivityRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamingDataCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamingDataCacheUtil;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
-import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamActivityRecordCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamStudentAnswerCacheBean;
|
|
|
|
-import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
|
|
-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.config.SystemConfig;
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
@@ -72,39 +21,33 @@ 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;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
-import com.qmth.themis.business.enums.EntryAuthenticationPolicyEnum;
|
|
|
|
-import com.qmth.themis.business.enums.ExamModeEnum;
|
|
|
|
-import com.qmth.themis.business.enums.ExamRecordFieldEnum;
|
|
|
|
-import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
|
-import com.qmth.themis.business.enums.FinishExamResultEnum;
|
|
|
|
-import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
|
-import com.qmth.themis.business.enums.HardwareTestEnum;
|
|
|
|
-import com.qmth.themis.business.enums.InvigilateMonitorStatusEnum;
|
|
|
|
-import com.qmth.themis.business.enums.InvigilateVerifyEnum;
|
|
|
|
-import com.qmth.themis.business.enums.MonitorStatusSourceEnum;
|
|
|
|
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
|
|
|
|
-import com.qmth.themis.business.enums.MqTagEnum;
|
|
|
|
-import com.qmth.themis.business.enums.MqTopicEnum;
|
|
|
|
-import com.qmth.themis.business.enums.ReviewResultEnum;
|
|
|
|
-import com.qmth.themis.business.enums.SystemOperationEnum;
|
|
|
|
-import com.qmth.themis.business.enums.TaskStatusEnum;
|
|
|
|
-import com.qmth.themis.business.enums.WebsocketStatusEnum;
|
|
|
|
-import com.qmth.themis.business.service.MqDtoService;
|
|
|
|
-import com.qmth.themis.business.service.TBTaskHistoryService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamActivityService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamCourseService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamPaperService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamService;
|
|
|
|
-import com.qmth.themis.business.service.TEExamStudentService;
|
|
|
|
-import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
|
-import com.qmth.themis.business.util.JacksonUtil;
|
|
|
|
-import com.qmth.themis.business.util.OssUtil;
|
|
|
|
-import com.qmth.themis.business.util.RedisUtil;
|
|
|
|
-import com.qmth.themis.business.util.ServletUtil;
|
|
|
|
-import com.qmth.themis.business.util.TencentYunUtil;
|
|
|
|
|
|
+import com.qmth.themis.business.enums.*;
|
|
|
|
+import com.qmth.themis.business.service.*;
|
|
|
|
+import com.qmth.themis.business.util.*;
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.util.IpUtil;
|
|
import com.qmth.themis.common.util.IpUtil;
|
|
|
|
+import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
+import org.springframework.cache.annotation.CachePut;
|
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.InputStream;
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.ZoneOffset;
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 考试批次 服务实现类
|
|
* @Description: 考试批次 服务实现类
|
|
@@ -197,7 +140,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
map.put(v.getExamId(), teExamActivityDtos);
|
|
map.put(v.getExamId(), teExamActivityDtos);
|
|
ExamCacheBean examCache = getExamCacheBeanNative(v.getExamId());
|
|
ExamCacheBean examCache = getExamCacheBeanNative(v.getExamId());
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(v.getExamStudentId());
|
|
ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(v.getExamStudentId());
|
|
- v.setLeftExamCount(examCache.getExamCount() - (examStudentCacheBean.getAlreadyExamCount()==null?0:examStudentCacheBean.getAlreadyExamCount()));
|
|
|
|
|
|
+ v.setLeftExamCount(examCache.getExamCount() - (examStudentCacheBean.getAlreadyExamCount() == null ? 0 : examStudentCacheBean.getAlreadyExamCount()));
|
|
if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
|
|
if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
|
|
String[] longs = v.getInProcessLivenessFixedRangeStr().trim().replaceAll(" ", "").split(",");
|
|
String[] longs = v.getInProcessLivenessFixedRangeStr().trim().replaceAll(" ", "").split(",");
|
|
List inProcessLivenessFixedRange = new ArrayList();
|
|
List inProcessLivenessFixedRange = new ArrayList();
|
|
@@ -243,7 +186,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
|
|
|
|
private void checkIp(ExamCacheBean examCache) {
|
|
private void checkIp(ExamCacheBean examCache) {
|
|
- if (examCache.getEnableIpLimit() != null && examCache.getEnableIpLimit().intValue() == 1) {
|
|
|
|
|
|
+ if (examCache.getEnableIpLimit() != null && examCache.getEnableIpLimit().intValue() == 1) {
|
|
String ipAllows = examCache.getIpAllow();
|
|
String ipAllows = examCache.getIpAllow();
|
|
//ip限制判断
|
|
//ip限制判断
|
|
String ip = IpUtil.getRemoteIp(ServletUtil.getRequest());
|
|
String ip = IpUtil.getRemoteIp(ServletUtil.getRequest());
|
|
@@ -262,6 +205,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 开始候考
|
|
* 开始候考
|
|
*/
|
|
*/
|
|
@@ -465,8 +409,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
if (now.getTime() < start) {
|
|
if (now.getTime() < start) {
|
|
throw new BusinessException("没有到允许开考的时间");
|
|
throw new BusinessException("没有到允许开考的时间");
|
|
}
|
|
}
|
|
- if(!ExamRecordStatusEnum.RESUME_PREPARE.equals(sta)) {//非断点进入的
|
|
|
|
- if (now.getTime() > end) {
|
|
|
|
|
|
+ if (!ExamRecordStatusEnum.RESUME_PREPARE.equals(sta)) {//非断点进入的
|
|
|
|
+ if (now.getTime() > end) {
|
|
throw new BusinessException("允许开考的时间已结束");
|
|
throw new BusinessException("允许开考的时间已结束");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -476,21 +420,21 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
if (now.getTime() < start) {
|
|
if (now.getTime() < start) {
|
|
throw new BusinessException("没有到允许开考的时间");
|
|
throw new BusinessException("没有到允许开考的时间");
|
|
}
|
|
}
|
|
- if(ExamRecordStatusEnum.RESUME_PREPARE.equals(sta)) {//断点进入的
|
|
|
|
- //集中不启用统一收卷,考试快结束时,断点,再登录时, 时间已经超过考试截止时间,断点时,此时应该能登录继续作答
|
|
|
|
- Integer forceFinish = ExamRecordCacheUtil.getForceFinish(recordId);
|
|
|
|
- if (forceFinish != null && forceFinish.intValue() == 1) {
|
|
|
|
- if (now.getTime() > end) {
|
|
|
|
- throw new BusinessException("允许开考的时间已结束");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- if (now.getTime() > end) {
|
|
|
|
|
|
+ if (ExamRecordStatusEnum.RESUME_PREPARE.equals(sta)) {//断点进入的
|
|
|
|
+ //集中不启用统一收卷,考试快结束时,断点,再登录时, 时间已经超过考试截止时间,断点时,此时应该能登录继续作答
|
|
|
|
+ Integer forceFinish = ExamRecordCacheUtil.getForceFinish(recordId);
|
|
|
|
+ if (forceFinish != null && forceFinish.intValue() == 1) {
|
|
|
|
+ if (now.getTime() > end) {
|
|
|
|
+ throw new BusinessException("允许开考的时间已结束");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (now.getTime() > end) {
|
|
throw new BusinessException("允许开考的时间已结束");
|
|
throw new BusinessException("允许开考的时间已结束");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
Long paperId = ExamRecordCacheUtil.getPaperId(recordId);
|
|
Long paperId = ExamRecordCacheUtil.getPaperId(recordId);
|
|
ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(paperId);
|
|
ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(paperId);
|
|
@@ -658,21 +602,21 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
answerCache.setDurationSeconds(durationSeconds);
|
|
answerCache.setDurationSeconds(durationSeconds);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Integer hasAnswerFile=ExamRecordCacheUtil.getHasAnswerFile(recordId);
|
|
|
|
- if(hasAnswerFile.intValue()==1) {
|
|
|
|
- // 每次提交,清空得分
|
|
|
|
- answerCache.setScore(null);
|
|
|
|
|
|
+ Integer hasAnswerFile = Objects.nonNull(ExamRecordCacheUtil.getHasAnswerFile(recordId)) ? ExamRecordCacheUtil.getHasAnswerFile(recordId) : 0;
|
|
|
|
+ if (hasAnswerFile.intValue() == 1) {
|
|
|
|
+ // 每次提交,清空得分
|
|
|
|
+ answerCache.setScore(null);
|
|
}
|
|
}
|
|
// 更新考生作答
|
|
// 更新考生作答
|
|
redisUtil.set(RedisKeyHelper.examAnswerKey(recordId),
|
|
redisUtil.set(RedisKeyHelper.examAnswerKey(recordId),
|
|
RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex), answerCache);
|
|
RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex), answerCache);
|
|
- if(hasAnswerFile.intValue()==1) {
|
|
|
|
- // 如果是客观题,重置考试记录客观题得分
|
|
|
|
- if (answerCache.getObjective()) {
|
|
|
|
- ExamRecordCacheUtil.setObjectiveScore(recordId, null, false);
|
|
|
|
- // 发消息计算客观分
|
|
|
|
- calculateObjectiveScore(recordId, mainNumber, subNumber, subIndex);
|
|
|
|
- }
|
|
|
|
|
|
+ if (hasAnswerFile.intValue() == 1) {
|
|
|
|
+ // 如果是客观题,重置考试记录客观题得分
|
|
|
|
+ if (answerCache.getObjective()) {
|
|
|
|
+ ExamRecordCacheUtil.setObjectiveScore(recordId, null, false);
|
|
|
|
+ // 发消息计算客观分
|
|
|
|
+ calculateObjectiveScore(recordId, mainNumber, subNumber, subIndex);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
AnswerSubmitBean ret = new AnswerSubmitBean();
|
|
AnswerSubmitBean ret = new AnswerSubmitBean();
|
|
@@ -818,7 +762,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
Long examId = ExamRecordCacheUtil.getExamId(recordId);
|
|
ExamCacheBean ec = getExamCacheBeanNative(examId);//考试缓存
|
|
ExamCacheBean ec = getExamCacheBeanNative(examId);//考试缓存
|
|
-
|
|
|
|
|
|
+
|
|
checkIp(ec);
|
|
checkIp(ec);
|
|
|
|
|
|
Long paperId = ExamRecordCacheUtil.getPaperId(recordId);
|
|
Long paperId = ExamRecordCacheUtil.getPaperId(recordId);
|
|
@@ -925,6 +869,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
});
|
|
});
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 结束考试
|
|
* 结束考试
|
|
*/
|
|
*/
|
|
@@ -933,28 +878,28 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
String lockKey = SystemConstant.REDIS_LOCK_FINISH_EXXAM_PREFIX + recordId;
|
|
String lockKey = SystemConstant.REDIS_LOCK_FINISH_EXXAM_PREFIX + recordId;
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
if (!lock) {
|
|
if (!lock) {
|
|
- Date now = new Date();
|
|
|
|
|
|
+ Date now = new Date();
|
|
ExamFinishBean ret = new ExamFinishBean();
|
|
ExamFinishBean ret = new ExamFinishBean();
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
- return ret;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
- return diposeFinish(studentId, recordId, type, durationSeconds);
|
|
|
|
|
|
+ return diposeFinish(studentId, recordId, type, durationSeconds);
|
|
} finally {
|
|
} finally {
|
|
redisUtil.releaseLock(lockKey);
|
|
redisUtil.releaseLock(lockKey);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private ExamFinishBean diposeFinish(Long studentId, Long recordId, String type, Integer durationSeconds) {
|
|
private ExamFinishBean diposeFinish(Long studentId, Long recordId, String type, Integer durationSeconds) {
|
|
- Date now = new Date();
|
|
|
|
|
|
+ Date now = new Date();
|
|
ExamFinishBean ret = new ExamFinishBean();
|
|
ExamFinishBean ret = new ExamFinishBean();
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setFinishTime(now.getTime());
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
- if (ExamRecordCacheUtil.getId(recordId) == null||examStudentId==null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
- return ret;
|
|
|
|
|
|
+ if (ExamRecordCacheUtil.getId(recordId) == null || examStudentId == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
// 校验当前登录用户和参数一致性
|
|
// 校验当前登录用户和参数一致性
|
|
ExamStudentCacheBean es = (ExamStudentCacheBean) redisUtil
|
|
ExamStudentCacheBean es = (ExamStudentCacheBean) redisUtil
|
|
@@ -965,55 +910,54 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
if (!studentId.equals(es.getStudentId())) {
|
|
if (!studentId.equals(es.getStudentId())) {
|
|
throw new BusinessException("考试记录的学生Id和当前登录用户不一致");
|
|
throw new BusinessException("考试记录的学生Id和当前登录用户不一致");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
ExamCacheBean exam = getExamCacheBeanNative(es.getExamId());
|
|
ExamCacheBean exam = getExamCacheBeanNative(es.getExamId());
|
|
ExamRecordStatusEnum sta = ExamRecordCacheUtil.getStatus(recordId);
|
|
ExamRecordStatusEnum sta = ExamRecordCacheUtil.getStatus(recordId);
|
|
if (ExamRecordStatusEnum.FINISHED.equals(sta) || ExamRecordStatusEnum.PERSISTED.equals(sta)) {
|
|
if (ExamRecordStatusEnum.FINISHED.equals(sta) || ExamRecordStatusEnum.PERSISTED.equals(sta)) {
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
- return ret;
|
|
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//页面结果
|
|
//页面结果
|
|
- Integer hasAnswerFile=ExamRecordCacheUtil.getHasAnswerFile(recordId);
|
|
|
|
- if(hasAnswerFile.intValue()==1) {
|
|
|
|
- if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
|
|
- if (InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
- Integer warningCount = ExamRecordCacheUtil.getWarningCount(recordId);
|
|
|
|
- Integer breachStatus = Objects.isNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? 1 : ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
|
|
- if (warningCount != null && warningCount.intValue() > 0) {//有预警
|
|
|
|
- if (breachStatus == null) {//无违纪结果
|
|
|
|
- ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
- } else if (breachStatus.intValue() == 0) {//违纪结果是false
|
|
|
|
- ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
- if (ret.getObjectiveScore() == null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
- } else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
- }
|
|
|
|
- } else if (breachStatus.intValue() == 1) {//违纪结果是true
|
|
|
|
- ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
- ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (Objects.nonNull(exam.getInvigilateVerify()) && exam.getInvigilateVerify().equals(InvigilateVerifyEnum.NOW)) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
- } else if (Objects.nonNull(exam.getInvigilateVerify()) && exam.getInvigilateVerify().equals(InvigilateVerifyEnum.LATER)) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (ret.getObjectiveScore() == null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
- } else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {//非实时出分
|
|
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
|
|
+ Integer hasAnswerFile = Objects.nonNull(ExamRecordCacheUtil.getHasAnswerFile(recordId)) ? ExamRecordCacheUtil.getHasAnswerFile(recordId) : 0;
|
|
|
|
+ if (hasAnswerFile.intValue() == 1) {
|
|
|
|
+ if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
|
|
+ if (InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
+ Integer warningCount = ExamRecordCacheUtil.getWarningCount(recordId);
|
|
|
|
+ Integer breachStatus = Objects.isNull(ExamRecordCacheUtil.getBreachStatus(recordId)) ? 1 : ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
|
|
+ if (warningCount != null && warningCount.intValue() > 0) {//有预警
|
|
|
|
+ if (breachStatus == null) {//无违纪结果
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
+ } else if (breachStatus.intValue() == 0) {//违纪结果是false
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ } else if (breachStatus.intValue() == 1) {//违纪结果是true
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (Objects.nonNull(exam.getInvigilateVerify()) && exam.getInvigilateVerify().equals(InvigilateVerifyEnum.NOW)) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
+ } else if (Objects.nonNull(exam.getInvigilateVerify()) && exam.getInvigilateVerify().equals(InvigilateVerifyEnum.LATER)) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {//非实时出分
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
}
|
|
}
|
|
Long finishTime = System.currentTimeMillis();
|
|
Long finishTime = System.currentTimeMillis();
|
|
ExamRecordCacheUtil.setFinishTime(recordId, finishTime, false);
|
|
ExamRecordCacheUtil.setFinishTime(recordId, finishTime, false);
|
|
@@ -1127,41 +1071,41 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
ret.setObjectiveScore(ExamRecordCacheUtil.getObjectiveScore(recordId));
|
|
warningCount = ExamRecordCacheUtil.getWarningCount(recordId);
|
|
warningCount = ExamRecordCacheUtil.getWarningCount(recordId);
|
|
breachStatus = ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
breachStatus = ExamRecordCacheUtil.getBreachStatus(recordId);
|
|
- hasAnswerFile=ExamRecordCacheUtil.getHasAnswerFile(recordId);
|
|
|
|
|
|
+ hasAnswerFile = Objects.nonNull(ExamRecordCacheUtil.getHasAnswerFile(recordId)) ? ExamRecordCacheUtil.getHasAnswerFile(recordId) : 0;
|
|
}
|
|
}
|
|
|
|
|
|
//页面结果
|
|
//页面结果
|
|
- if(hasAnswerFile.intValue()==1) {
|
|
|
|
- ExamCacheBean exam = getExamCacheBeanNative(er.getExamId());
|
|
|
|
- if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
|
|
- if (InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
- if (warningCount != null && warningCount.intValue() > 0) {//有预警
|
|
|
|
- if (breachStatus == null) {//无违纪结果
|
|
|
|
- ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
- } else if (breachStatus.intValue() == 0) {//违纪结果是false
|
|
|
|
- ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
- if (ret.getObjectiveScore() == null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
- } else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
- }
|
|
|
|
- } else if (breachStatus.intValue() == 1) {//违纪结果是true
|
|
|
|
- ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
- ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (ret.getObjectiveScore() == null) {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
- } else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {//非实时出分
|
|
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
|
|
+ if (hasAnswerFile.intValue() == 1) {
|
|
|
|
+ ExamCacheBean exam = getExamCacheBeanNative(er.getExamId());
|
|
|
|
+ if (exam.getShowObjectiveScore() != null && exam.getShowObjectiveScore().intValue() == 1) {//实时出分
|
|
|
|
+ if (InvigilateVerifyEnum.NOW.equals(exam.getInvigilateVerify())) {//实时审核
|
|
|
|
+ if (warningCount != null && warningCount.intValue() > 0) {//有预警
|
|
|
|
+ if (breachStatus == null) {//无违纪结果
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.AUDITING);
|
|
|
|
+ } else if (breachStatus.intValue() == 0) {//违纪结果是false
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.PASS);
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ } else if (breachStatus.intValue() == 1) {//违纪结果是true
|
|
|
|
+ ret.setReviewResult(ReviewResultEnum.UN_PASS);
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.BREACH);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (ret.getObjectiveScore() == null) {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_CALCULATE);
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.SCORE_VIEW);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {//非实时出分
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ret.setStatus(FinishExamResultEnum.NORMAL);
|
|
}
|
|
}
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -1307,10 +1251,10 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
Double tem = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
Double tem = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
return tem;
|
|
return tem;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public void updateInvigilateMonitorStatus(InvigilateMonitorStatusEnum monitorStatus,Long examId) {
|
|
|
|
- teExamMapper.updateInvigilateMonitorStatus(monitorStatus,examId);
|
|
|
|
|
|
+ public void updateInvigilateMonitorStatus(InvigilateMonitorStatusEnum monitorStatus, Long examId) {
|
|
|
|
+ teExamMapper.updateInvigilateMonitorStatus(monitorStatus, examId);
|
|
}
|
|
}
|
|
}
|
|
}
|