Преглед изворни кода

处理:【异常】过程活体不通过 和 【违纪】指定动作失败

deason пре 1 година
родитељ
комит
eb16187525

+ 22 - 8
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/provider/SyncExamDataCloudServiceProvider.java

@@ -166,6 +166,13 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
         // 是否开启人脸验证
         boolean isFaceEnable = FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId);
 
+        // 是否开启考中人脸活体检测
+        boolean isFaceVerify = FaceBiopsyHelper.isFaceVerify(rootOrgId, examId, studentId);
+
+        // 是否考中活体不通过强制退出
+        ExamPropertyCacheBean examProperty2 = CacheHelper.getExamProperty(examId, ExamProperties.FACE_VERIFY_FORCE_EXIT.name());
+        boolean isFaceVerifyForceExit = examProperty2 != null && StringUtil.isTrue(examProperty2.getValue());
+
         // 是否开启审核全通过
         ExamPropertyCacheBean examProperty = CacheHelper.getExamProperty(examId, ExamProperties.AUDIT_ALL_PASS.name());
         boolean isAuditAllPass = examProperty != null && StringUtil.isTrue(examProperty.getValue());
@@ -263,14 +270,21 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
                 LOG.warn("{}_{}_{} OTHER_抓拍照片数量为0...", studentId, tempExamRecordDataId, realExamRecordDataId);
             }
 
-            //活检失败
-            if (tempExamRecordData.getIllegality() && tempExamRecordData.getFaceVerifyResult() != null
-                    && IsSuccess.FAILED.name().equals(tempExamRecordData.getFaceVerifyResult())) {
-                //【违纪】指定动作失败
-                examAuditService.saveExamAuditByFaceVerifyFailed(realExamRecordDataId, rootOrgId);
-                //修改为已审状态
-                examRecordDataRepo.updateExamRecordIsAuditById(realExamRecordDataId, true);
-                LOG.warn("{}_{}_{} ACTION_FAILURE...", studentId, tempExamRecordDataId, realExamRecordDataId);
+            // 若开启考中人脸活体检测 且 活检失败
+            if (isFaceVerify && IsSuccess.FAILED.name().equals(tempExamRecordData.getFaceVerifyResult())) {
+                if (isFaceVerifyForceExit) {
+                    //【违纪】指定动作失败
+                    examAuditService.saveExamAuditByFaceVerifyFailed(realExamRecordDataId, rootOrgId);
+                    //修改为已审状态
+                    examRecordDataRepo.updateExamRecordIsAuditById(realExamRecordDataId, true);
+                    LOG.warn("{}_{}_{} ACTION_FAILURE...", studentId, tempExamRecordDataId, realExamRecordDataId);
+                } else {
+                    //【异常】过程活体不通过
+                    examWarnService.saveExamWarn(realExamRecordDataId, WarnType.FACE_LIVE_UNPASS);
+                    //修改为异常状态
+                    examRecordDataRepo.updateExamRecordIsWarnById(realExamRecordDataId, true);
+                    LOG.warn("{}_{}_{} FACE_LIVE_UNPASS...", studentId, tempExamRecordDataId, realExamRecordDataId);
+                }
             }
         }