Parcourir la source

update 尚未做过活检,不作为违纪或异常。

deason il y a 1 an
Parent
commit
c1f3c7b8ee

+ 30 - 5
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordDataServiceImpl.java

@@ -308,6 +308,9 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         boolean isFaceVerifyForceExit = examProperty != null && StringUtil.isTrue(examProperty.getValue());
         boolean isFaceVerifyForceExit = examProperty != null && StringUtil.isTrue(examProperty.getValue());
 
 
         if (examRecordData.getFaceVerifyResult() != null) {
         if (examRecordData.getFaceVerifyResult() != null) {
+            log.warn("活检结果:{} studentId:{} examRecordDataId:{}", examRecordData.getFaceVerifyResult(), studentId,
+                    examRecordData.getId());
+
             if (IsSuccess.SUCCESS == examRecordData.getFaceVerifyResult()) {
             if (IsSuccess.SUCCESS == examRecordData.getFaceVerifyResult()) {
                 // 存在活体检测成功结果,则直接返回
                 // 存在活体检测成功结果,则直接返回
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
@@ -341,11 +344,19 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
                 }
                 }
                 return -1;
                 return -1;
             }).get();
             }).get();
-            if (lastVerify.getStatus() != null && FaceLiveVerifyStatus.SUCCESS == lastVerify.getStatus()) {
+
+            if (lastVerify.getStatus() == null) {
+                // 活检状态未知,不作为违纪或异常。
+                log.warn("S3 活检状态未知!studentId:{} examRecordDataId:{} lastVerifyId:{}", studentId,
+                        examRecordData.getId(), lastVerify.getId());
+                return new CalcFaceBiopsyResultResp();
+            }
+
+            if (FaceLiveVerifyStatus.SUCCESS == lastVerify.getStatus()) {
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
             }
             }
         } else if (faceBiopsyScheme == FaceBiopsyScheme.FACE_MOTION) {
         } else if (faceBiopsyScheme == FaceBiopsyScheme.FACE_MOTION) {
-            // S2 自研活体检测方案
+            // S2 自研活体检测方案【已废弃】
             FaceBiopsyEntity lastVerify = faceBiopsyRepo.findByExamRecordDataId(examRecordData.getId());
             FaceBiopsyEntity lastVerify = faceBiopsyRepo.findByExamRecordDataId(examRecordData.getId());
 
 
             if (lastVerify == null) {
             if (lastVerify == null) {
@@ -353,7 +364,14 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
                 return new CalcFaceBiopsyResultResp();
                 return new CalcFaceBiopsyResultResp();
             }
             }
 
 
-            if (lastVerify.getResult() != null && lastVerify.getResult()) {
+            if (lastVerify.getResult() == null) {
+                // 活检状态未知,不作为违纪或异常。
+                log.warn("S2 活检状态未知!studentId:{} examRecordDataId:{} lastVerifyId:{}", studentId,
+                        examRecordData.getId(), lastVerify.getId());
+                return new CalcFaceBiopsyResultResp();
+            }
+
+            if (lastVerify.getResult()) {
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
             }
             }
         } else {
         } else {
@@ -368,8 +386,15 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
 
 
             // 最后一次活检成功,则认为成功
             // 最后一次活检成功,则认为成功
             ExamFaceLivenessVerifyEntity lastVerify = verifies.get(verifies.size() - 1);
             ExamFaceLivenessVerifyEntity lastVerify = verifies.get(verifies.size() - 1);
-            if (lastVerify.getVerifyResult() != null
-                    && FaceVerifyResult.VERIFY_SUCCESS == lastVerify.getVerifyResult()) {
+
+            if (lastVerify.getVerifyResult() == null) {
+                // 活检状态未知,不作为违纪或异常。
+                log.warn("S1 活检状态未知!studentId:{} examRecordDataId:{} lastVerifyId:{}", studentId,
+                        examRecordData.getId(), lastVerify.getId());
+                return new CalcFaceBiopsyResultResp();
+            }
+
+            if (FaceVerifyResult.VERIFY_SUCCESS == lastVerify.getVerifyResult()) {
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
                 return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
             }
             }
         }
         }