Browse Source

#集中监控状态修改

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

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java

@ -51,7 +51,7 @@ public class EcologyController extends BladeController {
* 站点数据排行 * 站点数据排行
* @return * @return
*/ */
@PostMapping("/station_top") @PostMapping("/station_top")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "站点数据及达标率排行", notes = "站点数据及达标率排行") @ApiOperation(value = "站点数据及达标率排行", notes = "站点数据及达标率排行")
public R station_top() { public R station_top() {

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; package com.hnac.hzims.operational.ecology.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity; import com.hnac.hzims.operational.ecology.entity.EcologyFlowStationEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/** /**
* @author YSJ * @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.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()); station.setCount(stations.size());
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery(). List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery()
like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))); .like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))
.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()))
);
if(CollectionUtil.isEmpty(datas)){ if(CollectionUtil.isEmpty(datas)){
return station; 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.getDeviceParam(emList, deviceClassifyMap, deviceList);
// 运行设备状态设置
this.deviceState(deviceList);
station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList())); station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList()));
stationList.add(station); 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 alarmList
* @param station * @param station

Loading…
Cancel
Save