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 = "设备状态")
private Boolean state;
@ApiModelProperty(value = "容量")
private Double capacity;
@ApiModelProperty(value = "有功功率")
private Double active;
@ -31,9 +34,12 @@ public class DeviceVo {
@ApiModelProperty(value = "下泄流量")
private Double discharge;
@ApiModelProperty(value = "发电流量")
private Double generate;
@ApiModelProperty(value = "发电效率")
private Double generateRate;
@ApiModelProperty(value = "建议有功调整")
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 = "下泄流量")
private Double dischargeFlow;
@ApiModelProperty(value = "平均效率")
private Double generateRate;
@ApiModelProperty(value = "设备集合")
private List<DeviceVo> devices;
@ApiModelProperty(value = "设备集合")
@ApiModelProperty(value = "水位曲线集合")
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 = "水位")
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);
station.setDevices(this.devices(item,station.getDischargeFlow(),realList,targetList));
// 站点平均效率
this.generateRate(station);
// 查询站点模型列表
HzimsAnalyzeModelStationEntity model = modelStationService.getOne(new LambdaQueryWrapper<HzimsAnalyzeModelStationEntity>() {{
eq(HzimsAnalyzeModelStationEntity::getStationId, item.getCode());
}});
// 水位曲线
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;
}).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
* @return
@ -225,18 +249,24 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
for(HydropowerUnitRealVo real : validRealList){
DeviceVo device= new DeviceVo();
// 设备编号
device.setCapacity(real.getInstalledCapacity());
device.setDeviceCode(real.getDeviceCode());
device.setDeviceName(real.getDeviceName());
device.setOrd(real.getOrd());
device.setState(real.getState());
device.setActive(real.getActivePower());
device.setReactive(real.getReactivePower());
device.setDischarge(dischargeFlow);
device.setEcology(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);
}
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
* @return
*/
private List<WaterVo> water(String code) {
private List<WaterVo> water(String code,String signages) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-7);
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));
String start = DateUtil.format(calendar.getTime(), 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);
Random random = new Random();
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,3,3,code,signages);
if(CollectionUtil.isEmpty(records)){
return new ArrayList<>();
}

Loading…
Cancel
Save