|
@@ -204,42 +204,41 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
//如果考试记录中的活检记录为空,需要再次计算一次,并更新到考试记录中
|
|
|
- else {
|
|
|
- Long examId = examRecordDataEntity.getExamId();
|
|
|
- Long rootOrgId = examRecordDataEntity.getRootOrgId();
|
|
|
- Long studentId = examRecordDataEntity.getStudentId();
|
|
|
-
|
|
|
- //是否进行活体检测
|
|
|
- if (FaceBiopsyHelper.isFaceVerify(rootOrgId, examId, studentId)) {
|
|
|
- FaceBiopsyScheme faceBiopsyScheme = FaceBiopsyHelper.getFaceBiopsyScheme(rootOrgId);
|
|
|
- //新活体检测方案
|
|
|
- if (faceBiopsyScheme == FaceBiopsyScheme.NEW) {
|
|
|
- FaceBiopsyEntity faceBiopsy = faceBiopsyRepo.findByExamRecordDataId(examRecordDataEntity.getId());
|
|
|
-
|
|
|
- //如果活检结果最终为true,则更新考试记录相关属性
|
|
|
- if (faceBiopsy != null && faceBiopsy.getResult() != null && faceBiopsy.getResult()) {
|
|
|
+ Long examId = examRecordDataEntity.getExamId();
|
|
|
+ Long rootOrgId = examRecordDataEntity.getRootOrgId();
|
|
|
+ Long studentId = examRecordDataEntity.getStudentId();
|
|
|
+
|
|
|
+ //是否进行活体检测
|
|
|
+ if (FaceBiopsyHelper.isFaceVerify(rootOrgId, examId, studentId)) {
|
|
|
+ FaceBiopsyScheme faceBiopsyScheme = FaceBiopsyHelper.getFaceBiopsyScheme(rootOrgId);
|
|
|
+ //新活体检测方案
|
|
|
+ if (faceBiopsyScheme == FaceBiopsyScheme.NEW) {
|
|
|
+ FaceBiopsyEntity faceBiopsy = faceBiopsyRepo.findByExamRecordDataId(examRecordDataEntity.getId());
|
|
|
+
|
|
|
+ //如果活检结果最终为true,则更新考试记录相关属性
|
|
|
+ if (faceBiopsy != null && faceBiopsy.getResult() != null && faceBiopsy.getResult()) {
|
|
|
+ setExamRecordByFaceVerifyResult(examRecordDataEntity, IsSuccess.SUCCESS);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //旧活体检测方案
|
|
|
+ else {
|
|
|
+ List<ExamFaceLivenessVerifyEntity> faceVerifies =
|
|
|
+ examFaceLivenessVerifyRepo.findByExamRecordDataIdOrderById(examRecordDataEntity.getId());
|
|
|
+ if (faceVerifies != null && faceVerifies.size() > 0) {
|
|
|
+ ExamFaceLivenessVerifyEntity latestFaceVerify = faceVerifies.get(faceVerifies.size() - 1);
|
|
|
+ //最后一次活检成功,则认为成功,并更新考试记录相关属性
|
|
|
+ if (latestFaceVerify != null && latestFaceVerify.getVerifyResult() != null &&
|
|
|
+ latestFaceVerify.getVerifyResult() == FaceVerifyResult.VERIFY_SUCCESS) {
|
|
|
setExamRecordByFaceVerifyResult(examRecordDataEntity, IsSuccess.SUCCESS);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- //旧活体检测方案
|
|
|
- else {
|
|
|
- List<ExamFaceLivenessVerifyEntity> faceVerifies =
|
|
|
- examFaceLivenessVerifyRepo.findByExamRecordDataIdOrderById(examRecordDataEntity.getId());
|
|
|
- if (faceVerifies != null && faceVerifies.size() > 0) {
|
|
|
- ExamFaceLivenessVerifyEntity latestFaceVerify = faceVerifies.get(faceVerifies.size() - 1);
|
|
|
- //最后一次活检成功,则认为成功,并更新考试记录相关属性
|
|
|
- if (latestFaceVerify != null && latestFaceVerify.getVerifyResult() != null &&
|
|
|
- latestFaceVerify.getVerifyResult() == FaceVerifyResult.VERIFY_SUCCESS) {
|
|
|
- setExamRecordByFaceVerifyResult(examRecordDataEntity, IsSuccess.SUCCESS);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //默认更新为失败
|
|
|
- setExamRecordByFaceVerifyResult(examRecordDataEntity, IsSuccess.FAILED);
|
|
|
}
|
|
|
+ //默认更新为失败
|
|
|
+ setExamRecordByFaceVerifyResult(examRecordDataEntity, IsSuccess.FAILED);
|
|
|
}
|
|
|
}
|
|
|
|