wangliang 4 년 전
부모
커밋
7042fc4ca1
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      themis-business/src/main/java/com/qmth/themis/business/cache/ExamRecordCacheUtil.java

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

@@ -263,7 +263,9 @@ public class ExamRecordCacheUtil {
                 monitorStatusBean.setTimestamp(timestamp);
             }
         }
-        redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name(), monitorStatusBean);
+        if (Objects.nonNull(getStatus(recordId))) {
+            redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_STATUS_ + source.name(), monitorStatusBean);
+        }
     }
 
     public static MonitorCallStatusSourceEnum getMonitorCallStatus(Long recordId, MonitorVideoSourceEnum source) {
@@ -289,7 +291,9 @@ public class ExamRecordCacheUtil {
                 monitorCallStatusBean.setTimestamp(timestamp);
             }
         }
-        redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name(), monitorCallStatusBean);
+        if (Objects.nonNull(getStatus(recordId))) {
+            redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), SystemConstant.MONITOR_CALL_STATUS_ + source.name(), monitorCallStatusBean);
+        }
     }
 
     public static ClientWebsocketStatusBean getClientWebsocketStatusBean(Long recordId) {
@@ -323,7 +327,9 @@ public class ExamRecordCacheUtil {
                 clientWebsocketStatusBean.setTimestamp(timestamp);
             }
         }
-        redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode(), clientWebsocketStatusBean);
+        if (Objects.nonNull(getStatus(recordId))) {
+            redisUtil.set(RedisKeyHelper.examRecordCacheKey(recordId), ExamRecordFieldEnum.client_websocket_status.getCode(), clientWebsocketStatusBean);
+        }
     }
 
     public static void setClientCurrentIp(Long recordId, String ip) {