|
@@ -17,10 +17,8 @@ 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.CacheHelper;
|
|
import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
|
|
-import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
|
import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
-import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
|
|
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
@@ -37,8 +35,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.stream.Collectors;
|
|
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description 同步考试相关数据接口
|
|
* @Description 同步考试相关数据接口
|
|
@@ -95,6 +91,8 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
private ExamContinuedRecordRepo examContinuedRecordRepo;
|
|
private ExamContinuedRecordRepo examContinuedRecordRepo;
|
|
@Autowired
|
|
@Autowired
|
|
private ExamProcessRecordRepo examProcessRecordRepo;
|
|
private ExamProcessRecordRepo examProcessRecordRepo;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisClient redisClient;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 同步考试记录数据
|
|
* 同步考试记录数据
|
|
@@ -173,6 +171,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
|
|
|
//同步抓拍照片结果(异步抓拍的数据)
|
|
//同步抓拍照片结果(异步抓拍的数据)
|
|
if (null != req.getExamCaptures()) {
|
|
if (null != req.getExamCaptures()) {
|
|
|
|
+
|
|
syncExamCapture(req.getExamCaptures(), realExamRecordDataId);
|
|
syncExamCapture(req.getExamCaptures(), realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -208,10 +207,15 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
if (FaceBiopsyHelper.isFaceEnable(transitionExamRecordData.getRootOrgId(), transitionExamRecordData.getExamId(), transitionExamRecordData.getStudentId())) {
|
|
if (FaceBiopsyHelper.isFaceEnable(transitionExamRecordData.getRootOrgId(), transitionExamRecordData.getExamId(), transitionExamRecordData.getStudentId())) {
|
|
//计算违纪自动审核结果(无人脸或活检失败)
|
|
//计算违纪自动审核结果(无人脸或活检失败)
|
|
boolean isNoPhotoAndIllegality = (null == req.getExamCaptures() || req.getExamCaptures().isEmpty());//是否无照片
|
|
boolean isNoPhotoAndIllegality = (null == req.getExamCaptures() || req.getExamCaptures().isEmpty());//是否无照片
|
|
-
|
|
|
|
saveAutoAudit(transitionExamRecordData, isNoPhotoAndIllegality, realExamRecordDataId);
|
|
saveAutoAudit(transitionExamRecordData, isNoPhotoAndIllegality, realExamRecordDataId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //header校验错误
|
|
|
|
+ Boolean hasWarn = redisClient.get("OE_SESSION_WARN_"+transitionExamRecordDataId, Boolean.class);
|
|
|
|
+ if(hasWarn !=null && hasWarn){
|
|
|
|
+ examAuditService.saveHeaderWarnAudit(realExamRecordDataId);
|
|
|
|
+ }
|
|
|
|
+
|
|
startTime = this.debugCost("13 如果开启了活检,计算违纪自动审核结果", transitionExamRecordDataId, startTime);
|
|
startTime = this.debugCost("13 如果开启了活检,计算违纪自动审核结果", transitionExamRecordDataId, startTime);
|
|
|
|
|
|
//同步后续处理
|
|
//同步后续处理
|
|
@@ -225,6 +229,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
return new SyncExamDataResp();
|
|
return new SyncExamDataResp();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
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);
|
|
@@ -436,8 +441,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
}
|
|
}
|
|
|
|
|
|
private void saveAutoAudit(ExamRecordDataBean examRecordData, boolean isNoPhotoAndIllegality, Long realExamRecordDataId) {
|
|
private void saveAutoAudit(ExamRecordDataBean examRecordData, boolean isNoPhotoAndIllegality, Long realExamRecordDataId) {
|
|
- //是否已自动审核
|
|
|
|
- boolean isAutoAudit = false;
|
|
|
|
|
|
+ boolean isAutoAudit = false;//是否已自动审核
|
|
//无照片违纪自动审核
|
|
//无照片违纪自动审核
|
|
if (isNoPhotoAndIllegality) {
|
|
if (isNoPhotoAndIllegality) {
|
|
examAuditService.saveExamAuditByNoPhoto(realExamRecordDataId);
|
|
examAuditService.saveExamAuditByNoPhoto(realExamRecordDataId);
|
|
@@ -445,7 +449,8 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
} else {
|
|
} else {
|
|
//活体检测失败违纪自动审核
|
|
//活体检测失败违纪自动审核
|
|
if (null != examRecordData.getFaceVerifyResult()
|
|
if (null != examRecordData.getFaceVerifyResult()
|
|
- && IsSuccess.FAILED.name().equals(examRecordData.getFaceVerifyResult())) {
|
|
|
|
|
|
+ && IsSuccess.FAILED.name().equals(examRecordData.getFaceVerifyResult())
|
|
|
|
+ && examRecordData.getIllegality()) {
|
|
examAuditService.saveExamAuditByFaceVerifyFailed(realExamRecordDataId, examRecordData.getRootOrgId());
|
|
examAuditService.saveExamAuditByFaceVerifyFailed(realExamRecordDataId, examRecordData.getRootOrgId());
|
|
isAutoAudit = true;
|
|
isAutoAudit = true;
|
|
}
|
|
}
|
|
@@ -642,14 +647,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
entity.setFacelivenessResult(examSyncCapture.getFacelivenessResult());
|
|
entity.setFacelivenessResult(examSyncCapture.getFacelivenessResult());
|
|
entity.setProcessTime(examSyncCapture.getProcessTime());
|
|
entity.setProcessTime(examSyncCapture.getProcessTime());
|
|
entity.setHasVirtualCamera(examSyncCapture.getHasVirtualCamera());
|
|
entity.setHasVirtualCamera(examSyncCapture.getHasVirtualCamera());
|
|
-
|
|
|
|
- String cameraInfos = examSyncCapture.getCameraInfos();
|
|
|
|
- if(StringUtils.isNotBlank(cameraInfos) && cameraInfos.length()>=800){
|
|
|
|
- cameraInfos = "[{\"name\":\"虚拟摄像头信息超长!\",\"pid\":\"\",\"vid\":\"\"}]";
|
|
|
|
- log.error("虚拟摄像头信息超长!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- entity.setCameraInfos(cameraInfos);
|
|
|
|
|
|
+ entity.setCameraInfos(examSyncCapture.getCameraInfos());
|
|
entity.setExtMsg(examSyncCapture.getExtMsg());
|
|
entity.setExtMsg(examSyncCapture.getExtMsg());
|
|
|
|
|
|
return entity;
|
|
return entity;
|
|
@@ -675,14 +673,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
entity.setFacelivenessResult(examCapture.getFacelivenessResult());
|
|
entity.setFacelivenessResult(examCapture.getFacelivenessResult());
|
|
entity.setProcessTime(examCapture.getProcessTime());
|
|
entity.setProcessTime(examCapture.getProcessTime());
|
|
entity.setHasVirtualCamera(examCapture.getHasVirtualCamera());
|
|
entity.setHasVirtualCamera(examCapture.getHasVirtualCamera());
|
|
-
|
|
|
|
- String cameraInfos = examCapture.getCameraInfos();
|
|
|
|
- if(StringUtils.isNotBlank(cameraInfos) && cameraInfos.length()>=800){
|
|
|
|
- cameraInfos = "[{\"name\":\"虚拟摄像头信息超长!\",\"pid\":\"\",\"vid\":\"\"}]";
|
|
|
|
- log.error("虚拟摄像头信息超长!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- entity.setCameraInfos(cameraInfos);
|
|
|
|
|
|
+ entity.setCameraInfos(examCapture.getCameraInfos());
|
|
entity.setExtMsg(examCapture.getExtMsg());
|
|
entity.setExtMsg(examCapture.getExtMsg());
|
|
|
|
|
|
return entity;
|
|
return entity;
|