Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
ty 3 months ago
parent
commit
50434ae395
  1. 24
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java

24
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java

@ -156,6 +156,21 @@ public class ElectricReportServiceImpl implements IElectricReportService {
}else{
comprehensive.setLastMonthGenerateRate(0.0);
}
// 本年发电
if(CollectionUtil.isEmpty(electrics)){
comprehensive.setYearGenerate(comprehensive.getMonthGenerate());
comprehensive.setLastYearGenerate(comprehensive.getLastMonthGenerate());
}else{
// 累计发电
comprehensive.setYearGenerate(electrics.stream().mapToDouble(ComprehensiveElectricVo::getMonthGenerate).sum() + comprehensive.getMonthGenerate());
comprehensive.setLastYearGenerate(electrics.stream().mapToDouble(ComprehensiveElectricVo::getLastMonthGenerate).sum() + comprehensive.getLastMonthGenerate());
}
if(comprehensive.getYearGenerate() > 0 && comprehensive.getLastYearGenerate() > 0){
comprehensive.setLastYearGenerateRate(BigDecimal.valueOf(comprehensive.getYearGenerate() / comprehensive.getLastYearGenerate() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
comprehensive.setLastYearGenerateRate(0.0);
}
// 本月等效小时
if(comprehensive.getMonthGenerate() > 0){
comprehensive.setMonthEquivalent(BigDecimal.valueOf(comprehensive.getMonthGenerate() / installedCapacity).setScale(2, RoundingMode.HALF_UP).doubleValue());
@ -168,11 +183,6 @@ public class ElectricReportServiceImpl implements IElectricReportService {
}else{
comprehensive.setLastMonthEquivalent(0.0);
}
comprehensive.setYearGenerate(threes.stream().filter(o->o.getStrMonth().contains(currentYear)).mapToDouble(o->o.getGenerate().doubleValue()).sum());
comprehensive.setLastYearGenerate(threes.stream().filter(o->o.getStrMonth().contains(lastYear)).mapToDouble(o->o.getGenerate().doubleValue()).sum());
if(comprehensive.getYearGenerate() > 0 && comprehensive.getLastYearGenerate() > 0){
comprehensive.setLastYearGenerateRate(BigDecimal.valueOf(comprehensive.getYearGenerate() / comprehensive.getLastYearGenerate() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}
if(CollectionUtil.isEmpty(electrics)){
// 本年等效小时
comprehensive.setYearEquivalent(comprehensive.getMonthEquivalent());
@ -783,7 +793,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
AnalyzeDataConditionPO generate = new AnalyzeDataConditionPO();
generate.setFull(1);
generate.setKeepFigures(2);
generate.setAccessRules(6);
generate.setAccessRules(5);
generate.setSaveTimeType(2);
generate.setSignages("generation_capacity");
generate.setTimeInterval(1);
@ -794,7 +804,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
AnalyzeDataConditionPO reactive = new AnalyzeDataConditionPO();
reactive.setFull(1);
reactive.setKeepFigures(2);
reactive.setAccessRules(6);
reactive.setAccessRules(5);
reactive.setSaveTimeType(2);
reactive.setSignages("reactive_generation");
reactive.setTimeInterval(1);

Loading…
Cancel
Save