|
|
|
@ -344,16 +344,19 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
|
|
|
|
|
Integer currentYear = calendar.get(Calendar.YEAR); |
|
|
|
|
if (year>currentYear-3) { |
|
|
|
|
mainSystemMonitoringService.getElectricSituationByRedis(yearAndMonth, reportVOS, stationEntityList); |
|
|
|
|
log.info("电站发电情况"+reportVOS.toString()); |
|
|
|
|
}else { |
|
|
|
|
stationEntityList.forEach(stationEntity -> { |
|
|
|
|
List<StationRunReportVO> stationReportVOList = mainSystemMonitoringService.getElectricSituationV2(yearAndMonth, stationEntity.getCode()); |
|
|
|
|
reportVOS.addAll(stationReportVOList); |
|
|
|
|
}); |
|
|
|
|
log.info("电站发电情况"+reportVOS.toString()); |
|
|
|
|
} |
|
|
|
|
getSumStationRunReport(reportVOS); |
|
|
|
|
stationReportAllVo.setStationReportVOList(reportVOS); |
|
|
|
|
log.info("电站发电量总览"+reportVOS.toString()); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("", e); |
|
|
|
|
log.error("getStationMonthReportV2电站发电量报错", e); |
|
|
|
|
System.out.println(e); |
|
|
|
|
}finally { |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
@ -523,11 +526,12 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
|
|
|
|
|
stationRunReportVO.setStationName("合计"); |
|
|
|
|
if (CollectionUtil.isNotEmpty(reportVOS)){ |
|
|
|
|
double sumPowerMonPlan = reportVOS.stream().mapToDouble(StationRunReportVO::getPowerMonPlan).sum(); |
|
|
|
|
stationRunReportVO.setPowerMonPlan(sumPowerMonPlan); |
|
|
|
|
stationRunReportVO.setPowerMonPlan(new BigDecimal(sumPowerMonPlan).setScale(2,BigDecimal.ROUND_UP).doubleValue()); |
|
|
|
|
double sumFinishPowerMon = reportVOS.stream().map(StationRunReportVO::getFinishPowerMon).mapToDouble(s -> Double.valueOf(s)).sum(); |
|
|
|
|
stationRunReportVO.setFinishPowerMon(String.valueOf(sumFinishPowerMon)); |
|
|
|
|
stationRunReportVO.setFinishPowerMon(new BigDecimal(sumFinishPowerMon).setScale(2,BigDecimal.ROUND_UP).toString()); |
|
|
|
|
if (!ObjectUtils.isEmpty(sumPowerMonPlan)) { |
|
|
|
|
BigDecimal powerMonRate = new BigDecimal(sumFinishPowerMon).divide(new BigDecimal(sumPowerMonPlan)).setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
BigDecimal powerMonRate = new BigDecimal(sumFinishPowerMon).divide(new BigDecimal(sumPowerMonPlan),4,BigDecimal.ROUND_UP) |
|
|
|
|
.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
stationRunReportVO.setPowerMonRate(String.valueOf(powerMonRate)); |
|
|
|
|
}else { |
|
|
|
|
stationRunReportVO.setPowerMonRate("0.0"); |
|
|
|
@ -537,7 +541,8 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
|
|
|
|
|
double sumFinishPowerYear = reportVOS.stream().map(StationRunReportVO::getFinishPowerYear).mapToDouble(s -> Double.valueOf(s)).sum(); |
|
|
|
|
stationRunReportVO.setFinishPowerYear(String.valueOf(sumFinishPowerYear)); |
|
|
|
|
if (!ObjectUtils.isEmpty(sumPowerYearPlan)){ |
|
|
|
|
BigDecimal powerYearRate = new BigDecimal(sumFinishPowerYear).divide(new BigDecimal(sumPowerYearPlan)).setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
BigDecimal powerYearRate = new BigDecimal(sumFinishPowerYear).divide(new BigDecimal(sumPowerYearPlan),4,BigDecimal.ROUND_UP) |
|
|
|
|
.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_UP); |
|
|
|
|
stationRunReportVO.setPowerYearRate(String.valueOf(powerYearRate)); |
|
|
|
|
}else { |
|
|
|
|
stationRunReportVO.setPowerYearRate("0.0"); |
|
|
|
|