Browse Source

#首页优化

zhongwei
yang_shj 3 months ago
parent
commit
60bc9b94d0
  1. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -228,7 +228,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 容量 // 容量
area.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); area.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum());
// 负荷 // 负荷
area.setLoad(reals.stream().mapToDouble(o->{ area.setLoad(stationReals.stream().mapToDouble(o->{
if("MW".equalsIgnoreCase(o.getPowerUnit())){ if("MW".equalsIgnoreCase(o.getPowerUnit())){
return o.getActivePower() * 1000; return o.getActivePower() * 1000;
} }
@ -246,13 +246,13 @@ public class HydroelectricServiceImpl implements HydroelectricService {
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY); List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY);
if (CollectionUtil.isNotEmpty(targets)) { if (CollectionUtil.isNotEmpty(targets)) {
List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList()); List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(targets)) { if (CollectionUtil.isNotEmpty(stationTargets)) {
// 年发电量 // 年发电量
area.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); area.setGenerateYear(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
// 月发电量 // 月发电量
area.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); area.setGenerateMon(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum());
// 日发电量 // 日发电量
area.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); area.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
area.setGeneratePlanYear(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); area.setGeneratePlanYear(plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum());
if(area.getGeneratePlanYear() <= 0 || area.getGenerateYear() <= 0){ if(area.getGeneratePlanYear() <= 0 || area.getGenerateYear() <= 0){
@ -322,7 +322,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 容量 // 容量
group.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); group.setCapacity(stationReals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum());
// 负荷 // 负荷
group.setLoad(reals.stream().mapToDouble(o->{ group.setLoad(stationReals.stream().mapToDouble(o->{
if("MW".equalsIgnoreCase(o.getPowerUnit())){ if("MW".equalsIgnoreCase(o.getPowerUnit())){
return o.getActivePower() * 1000; return o.getActivePower() * 1000;
} }
@ -340,13 +340,13 @@ public class HydroelectricServiceImpl implements HydroelectricService {
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY); List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(LOAD_HYDROPOWER_TARGET_KEY);
if (CollectionUtil.isNotEmpty(targets)) { if (CollectionUtil.isNotEmpty(targets)) {
List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList()); List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(device -> refDepts.contains(device.getDeptId())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(targets)) { if (CollectionUtil.isNotEmpty(stationTargets)) {
// 年发电量 // 年发电量
group.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); group.setGenerateYear(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
// 月发电量 // 月发电量
group.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); group.setGenerateMon(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum());
// 日发电量 // 日发电量
group.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
group.setGeneratePlanYear(planClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy"))); group.setGeneratePlanYear(planClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy")));
if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){ if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){

Loading…
Cancel
Save