|
@@ -3,6 +3,7 @@ package com.qmth.themis.business.service.impl;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.aliyun.oss.common.utils.BinaryUtil;
|
|
import com.aliyun.oss.common.utils.BinaryUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
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;
|
|
@@ -226,8 +227,14 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_ENABLE);
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_ENABLE);
|
|
}
|
|
}
|
|
checkIp(examCache);
|
|
checkIp(examCache);
|
|
-
|
|
|
|
- Long unFinishedRecordId = Objects.nonNull(ExamingDataCacheUtil.getUnFinishedRecordId(studentId)) ? ExamingDataCacheUtil.getUnFinishedRecordId(studentId) : null;
|
|
|
|
|
|
+ Long activityId = es.getExamActivityId();
|
|
|
|
+ Long examId = es.getExamId();
|
|
|
|
+ QueryWrapper<TOeExamRecord> tOeExamRecordQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tOeExamRecordQueryWrapper.lambda().eq(TOeExamRecord::getExamId, examId)
|
|
|
|
+ .eq(TOeExamRecord::getExamActivityId, activityId)
|
|
|
|
+ .eq(TOeExamRecord::getExamStudentId, examStudentId);
|
|
|
|
+ TOeExamRecord tOeExamRecord = toeExamRecordService.getOne(tOeExamRecordQueryWrapper);
|
|
|
|
+ Long unFinishedRecordId = Objects.nonNull(tOeExamRecord) ? tOeExamRecord.getId() : null;
|
|
if (Objects.nonNull(unFinishedRecordId)) {
|
|
if (Objects.nonNull(unFinishedRecordId)) {
|
|
Long recordId = unFinishedRecordId;
|
|
Long recordId = unFinishedRecordId;
|
|
if (examStudentId.equals(ExamRecordCacheUtil.getExamStudentId(recordId))) {//当前考生已存在候考的考试记录
|
|
if (examStudentId.equals(ExamRecordCacheUtil.getExamStudentId(recordId))) {//当前考生已存在候考的考试记录
|
|
@@ -258,7 +265,6 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
if (examCache.getExamCount().intValue() <= es.getAlreadyExamCount().intValue()) {
|
|
if (examCache.getExamCount().intValue() <= es.getAlreadyExamCount().intValue()) {
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_LEFT_COUNT_IS_ZERO);
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_LEFT_COUNT_IS_ZERO);
|
|
}
|
|
}
|
|
- Long activityId = es.getExamActivityId();
|
|
|
|
ExamActivityCacheBean ac = teExamActivityService.getExamActivityCacheBean(activityId);
|
|
ExamActivityCacheBean ac = teExamActivityService.getExamActivityCacheBean(activityId);
|
|
if (ac == null) {
|
|
if (ac == null) {
|
|
throw new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_ACTIVITY);
|
|
throw new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_ACTIVITY);
|
|
@@ -322,7 +328,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
redisUtil.set(RedisKeyHelper.examStudentCacheKey(examStudentId), es);
|
|
redisUtil.set(RedisKeyHelper.examStudentCacheKey(examStudentId), es);
|
|
//更新场次-考试记录缓存
|
|
//更新场次-考试记录缓存
|
|
// ExamActivityRecordCacheUtil.setExamRecordStatus(activityId, recordId);
|
|
// ExamActivityRecordCacheUtil.setExamRecordStatus(activityId, recordId);
|
|
- ExamingDataCacheUtil.setUnFinishedRecordId(studentId, recordId);
|
|
|
|
|
|
+// ExamingDataCacheUtil.setUnFinishedRecordId(studentId, recordId);
|
|
//mq发送消息start
|
|
//mq发送消息start
|
|
// TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(studentId);
|
|
// TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(studentId);
|
|
// MqDto mqDto = new MqDto(MqTopicEnum.THEMIS_TOPIC.getCode(), MqTagEnum.STUDENT.name(), SystemOperationEnum.FIRST_PREPARE, MqTagEnum.STUDENT, String.valueOf(teStudentCacheDto.getId()), teStudentCacheDto.getIdentity());
|
|
// MqDto mqDto = new MqDto(MqTopicEnum.THEMIS_TOPIC.getCode(), MqTagEnum.STUDENT.name(), SystemOperationEnum.FIRST_PREPARE, MqTagEnum.STUDENT, String.valueOf(teStudentCacheDto.getId()), teStudentCacheDto.getIdentity());
|