|
@@ -9,6 +9,7 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.*;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.cache.ExamStudentCache;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
|
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
@@ -80,7 +81,8 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
private ExamRecordDataSyncRepo examRecordDataSyncRepo;
|
|
|
@Autowired
|
|
|
private ExamScoreRepo examScoreRepo;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ExamStudentCache examStudentCache;
|
|
|
|
|
|
/**
|
|
|
* 同步考试记录数据
|
|
@@ -151,7 +153,8 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
}
|
|
|
|
|
|
//同步后续处理
|
|
|
- processAfterSyncExamData(realExamRecordDataId, examScoreId,transitionExamRecordData.getObjectiveScore());
|
|
|
+ processAfterSyncExamData(realExamRecordDataId, examScoreId, transitionExamRecordData.getObjectiveScore(),
|
|
|
+ transitionExamRecordData.getExamStudentId());
|
|
|
|
|
|
return new SyncExamDataResp();
|
|
|
}
|
|
@@ -181,6 +184,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
* @param examStudentId
|
|
|
*/
|
|
|
private void increaseUsedExamTimes(Long examStudentId) {
|
|
|
+ //更新数据库中的已考次数
|
|
|
ExamStudentEntity examStudentEntity = examStudentRepo.findByExamStudentId(examStudentId);
|
|
|
if (null == examStudentEntity) {
|
|
|
throw new StatusException("100101", "考生id不正确");
|
|
@@ -193,7 +197,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
examStudentEntity.setUsedNum(usedTimes + 1);
|
|
|
|
|
|
examStudentRepo.saveAndFlush(examStudentEntity);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -568,15 +571,19 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
* @param realExamRecordDataId
|
|
|
* @param examScoreId
|
|
|
*/
|
|
|
- private void processAfterSyncExamData(Long realExamRecordDataId, Long examScoreId, Double objectiveScore) {
|
|
|
+ private void processAfterSyncExamData(Long realExamRecordDataId, Long examScoreId, Double objectiveScore,
|
|
|
+ Long examStudentId) {
|
|
|
// 保存阅卷相关数据
|
|
|
- examRecordForMarkingService.saveExamRecordForMarking(realExamRecordDataId,objectiveScore);
|
|
|
+ examRecordForMarkingService.saveExamRecordForMarking(realExamRecordDataId, objectiveScore);
|
|
|
|
|
|
// 保存考试分数数据到推分队列
|
|
|
examScorePushQueueService.saveScoreDataInfoToQueue(realExamRecordDataId, examScoreId);
|
|
|
|
|
|
// 保存考试分数数据到分数获取队列
|
|
|
examScoreObtainQueueService.saveExamScoreObtainQueue(realExamRecordDataId);
|
|
|
+
|
|
|
+ //刷新考生的缓存
|
|
|
+ examStudentCache.refresh(examStudentId);
|
|
|
}
|
|
|
|
|
|
}
|