|
|
|
@ -222,7 +222,6 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
// 有效站点机组指标数据
|
|
|
|
|
List<HydropowerUnitTargetVo> validTargetList = targetList.stream().filter(o-> null != station.getRefDept() && station.getRefDept().equals(o.getDeptId())).collect(Collectors.toList()); |
|
|
|
|
List<DeviceVo> list = new ArrayList<>(); |
|
|
|
|
Random random = new Random(); |
|
|
|
|
for(HydropowerUnitRealVo real : validRealList){ |
|
|
|
|
DeviceVo device= new DeviceVo(); |
|
|
|
|
// 设备编号
|
|
|
|
@ -231,10 +230,10 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
device.setState(real.getState()); |
|
|
|
|
device.setActive(real.getActivePower()); |
|
|
|
|
device.setReactive(real.getReactivePower()); |
|
|
|
|
device.setEcology(random.nextDouble() * 20000); |
|
|
|
|
device.setAdjust(random.nextDouble() * 20000); |
|
|
|
|
device.setDischarge(random.nextDouble() * 20000); |
|
|
|
|
device.setGenerate(random.nextDouble() * 20000); |
|
|
|
|
device.setEcology(0.0); |
|
|
|
|
device.setAdjust(0.0); |
|
|
|
|
device.setDischarge(0.0); |
|
|
|
|
device.setGenerate(0.0); |
|
|
|
|
list.add(device); |
|
|
|
|
} |
|
|
|
|
return list.stream().sorted(Comparator.comparing(DeviceVo::getDeviceCode)).collect(Collectors.toList()); |
|
|
|
@ -247,8 +246,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
* @param station |
|
|
|
|
*/ |
|
|
|
|
private void handleWaterLeve(String code, StationVo station) { |
|
|
|
|
Random random = new Random(); |
|
|
|
|
station.setWater(random.nextDouble() * 100); |
|
|
|
|
station.setWater(0.0); |
|
|
|
|
List<WaterLevelVo> levelList = (List<WaterLevelVo>) redisTemplate.opsForValue().get(loadwater_level_key); |
|
|
|
|
if(CollectionUtil.isEmpty(levelList)){ |
|
|
|
|
return; |
|
|
|
@ -277,16 +275,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,3,3,code,HomePageConstant.FRONT_WATER_LEVEL); |
|
|
|
|
Random random = new Random(); |
|
|
|
|
if(CollectionUtil.isEmpty(records)){ |
|
|
|
|
List<WaterVo> waters = new ArrayList<>(); |
|
|
|
|
while (calendar.getTime().compareTo(new Date()) <= 0){ |
|
|
|
|
WaterVo water = new WaterVo(); |
|
|
|
|
water.setTime(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE)); |
|
|
|
|
water.setWater(random.nextDouble() * 100); |
|
|
|
|
water.setGenerate(random.nextDouble() * 50000); |
|
|
|
|
waters.add(water); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,1); |
|
|
|
|
} |
|
|
|
|
return waters; |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
return records.stream().map(record -> { |
|
|
|
|
WaterVo water = new WaterVo(); |
|
|
|
@ -294,9 +283,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
|
|
|
|
|
water.setTime(DateUtil.format(time,DateUtil.PATTERN_DATE)); |
|
|
|
|
water.setWater(Double.valueOf(Optional.ofNullable(record.getVal()).orElse("0"))); |
|
|
|
|
if(Math.abs(water.getWater()) == 0){ |
|
|
|
|
water.setWater(random.nextDouble() * 100); |
|
|
|
|
water.setWater(0.0); |
|
|
|
|
} |
|
|
|
|
water.setGenerate(random.nextDouble() * 50000); |
|
|
|
|
return water; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|