|
@@ -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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|