|
|
@ -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<>(); |
|
|
|
} |
|
|
|
} |
|
|
|