Ver código fonte

update 活检开始时间

deason 3 anos atrás
pai
commit
1d4b28c054

+ 13 - 7
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/FaceBiopsyController.java

@@ -58,6 +58,9 @@ public class FaceBiopsyController extends ControllerSupport {
     @Autowired
     private ExamFaceLivenessVerifyService examFaceLivenessVerifyService;
 
+    @Autowired
+    private ExamFaceLiveVerifyService examFaceLiveVerifyService;
+
     @Autowired
     private ExamControlService examControlService;
 
@@ -100,14 +103,17 @@ public class FaceBiopsyController extends ControllerSupport {
 
         FaceBiopsyScheme faceBiopsyScheme = FaceBiopsyHelper.getFaceBiopsyScheme(user.getRootOrgId());
 
-        Integer faceVerifyMinute = null;
-        // 如果是新活体检测方案,则使用新的计算方案计算活检开始时间
-        if (faceBiopsyScheme == FaceBiopsyScheme.FACE_MOTION) {
-            faceVerifyMinute = faceBiopsyService.calculateFaceBiopsyStartMinute(examRecordDataId);
-        }
-        // 非新活检,默认使用旧的活检计算方式
-        else {
+        // 活检开始时间
+        Integer faceVerifyMinute;
 
+        if (FaceBiopsyScheme.FACE_CLIENT == faceBiopsyScheme) {
+            // C端活体检测方案
+            faceVerifyMinute = examFaceLiveVerifyService.calculateStartFaceVerifyMinute(examRecordDataId);
+        } else if (FaceBiopsyScheme.FACE_MOTION == faceBiopsyScheme) {
+            // Electron Client 自研活体检测方案
+            faceVerifyMinute = faceBiopsyService.calculateFaceBiopsyStartMinute(examRecordDataId);
+        } else {
+            // FaceID活体检测方案
             String examingHeartbeatKey = RedisKeyHelper.getBuilder().examingHeartbeatKey(examSessionInfo.getExamRecordDataId());
             ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey, ExamingHeartbeat.class);
 

+ 2 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/ExamFaceLiveVerifyService.java

@@ -9,4 +9,6 @@ public interface ExamFaceLiveVerifyService {
 
     void saveFaceLiveVerifyResult(FaceLiveVerifyResult req);
 
+    Integer calculateStartFaceVerifyMinute(Long examRecordDataId);
+
 }

+ 9 - 2
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamFaceLiveVerifyServiceImpl.java

@@ -58,10 +58,11 @@ public class ExamFaceLiveVerifyServiceImpl implements ExamFaceLiveVerifyService
         entity.setStatus(FaceLiveVerifyStatus.ERROR);
         examFaceLiveVerifyRepo.save(entity);
 
-        // todo check
-
         FaceLiveVerifyInfo info = new FaceLiveVerifyInfo();
         info.setFaceLiveVerifyId(entity.getId());
+
+        // todo 第几次活检、活检开始时间
+
         return info;
     }
 
@@ -116,4 +117,10 @@ public class ExamFaceLiveVerifyServiceImpl implements ExamFaceLiveVerifyService
         examRecordDataService.saveExamRecordDataCache(req.getExamRecordDataId(), examRecordData);
     }
 
+    @Override
+    public Integer calculateStartFaceVerifyMinute(Long examRecordDataId) {
+        // todo
+        return 1;
+    }
+
 }