|
|
|
@ -685,24 +685,26 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
//今年发电量
|
|
|
|
|
powerYear=value.entrySet().stream().filter(s->listByYear.contains(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
//转换单位kwh-》万Kwh
|
|
|
|
|
powerYear=powerYear.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP); |
|
|
|
|
powerYear=powerYear.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); |
|
|
|
|
powerYearBefore=value.entrySet().stream().filter(s->listByYearBefore.contains(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
powerYearBefore=powerYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP); |
|
|
|
|
powerYearBefore=powerYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonth=value.entrySet().stream().filter(s->monStart.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
powerMonth=powerMonth.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonth=powerMonth.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonthBefore=value.entrySet().stream().filter(s->monStartMonBefore.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
powerMonthBefore=powerMonthBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonthBefore=powerMonthBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonthYearBefore=value.entrySet().stream().filter(s->monStartYearBefore.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
powerMonthYearBefore=powerMonthYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP); |
|
|
|
|
powerMonthYearBefore=powerMonthYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); |
|
|
|
|
powerVo.setPowerYear(powerYear.doubleValue()); |
|
|
|
|
powerVo.setPowerYearBefore(powerYearBefore.doubleValue()); |
|
|
|
|
BigDecimal yearPercentage = new BigDecimal(0); |
|
|
|
|
BigDecimal planPercentage = new BigDecimal(0); |
|
|
|
|
if (powerYearBefore.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); |
|
|
|
|
yearPercentage.setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
} |
|
|
|
|
if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, BigDecimal.ROUND_UP); |
|
|
|
|
planPercentage.setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
} |
|
|
|
|
powerVo.setPlanPercentage(planPercentage.doubleValue()); |
|
|
|
|
powerVo.setPowerYearPercentage(yearPercentage.doubleValue()); |
|
|
|
@ -712,6 +714,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
BigDecimal monPercentage = new BigDecimal(0); |
|
|
|
|
if (powerMonthYearBefore.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); |
|
|
|
|
monPercentage.setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
} |
|
|
|
|
powerVo.setPowerMonPercentage(monPercentage.doubleValue()); |
|
|
|
|
powerPercentageVoList.add(powerVo); |
|
|
|
|