|
@@ -2,13 +2,18 @@ package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
|
+import com.qmth.themis.business.cache.ExamingDataCacheUtil;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.MqDto;
|
|
|
+import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
|
import com.qmth.themis.business.entity.TOeExamBreakHistory;
|
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
import com.qmth.themis.business.enums.MqTagEnum;
|
|
|
-import com.qmth.themis.business.service.*;
|
|
|
+import com.qmth.themis.business.service.CommonService;
|
|
|
+import com.qmth.themis.business.service.MqDtoService;
|
|
|
+import com.qmth.themis.business.service.TOeExamBreakHistoryService;
|
|
|
+import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
import com.qmth.themis.business.util.MqUtil;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
import org.slf4j.Logger;
|
|
@@ -16,7 +21,6 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
@@ -46,7 +50,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
TOeExamBreakHistoryService tOeExamBreakHistoryService;
|
|
|
|
|
|
@Override
|
|
|
- public void persisted(Long recordId) {
|
|
|
+ public void persisted(Long recordId, Long studentId) {
|
|
|
String lockKey = SystemConstant.REDIS_LOCK_EXAM_RECORD_PERSISTED_PREFIX + recordId;
|
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
|
if (!lock) {
|
|
@@ -66,8 +70,9 @@ public class CommonServiceImpl implements CommonService {
|
|
|
//算分未完成的 发送10秒延迟消息
|
|
|
Map<String, Object> propMap = mqDtoService.buildMqDelayMsg("10s");
|
|
|
propMap.put(SystemConstant.RECORD_ID, recordId);
|
|
|
+ propMap.put(SystemConstant.STUDENT_ID, studentId);
|
|
|
MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_RECORD_PERSISTED.name(),
|
|
|
- Collections.singletonMap(SystemConstant.RECORD_ID, recordId), MqTagEnum.EXAM_RECORD_PERSISTED, recordId.toString(), propMap, recordId.toString());
|
|
|
+ propMap, MqTagEnum.EXAM_RECORD_PERSISTED, recordId.toString(), propMap, recordId.toString());
|
|
|
mqDtoService.assembleSendAsyncDelayMsg(mqDto);
|
|
|
return;
|
|
|
}
|
|
@@ -86,6 +91,12 @@ public class CommonServiceImpl implements CommonService {
|
|
|
redisUtil.delete(RedisKeyHelper.faceVerifyCacheKey(recordId));
|
|
|
//2021-03-01新增
|
|
|
redisUtil.delete(RedisKeyHelper.studentPaperStructKey(recordId));
|
|
|
+ TEStudentCacheDto teStudentCacheDto = ExamingDataCacheUtil.getStudentExaming(studentId);
|
|
|
+ if (Objects.nonNull(teStudentCacheDto)) {
|
|
|
+ teStudentCacheDto.setExamingRecordId(null);
|
|
|
+ ExamingDataCacheUtil.setStudentExaming(studentId, teStudentCacheDto);
|
|
|
+ }
|
|
|
+
|
|
|
// redisUtil.delete(RedisKeyHelper.examStudentCacheKey(examStudentId));
|
|
|
//先查询之前的断点记录
|
|
|
QueryWrapper<TOeExamBreakHistory> tOeExamBreakHistoryQueryWrapper = new QueryWrapper<>();
|