gao.qiang 10 miesięcy temu
rodzic
commit
d129901dce

+ 5 - 19
business-service/src/main/java/com/ozs/service/service/impl/MsgAlarmServiceImpl.java

@@ -158,17 +158,21 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
 
     @Override
     public void getNormalBaseCameraManagementsCache(String setType) {
-        log.info("---------setType-----------"+setType);
+        log.info("-----------setType------"+setType);
         Set<BaseCameraVO> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
+        log.info("-----------alarmSet------"+alarmSet);
         if(!CollectionUtils.isEmpty(alarmSet)) {
             Set<String> cameraCodeSet = alarmSet.stream()
                     .map(BaseCameraVO::getCameraCode)
                     .collect(Collectors.toSet());
+            log.info("-----------cameraCodeSet------"+cameraCodeSet);
             QueryWrapper<BaseCameraManagement> queryWrapper = new QueryWrapper<>();
+            log.info("-----------Constants.ALARM_SET------"+Constants.ALARM_SET);
             if (Constants.ALARM_SET.equals(setType)) {
                 // 使用QueryWrapper和notin方法根据cameraCode列表查询BaseCameraManagement数据
                 queryWrapper.notIn("camera_code", cameraCodeSet);
                 Set<BaseCameraManagement> set = baseCameraManagementMapper.selectList(queryWrapper).stream().collect(Collectors.toSet());
+                log.info("-----------set------"+set);
                 set.forEach(item -> {
                     BaseCameraVO baseCameraVO = new BaseCameraVO();
                     baseCameraVO.setCameraCode(item.getCameraCode());
@@ -176,24 +180,6 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
                     redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
                 });
             }
-        log.info("---------alarmSet-----------"+alarmSet);
-        Set<String> cameraCodeSet = alarmSet.stream()
-                .map(BaseCameraVO::getCameraCode)
-                .collect(Collectors.toSet());
-        QueryWrapper<BaseCameraManagement> queryWrapper = new QueryWrapper<>();
-        log.info("---------Constants.ALARM_SET-----------"+Constants.ALARM_SET);
-        if(Constants.ALARM_SET.equals(setType)) {
-            log.info("---------cameraCodeSet----------"+cameraCodeSet);
-            // 使用QueryWrapper和notin方法根据cameraCode列表查询BaseCameraManagement数据
-            queryWrapper.notIn("camera_code", cameraCodeSet);
-            Set<BaseCameraManagement> set = baseCameraManagementMapper.selectList(queryWrapper).stream().collect(Collectors.toSet());
-            log.info("---------set----------"+set);
-            set.forEach(item -> {
-                BaseCameraVO  baseCameraVO=new BaseCameraVO();
-                baseCameraVO.setCameraCode(item.getCameraCode());
-                baseCameraVO.setChannel(item.getChannel());
-                redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
-            });
         }
     }