Browse Source

#集中监控状态修改

zhongwei
yang_shj 1 year ago
parent
commit
21828d9bbe
  1. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java
  2. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
  3. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java

@ -1,11 +1,11 @@
package com.hnac.hzims.operational.ecology.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author YSJ
*/
public interface EcologyFlowStationMapper extends BaseMapper<EcologyFlowStationEntity> {
public interface EcologyFlowStationMapper extends UserDataScopeBaseMapper<EcologyFlowStationEntity> {
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java

@ -110,8 +110,10 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
station.setTimely(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
station.setCount(stations.size());
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery().
like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM")));
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery()
.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))
.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()))
);
if(CollectionUtil.isEmpty(datas)){
return station;
}

25
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<RealDeviceVo> deviceList) {
deviceList.forEach(device->{
// 设备属性列表
List<RealAttributeVo> attbts = device.getAttbtList();
if(CollectionUtil.isEmpty(attbts)){
return;
}
// 功率属性记录
List<RealAttributeVo> 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

Loading…
Cancel
Save