|
@@ -132,70 +132,56 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
|
|
|
/**
|
|
/**
|
|
* 同步考试记录数据
|
|
* 同步考试记录数据
|
|
- *
|
|
|
|
- * @param req
|
|
|
|
- * @return
|
|
|
|
*/
|
|
*/
|
|
@ApiOperation(value = "同步考试记录相关数据")
|
|
@ApiOperation(value = "同步考试记录相关数据")
|
|
@PostMapping("/syncExamData")
|
|
@PostMapping("/syncExamData")
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public SyncExamDataResp syncExamData(@RequestBody SyncExamDataReq req) {
|
|
public SyncExamDataResp syncExamData(@RequestBody SyncExamDataReq req) {
|
|
-
|
|
|
|
- long st = System.currentTimeMillis();
|
|
|
|
-
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
|
- Long transitionExamRecordDataId = req.getExamRecordData().getId();
|
|
|
|
|
|
+ //临时考试记录
|
|
|
|
+ ExamRecordDataBean tempExamRecordData = req.getExamRecordData();
|
|
|
|
|
|
//校验考试记录是否已同步,如果已同步,则直接返回
|
|
//校验考试记录是否已同步,如果已同步,则直接返回
|
|
- if (hasSynced(transitionExamRecordDataId)) {
|
|
|
|
|
|
+ if (hasSynced(tempExamRecordData.getId())) {
|
|
return new SyncExamDataResp();
|
|
return new SyncExamDataResp();
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("1 校验考试记录是否已同步", transitionExamRecordDataId, startTime);
|
|
|
|
|
|
+ Long tempExamRecordDataId = tempExamRecordData.getId();
|
|
|
|
+ Long examStudentId = tempExamRecordData.getExamStudentId();
|
|
|
|
+ Long studentId = tempExamRecordData.getStudentId();
|
|
|
|
+ Long examId = tempExamRecordData.getExamId();
|
|
|
|
+ Long rootOrgId = tempExamRecordData.getRootOrgId();
|
|
|
|
|
|
- //临时考试记录
|
|
|
|
- ExamRecordDataBean transitionExamRecordData = req.getExamRecordData();
|
|
|
|
-
|
|
|
|
- //必须先更新考生的考试次数,同步考试记录会用
|
|
|
|
- Long examStudentId = transitionExamRecordData.getExamStudentId();
|
|
|
|
|
|
+ //先更新考生的考试次数
|
|
updateExamStudent(examStudentId);
|
|
updateExamStudent(examStudentId);
|
|
|
|
|
|
- startTime = this.debugCost("2 更新考生考试次数", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步考试记录,并返回真实的考试记录id
|
|
//同步考试记录,并返回真实的考试记录id
|
|
- Long realExamRecordDataId = syncExamRecordData(transitionExamRecordData);
|
|
|
|
|
|
+ Long realExamRecordDataId = syncExamRecordData(tempExamRecordData);
|
|
|
|
+
|
|
|
|
+ //添加同步记录
|
|
|
|
+ addExamRecordDataSync(tempExamRecordDataId, realExamRecordDataId);
|
|
|
|
|
|
// 违纪-非法考生端应用
|
|
// 违纪-非法考生端应用
|
|
- String reason = redisClient.get(CacheConstants.CACHE_OE_DISCIPLINE_ILLEGAL_CLIENT + transitionExamRecordDataId, String.class);
|
|
|
|
|
|
+ String reason = redisClient.get(CacheConstants.CACHE_OE_DISCIPLINE_ILLEGAL_CLIENT + tempExamRecordDataId, String.class);
|
|
if (StringUtils.isNotEmpty(reason)) {
|
|
if (StringUtils.isNotEmpty(reason)) {
|
|
examAuditService.saveExamAuditForIllegalClient(realExamRecordDataId, reason);
|
|
examAuditService.saveExamAuditForIllegalClient(realExamRecordDataId, reason);
|
|
}
|
|
}
|
|
|
|
|
|
//header校验错误
|
|
//header校验错误
|
|
- Boolean hasWarn = redisClient.get(CacheConstants.CACHE_OE_DISCIPLINE_ILLEGAL_DATA + transitionExamRecordDataId, Boolean.class);
|
|
|
|
|
|
+ Boolean hasWarn = redisClient.get(CacheConstants.CACHE_OE_DISCIPLINE_ILLEGAL_DATA + tempExamRecordDataId, Boolean.class);
|
|
if (hasWarn != null && hasWarn) {
|
|
if (hasWarn != null && hasWarn) {
|
|
examAuditService.saveHeaderWarnAudit(realExamRecordDataId);
|
|
examAuditService.saveHeaderWarnAudit(realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
//切屏次数超限
|
|
//切屏次数超限
|
|
- if (transitionExamRecordData.getExceedMaxSwitchScreenCount() != null && transitionExamRecordData.getExceedMaxSwitchScreenCount()) {
|
|
|
|
|
|
+ if (tempExamRecordData.getExceedMaxSwitchScreenCount() != null && tempExamRecordData.getExceedMaxSwitchScreenCount()) {
|
|
examAuditService.saveExceedMaxSwitchScreenCount(realExamRecordDataId);
|
|
examAuditService.saveExceedMaxSwitchScreenCount(realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("3 同步考试记录表", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
- //添加同步记录
|
|
|
|
- addExamRecordDataSync(transitionExamRecordData.getId(), realExamRecordDataId);
|
|
|
|
-
|
|
|
|
- startTime = this.debugCost("4 添加同步关系表", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步考试分数表
|
|
//同步考试分数表
|
|
- Long examScoreId = syncExamScore(transitionExamRecordData, realExamRecordDataId);
|
|
|
|
-
|
|
|
|
- startTime = this.debugCost("5 同步考试分数表", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
|
|
+ Long examScoreId = syncExamScore(tempExamRecordData, realExamRecordDataId);
|
|
|
|
|
|
//同步断点续考记录表
|
|
//同步断点续考记录表
|
|
if (null != req.getExamContinuedRecords() && !req.getExamContinuedRecords().isEmpty()) {
|
|
if (null != req.getExamContinuedRecords() && !req.getExamContinuedRecords().isEmpty()) {
|
|
@@ -212,82 +198,84 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
syncExamSyncCapture(req.getExamSyncCapture(), realExamRecordDataId);
|
|
syncExamSyncCapture(req.getExamSyncCapture(), realExamRecordDataId);
|
|
} else {
|
|
} else {
|
|
//且开启摄像头
|
|
//且开启摄像头
|
|
- if (FaceBiopsyHelper.isFaceEnable(transitionExamRecordData.getRootOrgId()
|
|
|
|
- , transitionExamRecordData.getExamId(), transitionExamRecordData.getStudentId())) {
|
|
|
|
|
|
+ if (FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId)) {
|
|
examAuditService.saveHeaderWarnAudit(realExamRecordDataId);
|
|
examAuditService.saveHeaderWarnAudit(realExamRecordDataId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("6 同步抓拍照片结果(同步抓拍的数据)", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步抓拍照片结果(异步抓拍的数据)
|
|
//同步抓拍照片结果(异步抓拍的数据)
|
|
if (null != req.getExamCaptures()) {
|
|
if (null != req.getExamCaptures()) {
|
|
-
|
|
|
|
syncExamCapture(req.getExamCaptures(), realExamRecordDataId);
|
|
syncExamCapture(req.getExamCaptures(), realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("7 同步抓拍照片结果(异步抓拍的数据)", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步face id活体检测数据
|
|
//同步face id活体检测数据
|
|
if (null != req.getExamFaceLivenessVerifies()) {
|
|
if (null != req.getExamFaceLivenessVerifies()) {
|
|
-
|
|
|
|
syncExamFaceLivenessVerify(req.getExamFaceLivenessVerifies(), realExamRecordDataId);
|
|
syncExamFaceLivenessVerify(req.getExamFaceLivenessVerifies(), realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("8 同步face id活体检测数据", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步新活检
|
|
//同步新活检
|
|
if (null != req.getFaceBiopsy()) {
|
|
if (null != req.getFaceBiopsy()) {
|
|
-
|
|
|
|
syncFaceBiopsy(req.getFaceBiopsy(), realExamRecordDataId);
|
|
syncFaceBiopsy(req.getFaceBiopsy(), realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
//同步C端活体检测记录
|
|
//同步C端活体检测记录
|
|
syncFaceLiveVerifyRecords(req.getFaceLiveVerifyRecords(), realExamRecordDataId);
|
|
syncFaceLiveVerifyRecords(req.getFaceLiveVerifyRecords(), realExamRecordDataId);
|
|
|
|
|
|
- startTime = this.debugCost("9 同步face id活体检测数据", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步考试记录对应的试卷结构
|
|
//同步考试记录对应的试卷结构
|
|
syncExamRecordPaperStruct(req.getExamRecordPaperStruct(), realExamRecordDataId);
|
|
syncExamRecordPaperStruct(req.getExamRecordPaperStruct(), realExamRecordDataId);
|
|
|
|
|
|
- startTime = this.debugCost("10 同步考试记录对应的试卷结构", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//同步作答记录
|
|
//同步作答记录
|
|
syncExamRecordQuestions(req.getExamRecordQuestions(), realExamRecordDataId);
|
|
syncExamRecordQuestions(req.getExamRecordQuestions(), realExamRecordDataId);
|
|
|
|
|
|
- startTime = this.debugCost("11 同步作答记录", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//如果开启了活检
|
|
//如果开启了活检
|
|
- if (FaceBiopsyHelper.isFaceEnable(transitionExamRecordData.getRootOrgId(), transitionExamRecordData.getExamId(), transitionExamRecordData.getStudentId())) {
|
|
|
|
|
|
+ if (FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId)) {
|
|
//计算违纪自动审核结果(无人脸或活检失败)
|
|
//计算违纪自动审核结果(无人脸或活检失败)
|
|
boolean isNoPhotoAndIllegality = (null == req.getExamCaptures() || req.getExamCaptures().isEmpty());//是否无照片
|
|
boolean isNoPhotoAndIllegality = (null == req.getExamCaptures() || req.getExamCaptures().isEmpty());//是否无照片
|
|
- saveAutoAudit(transitionExamRecordData, isNoPhotoAndIllegality, realExamRecordDataId);
|
|
|
|
|
|
+ saveAutoAudit(tempExamRecordData, isNoPhotoAndIllegality, realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("12 如果开启了活检,计算违纪自动审核结果", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
//若开启审核全通过
|
|
//若开启审核全通过
|
|
- auditPassExamRecordData(transitionExamRecordData.getExamId(), realExamRecordDataId);
|
|
|
|
|
|
+ auditPassExamRecordData(examId, realExamRecordDataId);
|
|
|
|
|
|
//***************这个步骤必须放在最后,所有改变违纪、警告、审核状态的操作之后********************************
|
|
//***************这个步骤必须放在最后,所有改变违纪、警告、审核状态的操作之后********************************
|
|
//计算最终分数
|
|
//计算最终分数
|
|
- String examType = ExamCacheTransferHelper.getDefaultCachedExam(transitionExamRecordData.getExamId()).getExamType();
|
|
|
|
|
|
+ String examType = ExamCacheTransferHelper.getDefaultCachedExam(examId).getExamType();
|
|
if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)
|
|
if (ExamType.ONLINE.name().equals(examType) || ExamType.ONLINE_HOMEWORK.name().equals(examType)
|
|
|| ExamType.OFFLINE.name().equals(examType)) {
|
|
|| ExamType.OFFLINE.name().equals(examType)) {
|
|
examStudentFinalScoreService.calcAndSaveFinalScore(examStudentId);
|
|
examStudentFinalScoreService.calcAndSaveFinalScore(examStudentId);
|
|
}
|
|
}
|
|
|
|
|
|
- startTime = this.debugCost("13 计算最终考试分数", transitionExamRecordDataId, startTime);
|
|
|
|
|
|
+ LOG.warn("tempExamRecordDataId:{} realExamRecordDataId:{} cost:{}ms syncExamData ok...",
|
|
|
|
+ tempExamRecordDataId, realExamRecordDataId, System.currentTimeMillis() - startTime);
|
|
|
|
|
|
//同步后续处理
|
|
//同步后续处理
|
|
- processAfterSyncExamData(realExamRecordDataId, examScoreId, transitionExamRecordData.getObjectiveScore(),
|
|
|
|
- examStudentId, transitionExamRecordDataId);
|
|
|
|
|
|
+ processAfterSyncExamData(realExamRecordDataId, examScoreId, tempExamRecordData.getObjectiveScore(),
|
|
|
|
+ examStudentId, tempExamRecordDataId);
|
|
|
|
|
|
- this.debugCost("14 同步后续处理 - 共计", transitionExamRecordDataId, startTime);
|
|
|
|
|
|
+ return new SyncExamDataResp();
|
|
|
|
+ }
|
|
|
|
|
|
- this.debugCost("100 同步考试记录相关数据 - 共计", transitionExamRecordDataId, st);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 同步后的后续操作
|
|
|
|
+ */
|
|
|
|
+ private void processAfterSyncExamData(Long realExamRecordDataId, Long examScoreId, Double objectiveScore,
|
|
|
|
+ Long examStudentId, Long tempExamRecordDataId) {
|
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
|
|
|
- return new SyncExamDataResp();
|
|
|
|
|
|
+ // 保存阅卷相关数据
|
|
|
|
+ examRecordForMarkingService.saveExamRecordForMarking(realExamRecordDataId, objectiveScore);
|
|
|
|
+
|
|
|
|
+ // 保存考试分数数据到推分队列
|
|
|
|
+ examScorePushQueueService.saveScoreDataInfoToQueue(realExamRecordDataId, examScoreId);
|
|
|
|
+
|
|
|
|
+ // 保存考试分数数据到分数获取队列
|
|
|
|
+ examScoreObtainQueueService.saveExamScoreObtainQueue(realExamRecordDataId);
|
|
|
|
+
|
|
|
|
+ //刷新考生的缓存
|
|
|
|
+ examStudentCache.refresh(examStudentId);
|
|
|
|
+
|
|
|
|
+ LOG.warn("tempExamRecordDataId:{} realExamRecordDataId:{} cost:{}ms processAfterSyncExamData ok...",
|
|
|
|
+ tempExamRecordDataId, realExamRecordDataId, System.currentTimeMillis() - startTime);
|
|
}
|
|
}
|
|
|
|
|
|
private void auditPassExamRecordData(Long examId, Long realExamRecordDataId) {
|
|
private void auditPassExamRecordData(Long examId, Long realExamRecordDataId) {
|
|
@@ -310,7 +298,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
private void syncExamContinuedRecords(List<ExamContinuedRecordBean> examContinuedRecords, Long realExamRecordDataId) {
|
|
private void syncExamContinuedRecords(List<ExamContinuedRecordBean> examContinuedRecords, Long realExamRecordDataId) {
|
|
for (ExamContinuedRecordBean bean : examContinuedRecords) {
|
|
for (ExamContinuedRecordBean bean : examContinuedRecords) {
|
|
ExamContinuedRecordEntity entity = copyExamContinuedRecordFrom(bean, realExamRecordDataId);
|
|
ExamContinuedRecordEntity entity = copyExamContinuedRecordFrom(bean, realExamRecordDataId);
|
|
@@ -340,15 +327,12 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
examScoreEntity.setSuccPercent(transitionExamRecordData.getSuccPercent());
|
|
examScoreEntity.setSuccPercent(transitionExamRecordData.getSuccPercent());
|
|
|
|
|
|
ExamScoreEntity result = examScoreRepo.saveAndFlush(examScoreEntity);
|
|
ExamScoreEntity result = examScoreRepo.saveAndFlush(examScoreEntity);
|
|
-
|
|
|
|
return result.getId();
|
|
return result.getId();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 更新考生相关信息
|
|
* 更新考生相关信息
|
|
* 增加考试次数,修改考试状态为已完成
|
|
* 增加考试次数,修改考试状态为已完成
|
|
- *
|
|
|
|
- * @param examStudentId
|
|
|
|
*/
|
|
*/
|
|
private void updateExamStudent(Long examStudentId) {
|
|
private void updateExamStudent(Long examStudentId) {
|
|
//更新数据库中的已考次数
|
|
//更新数据库中的已考次数
|
|
@@ -357,10 +341,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
throw new StatusException("100101", "考生id不正确");
|
|
throw new StatusException("100101", "考生id不正确");
|
|
}
|
|
}
|
|
|
|
|
|
- Integer usedTimes = examStudentEntity.getUsedNum() == null
|
|
|
|
- ? 0
|
|
|
|
- : examStudentEntity.getUsedNum();
|
|
|
|
-
|
|
|
|
|
|
+ Integer usedTimes = examStudentEntity.getUsedNum() == null ? 0 : examStudentEntity.getUsedNum();
|
|
examStudentEntity.setUsedNum(usedTimes + 1);
|
|
examStudentEntity.setUsedNum(usedTimes + 1);
|
|
examStudentEntity.setFinished(true);
|
|
examStudentEntity.setFinished(true);
|
|
|
|
|
|
@@ -369,9 +350,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加考试记录的同步记录
|
|
* 添加考试记录的同步记录
|
|
- *
|
|
|
|
- * @param cacheId
|
|
|
|
- * @param dbId
|
|
|
|
*/
|
|
*/
|
|
private void addExamRecordDataSync(Long cacheId, Long dbId) {
|
|
private void addExamRecordDataSync(Long cacheId, Long dbId) {
|
|
ExamRecordDataSyncEntity entity = new ExamRecordDataSyncEntity();
|
|
ExamRecordDataSyncEntity entity = new ExamRecordDataSyncEntity();
|
|
@@ -383,9 +361,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
|
|
|
/**
|
|
/**
|
|
* 考试记录表是否已同步
|
|
* 考试记录表是否已同步
|
|
- *
|
|
|
|
- * @param cacheExamRecordDataId
|
|
|
|
- * @return
|
|
|
|
*/
|
|
*/
|
|
private boolean hasSynced(Long cacheExamRecordDataId) {
|
|
private boolean hasSynced(Long cacheExamRecordDataId) {
|
|
ExamRecordDataSyncEntity query = new ExamRecordDataSyncEntity();
|
|
ExamRecordDataSyncEntity query = new ExamRecordDataSyncEntity();
|
|
@@ -398,7 +373,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
ExamRecordDataEntity examRecordDataEntity = copyExamRecordDataEntityFrom(examRecordData);
|
|
ExamRecordDataEntity examRecordDataEntity = copyExamRecordDataEntityFrom(examRecordData);
|
|
|
|
|
|
ExamRecordDataEntity result = examRecordDataRepo.saveAndFlush(examRecordDataEntity);
|
|
ExamRecordDataEntity result = examRecordDataRepo.saveAndFlush(examRecordDataEntity);
|
|
-
|
|
|
|
return result.getId();
|
|
return result.getId();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -583,9 +557,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
questionEntity.setCorrectAnswer(questionBean.getCorrectAnswer());
|
|
questionEntity.setCorrectAnswer(questionBean.getCorrectAnswer());
|
|
questionEntity.setOptionPermutation(questionBean.getOptionPermutation());
|
|
questionEntity.setOptionPermutation(questionBean.getOptionPermutation());
|
|
questionEntity.setAudioPlayTimes(questionBean.getAudioPlayTimes());
|
|
questionEntity.setAudioPlayTimes(questionBean.getAudioPlayTimes());
|
|
-
|
|
|
|
if (null != questionBean.getAnswerType()) {
|
|
if (null != questionBean.getAnswerType()) {
|
|
-
|
|
|
|
questionEntity.setAnswerType(AnswerType.valueOf(questionBean.getAnswerType()));
|
|
questionEntity.setAnswerType(AnswerType.valueOf(questionBean.getAnswerType()));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -593,7 +565,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
}
|
|
}
|
|
|
|
|
|
entity.setExamQuestionEntities(examQuestionEntityList);
|
|
entity.setExamQuestionEntities(examQuestionEntityList);
|
|
-
|
|
|
|
return entity;
|
|
return entity;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -682,8 +653,9 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
return entity;
|
|
return entity;
|
|
}
|
|
}
|
|
|
|
|
|
- private List<FaceBiopsyItemStepEntity> copyFaceBiopsyItemStepFrom(List<FaceBiopsyItemStepBean> faceBiopsyItemSteps,
|
|
|
|
- Long faceBiopsyItemId, Long examRecordDataId) {
|
|
|
|
|
|
+ private List<FaceBiopsyItemStepEntity> copyFaceBiopsyItemStepFrom(
|
|
|
|
+ List<FaceBiopsyItemStepBean> faceBiopsyItemSteps,
|
|
|
|
+ Long faceBiopsyItemId, Long examRecordDataId) {
|
|
List<FaceBiopsyItemStepEntity> faceBiopsyItemStepEntityList = new ArrayList<>();
|
|
List<FaceBiopsyItemStepEntity> faceBiopsyItemStepEntityList = new ArrayList<>();
|
|
for (FaceBiopsyItemStepBean bean : faceBiopsyItemSteps) {
|
|
for (FaceBiopsyItemStepBean bean : faceBiopsyItemSteps) {
|
|
FaceBiopsyItemStepEntity entity = new FaceBiopsyItemStepEntity();
|
|
FaceBiopsyItemStepEntity entity = new FaceBiopsyItemStepEntity();
|
|
@@ -789,7 +761,9 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
} else {
|
|
} else {
|
|
ci.setVirtualCamera(false);
|
|
ci.setVirtualCamera(false);
|
|
}
|
|
}
|
|
- List<ExamCaptureCameraInfoEntity> olds = examCaptureCameraInfoRepo.findByExamRecordDataIdAndPidAndVidAndName(examCaptureEntity.getExamRecordDataId(), ci.getPid(), ci.getVid(), ci.getName());
|
|
|
|
|
|
+
|
|
|
|
+ List<ExamCaptureCameraInfoEntity> olds = examCaptureCameraInfoRepo.findByExamRecordDataIdAndPidAndVidAndName(
|
|
|
|
+ examCaptureEntity.getExamRecordDataId(), ci.getPid(), ci.getVid(), ci.getName());
|
|
if (CollectionUtils.isEmpty(olds)) {
|
|
if (CollectionUtils.isEmpty(olds)) {
|
|
examCaptureCameraInfoRepo.saveAndFlush(ci);
|
|
examCaptureCameraInfoRepo.saveAndFlush(ci);
|
|
} else {
|
|
} else {
|
|
@@ -857,45 +831,4 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
return entity;
|
|
return entity;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 同步后的后续操作
|
|
|
|
- *
|
|
|
|
- * @param realExamRecordDataId
|
|
|
|
- * @param examScoreId
|
|
|
|
- */
|
|
|
|
- private void processAfterSyncExamData(Long realExamRecordDataId, Long examScoreId, Double objectiveScore,
|
|
|
|
- Long examStudentId, Long transitionExamRecordDataId) {
|
|
|
|
- long startTime = System.currentTimeMillis();
|
|
|
|
-
|
|
|
|
- // 保存阅卷相关数据
|
|
|
|
- examRecordForMarkingService.saveExamRecordForMarking(realExamRecordDataId, objectiveScore);
|
|
|
|
-
|
|
|
|
- startTime = this.debugCost("14.1 同步后续处理 - 保存阅卷相关数据", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
- // 保存考试分数数据到推分队列
|
|
|
|
- examScorePushQueueService.saveScoreDataInfoToQueue(realExamRecordDataId, examScoreId);
|
|
|
|
-
|
|
|
|
- startTime = this.debugCost("14.2 同步后续处理 - 保存考试分数数据到推分队列", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
- // 保存考试分数数据到分数获取队列
|
|
|
|
- examScoreObtainQueueService.saveExamScoreObtainQueue(realExamRecordDataId);
|
|
|
|
-
|
|
|
|
- startTime = this.debugCost("14.3 同步后续处理 - 保存考试分数数据到推分队列", transitionExamRecordDataId, startTime);
|
|
|
|
-
|
|
|
|
- //刷新考生的缓存
|
|
|
|
- examStudentCache.refresh(examStudentId);
|
|
|
|
-
|
|
|
|
- this.debugCost("14.4 同步后续处理 - 刷新考生的缓存", transitionExamRecordDataId, startTime);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //记录耗时
|
|
|
|
- private Long debugCost(String msg, Long examRecordDataId, Long startTime) {
|
|
|
|
- if (LOG.isDebugEnabled()) {
|
|
|
|
- LOG.debug("[SYNC_EXAM_DATA_CLOUD_SERVICE_PROVIDER-" + examRecordDataId + "]:" + msg +
|
|
|
|
- " 耗时:" + (System.currentTimeMillis() - startTime) + " ms");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return System.currentTimeMillis();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|