|
@@ -59,6 +59,8 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
|
|
|
private CameraLogDetailMapper cameraLogDetailMapper;
|
|
|
@Autowired
|
|
|
private CameraUpdateLogMapper cameraUpdateLogMapper;
|
|
|
+ @Autowired
|
|
|
+ private BaseRailwayManagementMapper baseRailwayManagementMapper;
|
|
|
|
|
|
/**
|
|
|
* 相机台账管理表导入
|
|
@@ -347,4 +349,54 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
|
|
|
public List<DeviceStateResp> deviceStateRespList(DeviceStateResp deviceStateResp) {
|
|
|
return baseCameraManagementMapper.deviceStatePage(deviceStateResp);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult cameraStateTotal() {
|
|
|
+ int count;
|
|
|
+ int unresolvedCount;
|
|
|
+ //找出所有相机数据
|
|
|
+ List<BaseCameraManagement> list = this.list();
|
|
|
+ //异常的相机
|
|
|
+ List<BaseDeviceDynamicManagement> alarmList = baseDeviceDynamicManagementMapper.selectList(new LambdaQueryWrapper<BaseDeviceDynamicManagement>()
|
|
|
+ .eq(BaseDeviceDynamicManagement::getIsDisable, 2)
|
|
|
+ .or().le(BaseDeviceDynamicManagement::getElectricity,10));
|
|
|
+ HashMap<String, Integer> map = new HashMap<>();
|
|
|
+ if (!ObjectUtils.isEmpty(list)) {
|
|
|
+ //找出所有相机数据
|
|
|
+ //找出所有相机数据 1=高铁的数量
|
|
|
+ count = (int) list.stream()
|
|
|
+ .map(management -> baseRailwayManagementMapper.selectOne(new LambdaQueryWrapper<BaseRailwayManagement>()
|
|
|
+ .eq(BaseRailwayManagement::getRailwayCode, management.getRailwayCode()))) // 确保管理信息不是空的
|
|
|
+ .filter(Objects::nonNull) // 确保 baseRailwayManagement 不是 null
|
|
|
+ .filter(baseRailwayManagement -> baseRailwayManagement.getRailwayType() == 1)
|
|
|
+ .count();
|
|
|
+ //普铁的数量
|
|
|
+ int pu = list.size() - count;
|
|
|
+ map.put("highCount", count);
|
|
|
+ map.put("puCount", pu);
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(alarmList)) {
|
|
|
+ //获取所有异常的相机
|
|
|
+ //找出所有异常的相机 1=高铁的数量
|
|
|
+ unresolvedCount = (int) alarmList.stream()
|
|
|
+ .map(base -> baseCameraManagementMapper.selectOne(new LambdaQueryWrapper<BaseCameraManagement>()
|
|
|
+ .eq(BaseCameraManagement::getCameraCode, base)))
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(management -> baseRailwayManagementMapper.selectOne(new LambdaQueryWrapper<BaseRailwayManagement>()
|
|
|
+ .eq(BaseRailwayManagement::getRailwayCode, management.getRailwayCode()))) // 确保管理信息不是空的
|
|
|
+ .filter(Objects::nonNull) // 确保 baseRailwayManagement 不是 null
|
|
|
+ .filter(baseRailwayManagement -> baseRailwayManagement.getRailwayType() == 1)
|
|
|
+ .count();
|
|
|
+ //普铁的数量
|
|
|
+ int puUnresolvedCount = alarmList.size() - unresolvedCount;
|
|
|
+ map.put("highStateCount", unresolvedCount);
|
|
|
+ map.put("puStateCount", puUnresolvedCount);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult cameraStateList() {
|
|
|
+ return AjaxResult.success(baseRailwayManagementMapper.cameraStateList());
|
|
|
+ }
|
|
|
}
|