|
@@ -170,7 +170,8 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
// 是否开启人脸验证
|
|
|
boolean isFaceEnable = FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId);
|
|
|
|
|
|
- boolean skipFace = false, isFaceCheck = false, isFaceVerify = false, isFaceVerifyForceExit = false, isVirtualCameraAuditEnabled = false;
|
|
|
+ boolean skipFace = false, isFaceCheck = false, isFaceVerify = false, isFaceVerifyForceExit = false,
|
|
|
+ isVirtualCameraAuditEnabled = false, isStrangerEnable = false;
|
|
|
if (isFaceEnable) {
|
|
|
// 检查当前考生是否跳过人脸识别
|
|
|
skipFace = this.checkExamSkipFace(examId, examStudentId);
|
|
@@ -188,6 +189,10 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
// 是否开启虚拟摄像头进入待审核
|
|
|
ExamPropertyCacheBean virtualCameraAuditEnabledProperty = CacheHelper.getExamProperty(examId, ExamProperties.VIRTUAL_CAMERA_AUDIT_ENABLED.name());
|
|
|
isVirtualCameraAuditEnabled = virtualCameraAuditEnabledProperty != null && StringUtil.isTrue(virtualCameraAuditEnabledProperty.getValue());
|
|
|
+
|
|
|
+ // 是否启用陌生人检测
|
|
|
+ ExamPropertyCacheBean strangerProperty = CacheHelper.getExamProperty(examId, ExamProperties.IS_STRANGER_ENABLE.name());
|
|
|
+ isStrangerEnable = strangerProperty != null && StringUtil.isTrue(strangerProperty.getValue());
|
|
|
}
|
|
|
|
|
|
// 是否开启审核全通过
|
|
@@ -226,7 +231,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
syncExamSyncCapture(req.getExamSyncCapture(), realExamRecordDataId);
|
|
|
|
|
|
//同步“人脸抓拍比对”结果
|
|
|
- syncExamCapture(req.getExamCaptures(), realExamRecordDataId);
|
|
|
+ syncExamCapture(req.getExamCaptures(), realExamRecordDataId, isStrangerEnable);
|
|
|
|
|
|
//同步活检结果:FACE_ID("S1", "FaceID活体检测方案")
|
|
|
syncExamFaceLivenessVerify(req.getExamFaceLivenessVerifies(), realExamRecordDataId);
|
|
@@ -797,28 +802,47 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
return entity;
|
|
|
}
|
|
|
|
|
|
- private void syncExamCapture(List<ExamCaptureBean> examCaptures, Long examRecordDataId) {
|
|
|
+ private void syncExamCapture(List<ExamCaptureBean> examCaptures, Long examRecordDataId, boolean isStrangerEnable) {
|
|
|
if (CollectionUtils.isEmpty(examCaptures)) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
for (ExamCaptureBean bean : examCaptures) {
|
|
|
- ExamCaptureEntity examCaptureEntity = copyExamCaptureFrom(bean, examRecordDataId);
|
|
|
- saveExamCaptureCameraInfo(examCaptureEntity);
|
|
|
- examCaptureEntity.setCameraInfos(null);
|
|
|
- examCaptureRepo.saveAndFlush(examCaptureEntity);
|
|
|
+ ExamCaptureEntity entity = new ExamCaptureEntity();
|
|
|
+ entity.setExamRecordDataId(examRecordDataId);
|
|
|
+ entity.setFileUrl(bean.getFileUrl());
|
|
|
+ entity.setFileName(bean.getFileName());
|
|
|
+ entity.setFaceCompareResult(bean.getFaceCompareResult());
|
|
|
+ entity.setIsPass(bean.getPass());
|
|
|
+ entity.setLandmark(bean.getLandmark());
|
|
|
+ entity.setUsedTime(bean.getUsedTime());
|
|
|
+ entity.setFacelivenessResult(bean.getFacelivenessResult());
|
|
|
+ entity.setProcessTime(bean.getProcessTime());
|
|
|
+ entity.setHasVirtualCamera(bean.getHasVirtualCamera());
|
|
|
+ entity.setExtMsg(bean.getExtMsg());
|
|
|
+ entity.setCameraInfos(null);
|
|
|
+ if (isStrangerEnable) {
|
|
|
+ entity.setIsStranger(bean.getStranger());
|
|
|
+ } else {
|
|
|
+ entity.setIsStranger(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ saveExamCaptureCameraInfo(examRecordDataId, bean.getCameraInfos());
|
|
|
+
|
|
|
+ examCaptureRepo.saveAndFlush(entity);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveExamCaptureCameraInfo(ExamCaptureEntity examCaptureEntity) {
|
|
|
- if (StringUtils.isEmpty(examCaptureEntity.getCameraInfos())) {
|
|
|
+ private void saveExamCaptureCameraInfo(Long examRecordDataId, String cameraInfos) {
|
|
|
+ if (StringUtils.isEmpty(cameraInfos)) {
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
- JSONArray jsonArray = new JSONArray(examCaptureEntity.getCameraInfos());
|
|
|
+ JSONArray jsonArray = new JSONArray(cameraInfos);
|
|
|
for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
JSONObject jsonObject = (JSONObject) jsonArray.get(i);
|
|
|
ExamCaptureCameraInfoEntity ci = new ExamCaptureCameraInfoEntity();
|
|
|
- ci.setExamRecordDataId(examCaptureEntity.getExamRecordDataId());
|
|
|
+ ci.setExamRecordDataId(examRecordDataId);
|
|
|
ci.setDetail(getVal(jsonObject, "detail", 500));
|
|
|
ci.setName(getVal(jsonObject, "name", 100));
|
|
|
ci.setPid(getVal(jsonObject, "pid", 100));
|
|
@@ -831,7 +855,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
}
|
|
|
|
|
|
List<ExamCaptureCameraInfoEntity> olds = examCaptureCameraInfoRepo.findByExamRecordDataIdAndPidAndVidAndName(
|
|
|
- examCaptureEntity.getExamRecordDataId(), ci.getPid(), ci.getVid(), ci.getName());
|
|
|
+ examRecordDataId, ci.getPid(), ci.getVid(), ci.getName());
|
|
|
if (CollectionUtils.isEmpty(olds)) {
|
|
|
examCaptureCameraInfoRepo.saveAndFlush(ci);
|
|
|
} else {
|
|
@@ -843,7 +867,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- LOG.error("保存摄像信息失败:" + examCaptureEntity.getExamRecordDataId() + " " + examCaptureEntity.getCameraInfos(), e);
|
|
|
+ LOG.error("保存摄像信息失败:" + examRecordDataId + " " + cameraInfos, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -860,24 +884,6 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private ExamCaptureEntity copyExamCaptureFrom(ExamCaptureBean examCapture, Long examRecordDataId) {
|
|
|
- ExamCaptureEntity entity = new ExamCaptureEntity();
|
|
|
- entity.setExamRecordDataId(examRecordDataId);
|
|
|
- entity.setFileUrl(examCapture.getFileUrl());
|
|
|
- entity.setFileName(examCapture.getFileName());
|
|
|
- entity.setFaceCompareResult(examCapture.getFaceCompareResult());
|
|
|
- entity.setIsPass(examCapture.getPass());
|
|
|
- entity.setIsStranger(examCapture.getStranger());
|
|
|
- entity.setLandmark(examCapture.getLandmark());
|
|
|
- entity.setUsedTime(examCapture.getUsedTime());
|
|
|
- entity.setFacelivenessResult(examCapture.getFacelivenessResult());
|
|
|
- entity.setProcessTime(examCapture.getProcessTime());
|
|
|
- entity.setHasVirtualCamera(examCapture.getHasVirtualCamera());
|
|
|
- entity.setCameraInfos(examCapture.getCameraInfos());
|
|
|
- entity.setExtMsg(examCapture.getExtMsg());
|
|
|
- return entity;
|
|
|
- }
|
|
|
-
|
|
|
private ExamContinuedRecordEntity copyExamContinuedRecordFrom(ExamContinuedRecordBean bean, Long examRecordDataId) {
|
|
|
ExamContinuedRecordEntity entity = new ExamContinuedRecordEntity();
|
|
|
entity.setExamRecordDataId(examRecordDataId);
|