|
@@ -13,6 +13,7 @@ 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 lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -29,6 +30,7 @@ import java.util.stream.Collectors;
|
|
|
* @since 2023-02-22
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> implements MsgAlarmService {
|
|
|
@Autowired
|
|
|
private MsgAlarmMapper msgAlarmMapper;
|
|
@@ -156,16 +158,21 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
|
|
|
|
|
|
@Override
|
|
|
public void getNormalBaseCameraManagementsCache(String 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());
|