Browse Source

#风电接口

zhongwei
yang_shj 1 year ago
parent
commit
33dfcc0791
  1. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

@ -109,10 +109,7 @@ public class WindHomeServiceImpl implements WindHomeService {
@Override @Override
public WindScoreVo KPIs(Long deptId) { public WindScoreVo KPIs(Long deptId) {
// 查询风电站 // 查询风电站
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ List<StationEntity> stations = stationService.getHomeStationList(deptId,Collections.singletonList(HomePageConstant.WIND_POWER),HomePageConstant.HYDROPOWER_SERVETYPE);
eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE);
eq(StationEntity::getType,HomePageConstant.WIND_POWER);
}});
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){
return new WindScoreVo(); return new WindScoreVo();
} }
@ -268,14 +265,15 @@ public class WindHomeServiceImpl implements WindHomeService {
} }
// 风机利用率 : (总时间 - 故障时间) / 总时间 // 风机利用率 : (总时间 - 故障时间) / 总时间
double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum(); double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum();
double use = piece.stream().mapToDouble(WindEntity::getAvailable).sum();
if(Math.abs(fault) > 0 ){ if(Math.abs(fault) > 0 ){
subordinate.setFanUse(BigDecimal.valueOf(fault / (30 * 24) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
} }
// 厂用电率 : (发电量-上网电量+下网电量)/发电量 // 厂用电率 : (发电量-上网电量+下网电量)/发电量
double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum(); double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum();
double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum(); double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum();
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(surf + below) > 0){ if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(surf + below) > 0){
subordinate.setFactoryUse(BigDecimal.valueOf(subordinate.getGeneration() - surf + below / subordinate.getGeneration() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); subordinate.setFactoryUse(BigDecimal.valueOf((subordinate.getGeneration() - surf + below) / subordinate.getGeneration() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
} }
} }
return subordinate; return subordinate;

Loading…
Cancel
Save