|
@@ -1,12 +1,49 @@
|
|
|
package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.apache.commons.codec.digest.DigestUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+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.extension.service.impl.ServiceImpl;
|
|
|
-import com.qmth.themis.business.bean.exam.*;
|
|
|
+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.cache.ExamActivityRecordCacheUtil;
|
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
-import com.qmth.themis.business.cache.bean.*;
|
|
|
+import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
|
+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.config.SystemConfig;
|
|
|
import com.qmth.themis.business.dao.TEExamMapper;
|
|
|
import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
@@ -17,24 +54,15 @@ import com.qmth.themis.business.entity.TEExam;
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
-import com.qmth.themis.business.service.*;
|
|
|
+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.OssUtil;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
-import com.qmth.themis.business.util.ServletUtil;
|
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
|
-import org.apache.commons.codec.digest.DigestUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-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.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Description: 考试批次 服务实现类
|
|
@@ -303,7 +331,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
* 上传个人试卷结构
|
|
|
*/
|
|
|
@Override
|
|
|
- public Long studentPaperStruct(Long studentId, Long recordId, String content) {
|
|
|
+ public StudentPaperStructBean studentPaperStruct(Long studentId, Long recordId, String content) {
|
|
|
|
|
|
// 校验当前登录用户和参数一致性
|
|
|
if (ExamRecordCacheUtil.getId(recordId) == null) {
|
|
@@ -324,14 +352,16 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
struct.setTime(System.currentTimeMillis());
|
|
|
// 更新考生试卷结构
|
|
|
redisUtil.set(RedisKeyHelper.studentPaperStructKey(recordId), struct);
|
|
|
- return struct.getTime();
|
|
|
+ StudentPaperStructBean ret=new StudentPaperStructBean();
|
|
|
+ ret.setUpdateTime(struct.getTime());
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提交作答结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public Long answerSubmit(Long studentId, Long recordId, Integer mainNumber, Integer subNumber, Integer subIndex,
|
|
|
+ public AnswerSubmitBean answerSubmit(Long studentId, Long recordId, Integer mainNumber, Integer subNumber, Integer subIndex,
|
|
|
String answer, Long version, Integer durationSeconds) {
|
|
|
|
|
|
// 校验当前登录用户和参数一致性
|
|
@@ -374,14 +404,16 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex), answerCache);
|
|
|
// 重置考试记录客观题得分
|
|
|
ExamRecordCacheUtil.setObjectiveScore(recordId, null);
|
|
|
- return version;
|
|
|
+ AnswerSubmitBean ret=new AnswerSubmitBean();
|
|
|
+ ret.setVersion(version);
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新音频剩余播放次数
|
|
|
*/
|
|
|
@Override
|
|
|
- public Integer audioLeftPlayCountSubmit(Long studentId, Long recordId, String key, Integer count) {
|
|
|
+ public AudioLeftPlayCountSubmitBean audioLeftPlayCountSubmit(Long studentId, Long recordId, String key, Integer count) {
|
|
|
|
|
|
// 校验当前登录用户和参数一致性
|
|
|
if (ExamRecordCacheUtil.getId(recordId) == null) {
|
|
@@ -399,8 +431,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
|
|
|
// 音频剩余播放次数缓存
|
|
|
redisUtil.set(RedisKeyHelper.audioLeftPlayCountKey(recordId), key, count);
|
|
|
-
|
|
|
- return count;
|
|
|
+ AudioLeftPlayCountSubmitBean ret=new AudioLeftPlayCountSubmitBean();
|
|
|
+ ret.setCount(count);
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|