|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.hnac.hzims.equipment.entity.PlanGenerationEntity; |
|
|
|
import com.hnac.hzims.equipment.entity.PlanGenerationEntity; |
|
|
|
import com.hnac.hzims.equipment.feign.IPlanGenertionClient; |
|
|
|
import com.hnac.hzims.equipment.feign.IPlanGenertionClient; |
|
|
|
|
|
|
|
import com.hnac.hzims.equipment.vo.DevicePlanGenerationVo; |
|
|
|
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; |
|
|
|
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; |
|
|
|
import com.hnac.hzims.hzimsweather.response.weather.Daily; |
|
|
|
import com.hnac.hzims.hzimsweather.response.weather.Daily; |
|
|
|
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; |
|
|
|
import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; |
|
|
@ -133,7 +134,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
// 年发电量
|
|
|
|
// 年发电量
|
|
|
|
score.setGenerateYear(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy"))).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
score.setGenerateYear(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy"))).mapToDouble(WindEntity::getPower).sum()); |
|
|
|
// 年计划发电量
|
|
|
|
// 年计划发电量
|
|
|
|
List<PlanGenerationEntity> yearPlans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()),null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> yearPlans = planClient.getPlanGenerationByParam(param); |
|
|
|
score.setPlanYear(yearPlans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
score.setPlanYear(yearPlans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
// 年发电完成率
|
|
|
|
// 年发电完成率
|
|
|
|
if(Math.abs(score.getGenerateYear()) > 0 && Math.abs(score.getPlanYear()) > 0){ |
|
|
|
if(Math.abs(score.getGenerateYear()) > 0 && Math.abs(score.getPlanYear()) > 0){ |
|
|
@ -198,7 +202,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<PowerMonthVo> currentGenerateCurve(List<WindEntity> winds) { |
|
|
|
private List<PowerMonthVo> currentGenerateCurve(List<WindEntity> winds) { |
|
|
|
List<String> mons = this.mons(0,12,false); |
|
|
|
List<String> mons = this.mons(0,12,false); |
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(winds.stream().map(WindEntity::getStationCode).distinct().collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(winds.stream().map(WindEntity::getStationCode).distinct().collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
return mons.stream().map(mon->{ |
|
|
|
return mons.stream().map(mon->{ |
|
|
|
PowerMonthVo power = new PowerMonthVo(); |
|
|
|
PowerMonthVo power = new PowerMonthVo(); |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
@ -268,7 +275,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
subordinate.setGenerationRate(0.0); |
|
|
|
subordinate.setGenerationRate(0.0); |
|
|
|
} |
|
|
|
} |
|
|
|
// 计划发电量查询
|
|
|
|
// 计划发电量查询
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); |
|
|
|
double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); |
|
|
|
// 发电完成率
|
|
|
|
// 发电完成率
|
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(plan) > 0){ |
|
|
|
if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(plan) > 0){ |
|
|
@ -329,7 +339,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
// 装机容量
|
|
|
|
// 装机容量
|
|
|
|
kpi.setCapacity(devices.stream().filter(o->stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(o.getCreateDept())).mapToDouble(EminfoAndEmParamVo::getInstalledCapacity).sum()); |
|
|
|
kpi.setCapacity(devices.stream().filter(o->stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(o.getCreateDept())).mapToDouble(EminfoAndEmParamVo::getInstalledCapacity).sum()); |
|
|
|
// 计划发电量
|
|
|
|
// 计划发电量
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
kpi.setPlan(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
kpi.setPlan(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
// 实际发电量
|
|
|
|
// 实际发电量
|
|
|
|
kpi.setGenerate(winds.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
kpi.setGenerate(winds.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
@ -384,7 +397,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy")); |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy")); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
// 计划发电量
|
|
|
|
// 计划发电量
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(codes, null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(codes); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
return areas.entrySet().stream().map(entry -> { |
|
|
|
return areas.entrySet().stream().map(entry -> { |
|
|
|
WindAreaVo area = new WindAreaVo(); |
|
|
|
WindAreaVo area = new WindAreaVo(); |
|
|
|
area.setDeptId(entry.getKey().getId()); |
|
|
|
area.setDeptId(entry.getKey().getId()); |
|
|
@ -525,7 +541,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy-MM")); |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy-MM")); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
// 计划发电量
|
|
|
|
// 计划发电量
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy-MM")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy-MM")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
if(CollectionUtil.isNotEmpty(windMons)){ |
|
|
|
if(CollectionUtil.isNotEmpty(windMons)){ |
|
|
|
areaDuty.setGenerateMon(windMons.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
areaDuty.setGenerateMon(windMons.stream().mapToDouble(WindEntity::getPower).sum()); |
|
|
|
// 月计划发电量
|
|
|
|
// 月计划发电量
|
|
|
@ -829,7 +848,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy")); |
|
|
|
.like(WindEntity::getFillDate,DateUtil.format(new Date(),"yyyy")); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
// 计划发电量
|
|
|
|
// 计划发电量
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
// 设备
|
|
|
|
// 设备
|
|
|
|
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {}); |
|
|
|
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {}); |
|
|
|
subordinate.setStations(stations.stream().map(station -> { |
|
|
|
subordinate.setStations(stations.stream().map(station -> { |
|
|
@ -953,7 +975,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
.eq(WindEntity::getStationCode,station.getCode()) |
|
|
|
.eq(WindEntity::getStationCode,station.getCode()) |
|
|
|
); |
|
|
|
); |
|
|
|
// 计划发电量
|
|
|
|
// 计划发电量
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(Collections.singletonList(station.getCode()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(Collections.singletonList(station.getCode())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
if(CollectionUtil.isNotEmpty(all)){ |
|
|
|
if(CollectionUtil.isNotEmpty(all)){ |
|
|
|
// 年计划发电量
|
|
|
|
// 年计划发电量
|
|
|
|
wind.setPlanYear(plans.stream().filter(o->o.getDateTime().contains(DateUtil.format(new Date(),"yyyy"))).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
|
wind.setPlanYear(plans.stream().filter(o->o.getDateTime().contains(DateUtil.format(new Date(),"yyyy"))).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); |
|
|
@ -997,7 +1022,10 @@ public class WindHomeServiceImpl implements WindHomeService { |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> monList = this.mons(1,12,false); |
|
|
|
List<String> monList = this.mons(1,12,false); |
|
|
|
// 计划发电量查询
|
|
|
|
// 计划发电量查询
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(Collections.singletonList(station.getCode()), null,DateUtil.format(new Date(),"yyyy")); |
|
|
|
DevicePlanGenerationVo param = new DevicePlanGenerationVo(); |
|
|
|
|
|
|
|
param.setStationIds(Collections.singletonList(station.getCode())); |
|
|
|
|
|
|
|
param.setDate(DateUtil.format(new Date(),"yyyy")); |
|
|
|
|
|
|
|
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(param); |
|
|
|
return monList.stream().map(mon->{ |
|
|
|
return monList.stream().map(mon->{ |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
LocalDate localDate = LocalDate.parse(DateUtil.format(new Date(), mon), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); |
|
|
|
WindGenerationVo generation = new WindGenerationVo(); |
|
|
|
WindGenerationVo generation = new WindGenerationVo(); |
|
|
|