Browse Source

新活检 bug fix

lideyin 5 năm trước cách đây
mục cha
commit
2bc63edd23

+ 23 - 23
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/FaceBiopsyServiceImpl.java

@@ -368,7 +368,7 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
                     //如果第一步检测部分失败(照片非本人或检测中多人脸),需要结束考试
                     Map faceCompareResult = JsonUtil.fromJson(stepInfo.getResultJson(), Map.class);
                     if (null != faceCompareResult) {
-                        if (null == faceCompareResult.get("isStranger") || null == faceCompareResult.get("isPass") ||
+                        if (!faceCompareResult.containsKey("isStranger") || null == faceCompareResult.get("isPass") ||
                                 null == faceCompareResult.get("existsSystemError")) {
                             throw new StatusException("201007", "活体检测第一步检测结果的json串格式不正确");
                         }
@@ -840,26 +840,26 @@ public class FaceBiopsyServiceImpl implements FaceBiopsyService {
                 examRecordData.getExamId(), examRecordData.getStudentId());
     }
 
-	/**
-	 * 获取心跳时间
-	 *
-	 * @param studentId
-	 * @return
-	 */
-	private Integer getExamUsedMinutes(Long studentId) {
-		ExamingSession examingSession = examingSessionService.getExamingSession(studentId);
-		if (examingSession == null) {
-			throw new StatusException("201002", "考试会话已过期");
-		}
-
-		String examingHeartbeatKey = RedisKeyHelper.getBuilder()
-				.examingHeartbeatKey(examingSession.getExamRecordDataId());
-		ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey,
-				ExamingHeartbeat.class);
-
-		long cost = null == examingHeartbeat ? 0 : examingHeartbeat.getCost();
-
-		return Math.toIntExact(cost / 60);
-	}
-    
+    /**
+     * 获取心跳时间
+     *
+     * @param studentId
+     * @return
+     */
+    private Integer getExamUsedMinutes(Long studentId) {
+        ExamingSession examingSession = examingSessionService.getExamingSession(studentId);
+        if (examingSession == null) {
+            throw new StatusException("201002", "考试会话已过期");
+        }
+
+        String examingHeartbeatKey = RedisKeyHelper.getBuilder()
+                .examingHeartbeatKey(examingSession.getExamRecordDataId());
+        ExamingHeartbeat examingHeartbeat = redisClient.get(examingHeartbeatKey,
+                ExamingHeartbeat.class);
+
+        long cost = null == examingHeartbeat ? 0 : examingHeartbeat.getCost();
+
+        return Math.toIntExact(cost / 60);
+    }
+
 }