Browse Source

#首页关联发电量设备名称显示

zhongwei
yang_shj 9 months ago
parent
commit
1ae015b46b
  1. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -203,7 +203,7 @@ public class TargetServiceImpl implements TargetService {
double sum = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); double sum = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum();
item.setElectricGeneration(sum); item.setElectricGeneration(sum);
// 发电量详情 // 发电量详情
List<String> details = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).map(target-> "[" + Optional.ofNullable(target.getDeviceCode()).orElse("填报电量") + " " + target.getPowerYear() +"kWh]").collect(Collectors.toList()); List<String> details = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).map(target-> "[" + Optional.ofNullable(target.getDeviceName()).orElse("填报电量") + " " + target.getPowerYear() +"kWh]").collect(Collectors.toList());
item.setDetail(String.join("|",details)); item.setDetail(String.join("|",details));
return item; return item;
}).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList()); }).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList());
@ -225,7 +225,7 @@ public class TargetServiceImpl implements TargetService {
double sum = targets.stream().filter(target -> target.getDeptId().equals(station.getRefDept())).mapToDouble(PhotovoltaicTargetVo::getGenerationYear).sum(); double sum = targets.stream().filter(target -> target.getDeptId().equals(station.getRefDept())).mapToDouble(PhotovoltaicTargetVo::getGenerationYear).sum();
item.setElectricGeneration(sum); item.setElectricGeneration(sum);
// 发电量详情 // 发电量详情
List<String> details = targets.stream().filter(target -> target.getDeptId().equals(station.getRefDept())).map(target -> "[" + Optional.ofNullable(target.getDeviceCode()).orElse("填报电量") + " " + target.getGenerationYear() + "kWh]").collect(Collectors.toList()); List<String> details = targets.stream().filter(target -> target.getDeptId().equals(station.getRefDept())).map(target -> "[" + Optional.ofNullable(target.getDeviceName()).orElse("填报电量") + " " + target.getGenerationYear() + "kWh]").collect(Collectors.toList());
item.setDetail(String.join("|", details)); item.setDetail(String.join("|", details));
return item; return item;
}).filter(generate -> Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList()); }).filter(generate -> Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList());

Loading…
Cancel
Save