diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index da37623..112dc6a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -175,7 +175,10 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl { +public interface EcologyFlowStationMapper extends UserDataScopeBaseMapper { } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java index c5d6ccb..ae38832 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java @@ -98,9 +98,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl stations = this.list(Wrappers.lambdaQuery() - .eq(EcologyFlowStationEntity::getCreateDept,deptId)); + public EcologFlowStationVo station_top() { + List stations = this.list(); if(CollectionUtil.isEmpty(stations)){ return new EcologFlowStationVo(); } @@ -113,7 +112,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl datas = dataService.list(Wrappers.lambdaQuery() .like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM")) - .in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()))); + .in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList())) + ); if(CollectionUtil.isEmpty(datas)){ return station; } @@ -134,14 +134,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl trend_chart(Long deptId,String type) { - List stations = this.list(Wrappers.lambdaQuery() - .eq(EcologyFlowStationEntity::getCreateDept,deptId)); - if(CollectionUtil.isEmpty(stations)){ - return new ArrayList<>(); - } + public List trend_chart(String type) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList())); if("0".equals(type)){ wrapper.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy")); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index 9cd48e0..ecd45f6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java @@ -452,6 +452,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService { }); // 设备状态 this.getDeviceParam(emList, deviceClassifyMap, deviceList); + // 运行设备状态设置 + this.deviceState(deviceList); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); stationList.add(station); }); @@ -473,6 +475,29 @@ public class RealMonitorServiceImpl implements IRealMonitorService { } /** + * 设备状态 + * @param deviceList + */ + private void deviceState(List deviceList) { + deviceList.forEach(device->{ + // 设备属性列表 + List attbts = device.getAttbtList(); + if(CollectionUtil.isEmpty(attbts)){ + return; + } + // 功率属性记录 + List powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(powers)){ + return; + } + if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){ + return; + } + device.setState(1); + }); + } + + /** * 设置站点状态 * @param alarmList * @param station diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java index b272e38..e1e605d 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java @@ -1,11 +1,12 @@ package com.hnac.hzims.weather.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.hzimsweather.entity.VStationEntity; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; /** * @author hx */ -public interface StationMapper extends UserDataScopeBaseMapper { +public interface StationMapper extends BaseMapper { }