Browse Source

#风电

zhongwei
yang_shj 1 year ago
parent
commit
0eeb193158
  1. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/DeviceVo.java
  2. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/StationVo.java
  3. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/WaterVo.java
  4. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java

10
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/DeviceVo.java

@ -19,6 +19,9 @@ public class DeviceVo {
@ApiModelProperty(value = "设备状态") @ApiModelProperty(value = "设备状态")
private Boolean state; private Boolean state;
@ApiModelProperty(value = "容量")
private Double capacity;
@ApiModelProperty(value = "有功功率") @ApiModelProperty(value = "有功功率")
private Double active; private Double active;
@ -31,9 +34,12 @@ public class DeviceVo {
@ApiModelProperty(value = "下泄流量") @ApiModelProperty(value = "下泄流量")
private Double discharge; private Double discharge;
@ApiModelProperty(value = "发电流量") @ApiModelProperty(value = "发电效率")
private Double generate; private Double generateRate;
@ApiModelProperty(value = "建议有功调整") @ApiModelProperty(value = "建议有功调整")
private Double adjust; private Double adjust;
@ApiModelProperty(value = "排序")
private Integer ord;
} }

8
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/StationVo.java

@ -27,9 +27,15 @@ public class StationVo {
@ApiModelProperty(value = "下泄流量") @ApiModelProperty(value = "下泄流量")
private Double dischargeFlow; private Double dischargeFlow;
@ApiModelProperty(value = "平均效率")
private Double generateRate;
@ApiModelProperty(value = "设备集合") @ApiModelProperty(value = "设备集合")
private List<DeviceVo> devices; private List<DeviceVo> devices;
@ApiModelProperty(value = "设备集合") @ApiModelProperty(value = "水位曲线集合")
private List<WaterVo> waters; private List<WaterVo> waters;
@ApiModelProperty(value = "下泄流量集合")
List<WaterVo> discharges;
} }

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/vo/WaterVo.java

@ -15,4 +15,7 @@ public class WaterVo {
@ApiModelProperty(value = "水位") @ApiModelProperty(value = "水位")
private Double water; private Double water;
@ApiModelProperty(value = "下泄流量")
private Double discharge;
} }

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

@ -196,19 +196,43 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
// 实时水位 // 实时水位
this.handleWaterLeve(item.getCode(),station); this.handleWaterLeve(item.getCode(),station);
station.setDevices(this.devices(item,station.getDischargeFlow(),realList,targetList)); station.setDevices(this.devices(item,station.getDischargeFlow(),realList,targetList));
// 站点平均效率
this.generateRate(station);
// 查询站点模型列表 // 查询站点模型列表
HzimsAnalyzeModelStationEntity model = modelStationService.getOne(new LambdaQueryWrapper<HzimsAnalyzeModelStationEntity>() {{ HzimsAnalyzeModelStationEntity model = modelStationService.getOne(new LambdaQueryWrapper<HzimsAnalyzeModelStationEntity>() {{
eq(HzimsAnalyzeModelStationEntity::getStationId, item.getCode()); eq(HzimsAnalyzeModelStationEntity::getStationId, item.getCode());
}}); }});
// 水位曲线 // 水位曲线
if(ObjectUtil.isNotEmpty(model)){ if(ObjectUtil.isNotEmpty(model)){
station.setWaters(this.water(model.getInstanceCode())); List<WaterVo> waters = this.water(model.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL);
List<WaterVo> discharges = this.water(model.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW);
station.setWaters(waters.stream().peek(water->{
water.setDischarge(0.0);
List<WaterVo> filter = discharges.stream().filter(discharge->water.getTime().equals(discharge.getTime())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(filter)){
water.setDischarge(filter.get(0).getWater());
}
}).collect(Collectors.toList()));
station.setDischarges(discharges);
} }
return station; return station;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
/** /**
* 站点平均发电效率
*/
private void generateRate(StationVo station) {
double capacitySum = station.getDevices().stream().mapToDouble(DeviceVo::getCapacity).sum();
double activeSum = station.getDevices().stream().mapToDouble(DeviceVo::getActive).sum();
if(Math.abs(capacitySum) <=0 || Math.abs(activeSum) <= 0){
station.setGenerateRate(0.0);
}else{
station.setGenerateRate(BigDecimal.valueOf(activeSum / capacitySum * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
}
/**
* 获取站点设备信息 * 获取站点设备信息
* @param station * @param station
* @return * @return
@ -225,18 +249,24 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
for(HydropowerUnitRealVo real : validRealList){ for(HydropowerUnitRealVo real : validRealList){
DeviceVo device= new DeviceVo(); DeviceVo device= new DeviceVo();
// 设备编号 // 设备编号
device.setCapacity(real.getInstalledCapacity());
device.setDeviceCode(real.getDeviceCode()); device.setDeviceCode(real.getDeviceCode());
device.setDeviceName(real.getDeviceName()); device.setDeviceName(real.getDeviceName());
device.setOrd(real.getOrd());
device.setState(real.getState()); device.setState(real.getState());
device.setActive(real.getActivePower()); device.setActive(real.getActivePower());
device.setReactive(real.getReactivePower()); device.setReactive(real.getReactivePower());
device.setDischarge(dischargeFlow); device.setDischarge(dischargeFlow);
device.setEcology(0.0); device.setEcology(0.0);
device.setAdjust(0.0); device.setAdjust(0.0);
device.setGenerate(0.0); if(Math.abs(device.getActive()) <=0 || Math.abs(device.getCapacity()) <= 0){
device.setGenerateRate(0.0);
}else{
device.setGenerateRate(BigDecimal.valueOf(device.getActive() / device.getCapacity() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
list.add(device); list.add(device);
} }
return list.stream().sorted(Comparator.comparing(DeviceVo::getDeviceCode)).collect(Collectors.toList()); return list.stream().sorted(Comparator.comparing(DeviceVo::getOrd)).collect(Collectors.toList());
} }
@ -266,7 +296,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
* @param code * @param code
* @return * @return
*/ */
private List<WaterVo> water(String code) { private List<WaterVo> water(String code,String signages) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-7); calendar.add(Calendar.DAY_OF_MONTH,-7);
calendar.add(Calendar.HOUR_OF_DAY, -calendar.get(Calendar.HOUR_OF_DAY)); calendar.add(Calendar.HOUR_OF_DAY, -calendar.get(Calendar.HOUR_OF_DAY));
@ -274,8 +304,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND)); calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND));
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,3,3,code,HomePageConstant.FRONT_WATER_LEVEL); List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,3,3,code,signages);
Random random = new Random();
if(CollectionUtil.isEmpty(records)){ if(CollectionUtil.isEmpty(records)){
return new ArrayList<>(); return new ArrayList<>();
} }

Loading…
Cancel
Save