|
@@ -1,28 +1,20 @@
|
|
|
package com.ozs.service.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.ozs.common.constant.Constants;
|
|
|
-import com.ozs.common.core.redis.RedisCache;
|
|
|
-import com.ozs.common.utils.AppendUtils;
|
|
|
-import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.service.entity.BaseCameraManagement;
|
|
|
-import com.ozs.service.entity.BaseUser;
|
|
|
import com.ozs.service.entity.MsgAlarm;
|
|
|
import com.ozs.service.entity.vo.*;
|
|
|
import com.ozs.service.mapper.BaseCameraManagementMapper;
|
|
|
-import com.ozs.service.mapper.BaseUserMapper;
|
|
|
import com.ozs.service.mapper.MsgAlarmMapper;
|
|
|
import com.ozs.service.service.MsgAlarmService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ozs.service.service.RedisService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -164,14 +156,17 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
|
|
|
|
|
|
@Override
|
|
|
public void getNormalBaseCameraManagementsCache(String setType) {
|
|
|
- Set<BaseCameraManagement> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
|
|
|
+ Set<BaseCameraVO> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
|
|
|
QueryWrapper<BaseCameraManagement> queryWrapper = new QueryWrapper<>();
|
|
|
if(Constants.ALARM_SET.equals(setType)) {
|
|
|
// 使用QueryWrapper和notin方法根据cameraCode列表查询BaseCameraManagement数据
|
|
|
queryWrapper.notIn("camera_code", alarmSet);
|
|
|
Set<BaseCameraManagement> set = baseCameraManagementMapper.selectList(queryWrapper).stream().collect(Collectors.toSet());
|
|
|
set.forEach(item -> {
|
|
|
- redisService.addToSet(Constants.NORMAL_SET, item);
|
|
|
+ BaseCameraVO baseCameraVO=new BaseCameraVO();
|
|
|
+ baseCameraVO.setCameraCode(item.getCameraCode());
|
|
|
+ baseCameraVO.setChannel(item.getChannel());
|
|
|
+ redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -182,7 +177,10 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
|
|
|
if (lockedMsgAlarms.isEmpty()) {
|
|
|
Set<BaseCameraManagement> normalSet = baseCameraManagementMapper.selectList(null).stream().collect(Collectors.toSet());
|
|
|
normalSet.forEach(item ->{
|
|
|
- redisService.addToSet(Constants.NORMAL_SET,item);
|
|
|
+ BaseCameraVO baseCameraVO=new BaseCameraVO();
|
|
|
+ baseCameraVO.setCameraCode(item.getCameraCode());
|
|
|
+ baseCameraVO.setChannel(item.getChannel());
|
|
|
+ redisService.addToSet(Constants.NORMAL_SET,baseCameraVO);
|
|
|
});
|
|
|
redisService.addToSet(Constants.ALARM_SET,null);
|
|
|
}
|
|
@@ -192,13 +190,19 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
|
|
|
queryWrapperAlarm.in("camera_code", cameraCodeSet);
|
|
|
Set<BaseCameraManagement> alarmSet = baseCameraManagementMapper.selectList(queryWrapperAlarm).stream().collect(Collectors.toSet());
|
|
|
alarmSet.forEach(item->{
|
|
|
- redisService.addToSet(Constants.ALARM_SET, item);
|
|
|
+ BaseCameraVO baseCameraVO=new BaseCameraVO();
|
|
|
+ baseCameraVO.setCameraCode(item.getCameraCode());
|
|
|
+ baseCameraVO.setChannel(item.getChannel());
|
|
|
+ redisService.addToSet(Constants.ALARM_SET, baseCameraVO);
|
|
|
});
|
|
|
QueryWrapper<BaseCameraManagement> queryWrapperNormal = new QueryWrapper<>();
|
|
|
queryWrapperNormal.notIn("camera_code", cameraCodeSet);
|
|
|
Set<BaseCameraManagement> normalSet = baseCameraManagementMapper.selectList(queryWrapperNormal).stream().collect(Collectors.toSet());
|
|
|
normalSet.forEach(item->{
|
|
|
- redisService.addToSet(Constants.NORMAL_SET, item);
|
|
|
+ BaseCameraVO baseCameraVO=new BaseCameraVO();
|
|
|
+ baseCameraVO.setCameraCode(item.getCameraCode());
|
|
|
+ baseCameraVO.setChannel(item.getChannel());
|
|
|
+ redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
|
|
|
});
|
|
|
}
|
|
|
|