deason 3 年之前
父節點
當前提交
e6e6c4258e

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

@@ -278,11 +278,19 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
                         return new CalcFaceBiopsyResultResp(true, true, IsSuccess.FAILED);
                     }
 
-                    for (ExamFaceLiveVerifyEntity entity : entities) {
-                        if (FaceLiveVerifyStatus.SUCCESS == entity.getStatus()) {
-                            return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
+                    // 最后一次活检成功,则认为成功
+                    ExamFaceLiveVerifyEntity entity = entities.stream().max((a, b) -> {
+                        if (a.getId() > b.getId()) {
+                            return 1;
                         }
+                        return -1;
+                    }).get();
+
+                    if (FaceLiveVerifyStatus.SUCCESS == entity.getStatus()) {
+                        return new CalcFaceBiopsyResultResp(IsSuccess.SUCCESS);
                     }
+
+                    return new CalcFaceBiopsyResultResp(true, true, IsSuccess.FAILED);
                 } else if (faceBiopsyScheme == FaceBiopsyScheme.FACE_MOTION) {
                     // Electron Client 自研活体检测方案
                     FaceBiopsyEntity faceBiopsy = faceBiopsyRepo.findByExamRecordDataId(examRecordData.getId());