Browse Source

截图定时优化

wyyay 10 months ago
parent
commit
3d4f33d844

+ 4 - 1
business-service/src/main/java/com/ozs/service/service/impl/MsgAlarmServiceImpl.java

@@ -157,10 +157,13 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
     @Override
     public void getNormalBaseCameraManagementsCache(String setType) {
         Set<BaseCameraVO> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
+        Set<String> cameraCodeSet = alarmSet.stream()
+                .map(BaseCameraVO::getCameraCode)
+                .collect(Collectors.toSet());
         QueryWrapper<BaseCameraManagement> queryWrapper = new QueryWrapper<>();
         if(Constants.ALARM_SET.equals(setType)) {
             // 使用QueryWrapper和notin方法根据cameraCode列表查询BaseCameraManagement数据
-            queryWrapper.notIn("camera_code", alarmSet);
+            queryWrapper.notIn("camera_code", cameraCodeSet);
             Set<BaseCameraManagement> set = baseCameraManagementMapper.selectList(queryWrapper).stream().collect(Collectors.toSet());
             set.forEach(item -> {
                 BaseCameraVO  baseCameraVO=new BaseCameraVO();