Browse Source

详情预警/多张人脸/异常修改

wangliang 1 năm trước cách đây
mục cha
commit
6b744e4c9c

+ 11 - 11
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -301,12 +301,10 @@ public class TIeInvigilateController {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
         //获取考试记录缓存
-        Long examId = ExamRecordCacheUtil.getExamId(examRecordId);
+        Long examId = ExamRecordCacheUtil.getExamId(examRecordId), examStudentId = null, examActivityId = null;
         TOeExamRecord tOeExamRecord = null;
-        Long examStudentId = null;
-        Long examActivityId = null;
         ExamRecordStatusEnum status = null;
-        Integer breachStatus = null;
+        Integer breachStatus = null, warningMultipleFaceCount = null, exceptionCount = null, warningCount = null;
         if (Objects.isNull(examId)) {
             tOeExamRecord = tOeExamRecordService.getById(examRecordId);
             examId = tOeExamRecord.getExamId();
@@ -314,11 +312,17 @@ public class TIeInvigilateController {
             examActivityId = tOeExamRecord.getExamActivityId();
             status = tOeExamRecord.getStatus();
             breachStatus = Objects.isNull(tOeExamRecord.getBreachStatus()) ? 1 : tOeExamRecord.getBreachStatus();
+            warningCount = Objects.nonNull(tOeExamRecord.getWarningCount()) ? tOeExamRecord.getWarningCount() : 0;
+            warningMultipleFaceCount = Objects.nonNull(tOeExamRecord.getWarningMultipleFaceCount()) ? tOeExamRecord.getWarningMultipleFaceCount() : 0;
+            exceptionCount = Objects.nonNull(tOeExamRecord.getExceptionCount()) ? tOeExamRecord.getExceptionCount() : 0;
         } else {
             examStudentId = ExamRecordCacheUtil.getExamStudentId(examRecordId);
             examActivityId = ExamRecordCacheUtil.getExamActivityId(examRecordId);
             status = ExamRecordCacheUtil.getStatus(examRecordId);
             breachStatus = Objects.isNull(ExamRecordCacheUtil.getBreachStatus(examRecordId)) ? 1 : ExamRecordCacheUtil.getBreachStatus(examRecordId);
+            warningCount = Objects.isNull(ExamRecordCacheUtil.getWarningCount(examRecordId)) ? 0 : ExamRecordCacheUtil.getWarningCount(examRecordId);
+            warningMultipleFaceCount = Objects.isNull(ExamRecordCacheUtil.getWarningMultipleFaceCount(examRecordId)) ? 0 : ExamRecordCacheUtil.getWarningMultipleFaceCount(examRecordId);
+            exceptionCount = Objects.isNull(ExamRecordCacheUtil.getExceptionCount(examRecordId)) ? 0 : ExamRecordCacheUtil.getExceptionCount(examRecordId);
         }
         ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
         TEStudentCacheDto teStudent = themisCacheService.addStudentAccountCache(examStudentCacheBean.getStudentId());
@@ -370,13 +374,9 @@ public class TIeInvigilateController {
         Collections.sort(teExamStudentLogList);
         invigilateListDetailBean.setExamStudentLogList(teExamStudentLogList);
         //预警、异常、人脸
-        //todo 这里需要修改预警
-        List<Integer> list = tIeInvigilateWarnInfoService.findWarnAndExceptionInfo(examRecordId, VerifyExceptionEnum.FACE_COUNT_ERROR, WarningLevelEnum.D8);
-        if (Objects.nonNull(list) && list.size() > 0) {
-            invigilateListDetailBean.setWarningCount(list.get(0));
-            invigilateListDetailBean.setExceptionCount(list.get(1));
-            invigilateListDetailBean.setMultipleFaceCount(list.get(2));
-        }
+        invigilateListDetailBean.setWarningCount(warningCount);
+        invigilateListDetailBean.setMultipleFaceCount(warningMultipleFaceCount);
+        invigilateListDetailBean.setExceptionCount(exceptionCount);
 
         //2020/11/24新增管理员不清除预警状态
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();

+ 12 - 12
themis-business/src/main/java/com/qmth/themis/business/cache/ExamRecordCacheUtil.java

@@ -264,7 +264,7 @@ public class ExamRecordCacheUtil {
         redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.already_break_count.getCode(), alreadyBreakCountBean);
     }
 
-    public static AlreadyBreakCountBean getAlreadyBreakCountBean(Long recordId) {
+    private static AlreadyBreakCountBean getAlreadyBreakCountBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.already_break_count.getCode())) ?
                 (AlreadyBreakCountBean) redisUtil
@@ -272,7 +272,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static InProcessLivenessVerifyCountBean getInProcessLivenessVerifyCountBean(Long recordId) {
+    private static InProcessLivenessVerifyCountBean getInProcessLivenessVerifyCountBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.in_process_liveness_verify_count.getCode())) ?
                 (InProcessLivenessVerifyCountBean) redisUtil
@@ -280,7 +280,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static WarningCountBean getWarningCountBean(Long recordId) {
+    private static WarningCountBean getWarningCountBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_count.getCode())) ?
                 (WarningCountBean) redisUtil
@@ -288,7 +288,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static WarningUnreadBean getWarningUnreadBean(Long recordId) {
+    private static WarningUnreadBean getWarningUnreadBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_unread.getCode())) ?
                 (WarningUnreadBean) redisUtil
@@ -296,7 +296,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static WarningMultipleFaceCountBean getWarningMultipleFaceCountBean(Long recordId) {
+    private static WarningMultipleFaceCountBean getWarningMultipleFaceCountBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.warning_multiple_face_count.getCode())) ?
                 (WarningMultipleFaceCountBean) redisUtil
@@ -304,7 +304,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static ExceptionCountBean getExceptionCountBean(Long recordId) {
+    private static ExceptionCountBean getExceptionCountBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.exception_count.getCode())) ?
                 (ExceptionCountBean) redisUtil
@@ -312,7 +312,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static ExamStatusBean getStatusBean(Long recordId) {
+    private static ExamStatusBean getStatusBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.status.getCode())) ?
                 (ExamStatusBean) redisUtil
@@ -320,7 +320,7 @@ public class ExamRecordCacheUtil {
                 null;
     }
 
-    public static BreachStatusBean getBreachStatusBean(Long recordId) {
+    private static BreachStatusBean getBreachStatusBean(Long recordId) {
         return Objects.nonNull(
                 redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.breach_status.getCode())) ?
                 (BreachStatusBean) redisUtil
@@ -523,7 +523,7 @@ public class ExamRecordCacheUtil {
         }
     }
 
-    public static MonitorStatusBean getMonitorStatusBean(Long recordId, MonitorVideoSourceEnum source) {
+    private static MonitorStatusBean getMonitorStatusBean(Long recordId, MonitorVideoSourceEnum source) {
         return Objects.nonNull(redisUtil
                 .get(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name())) ?
                 (MonitorStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
@@ -558,7 +558,7 @@ public class ExamRecordCacheUtil {
         }
     }
 
-    public static MonitorCallStatusBean getMonitorCallStatusBean(Long recordId, MonitorVideoSourceEnum source) {
+    private static MonitorCallStatusBean getMonitorCallStatusBean(Long recordId, MonitorVideoSourceEnum source) {
         return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
                 SystemConstant.MONITOR_CALL_STATUS_ + source.name())) ?
                 (MonitorCallStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
@@ -584,7 +584,7 @@ public class ExamRecordCacheUtil {
         }
     }
 
-    public static MobileWebsocketStatusBean getMobileFirstWebsocketStatusBean(Long recordId) {
+    private static MobileWebsocketStatusBean getMobileFirstWebsocketStatusBean(Long recordId) {
         return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
                 ExamRecordFieldEnum.mobile_first_websocket_status.getCode())) ?
                 (MobileWebsocketStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
@@ -618,7 +618,7 @@ public class ExamRecordCacheUtil {
         }
     }
 
-    public static ClientWebsocketStatusBean getClientWebsocketStatusBean(Long recordId) {
+    private static ClientWebsocketStatusBean getClientWebsocketStatusBean(Long recordId) {
         return Objects.nonNull(redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),
                 ExamRecordFieldEnum.client_websocket_status.getCode())) ?
                 (ClientWebsocketStatusBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId),