|
@@ -46,9 +46,9 @@ public class ShorePowerReportGenerateScheduler {
|
|
|
public void generateSpInlandLowStatement() {
|
|
|
try {
|
|
|
// 生成各区上报数据 内河低压分析表
|
|
|
- //generateReport1();
|
|
|
- // 生成市级平台自动上传数据 内河低压分析表
|
|
|
- //generateReport2();
|
|
|
+ generateReport1();
|
|
|
+// 生成市级平台自动上传数据 内河低压分析表
|
|
|
+ generateReport2();
|
|
|
//生成报表三
|
|
|
generateReport3();
|
|
|
} catch (Exception e) {
|
|
@@ -154,6 +154,7 @@ public class ShorePowerReportGenerateScheduler {
|
|
|
spStatementInlandLow.setType(x.getType());
|
|
|
spStatementInlandLow.setReportDate(x.getReportDate());
|
|
|
});
|
|
|
+ // 拿上个月的中间表的"合计"数据 用来计算使用岸电船舶(艘次)的环比
|
|
|
SpStatementInlandLow lastMonthReportData = spStatementInlandLowService.getLastMonthReportData(
|
|
|
getShorePowerLastMonthDate(), spStatementInlandLow.getType());
|
|
|
if (Objects.isNull(lastMonthReportData) || Objects.isNull(
|
|
@@ -188,15 +189,18 @@ public class ShorePowerReportGenerateScheduler {
|
|
|
AreaSortEnum.getByArea(spStatementInlandLow.getDistrict()).getSort());
|
|
|
spStatementInlandLow.setType(2);
|
|
|
spStatementInlandLow.setBoatUseNumberMonth(currentMonth.getTotal());
|
|
|
- spStatementInlandLow.setPowerConnHoursMonth(
|
|
|
- currentMonth.getDuration().divide(BigDecimal.valueOf(60), 2,
|
|
|
- RoundingMode.HALF_UP));
|
|
|
+ // 使用岸电小时在查询数据库时已经转换为小时计算
|
|
|
+// spStatementInlandLow.setPowerConnHoursMonth(
|
|
|
+// currentMonth.getDuration().divide(BigDecimal.valueOf(60), 2,
|
|
|
+// RoundingMode.HALF_UP));
|
|
|
+ spStatementInlandLow.setPowerConnHoursMonth(currentMonth.getDuration());
|
|
|
spStatementInlandLow.setElectricityUsageMonth(currentMonth.getElect());
|
|
|
if (CollectionUtils.isEmpty(lastMonthData)) {
|
|
|
spStatementInlandLow.setBoatUseNumberChain(null);
|
|
|
} else {
|
|
|
for (ShorePowerConnRecordInfoVo lastMonth : lastMonthData) {
|
|
|
if (currentMonth.getArea().equals(lastMonth.getArea())) {
|
|
|
+ // 计算使用岸电船舶(艘次)环比
|
|
|
BigDecimal rate = getRate2(currentMonth, lastMonth);
|
|
|
spStatementInlandLow.setBoatUseNumberChain(rate);
|
|
|
} else {
|
|
@@ -205,15 +209,17 @@ public class ShorePowerReportGenerateScheduler {
|
|
|
}
|
|
|
}
|
|
|
spStatementInlandLowList.add(spStatementInlandLow);
|
|
|
+ // 计算各区的当年累计
|
|
|
for (SpStatementInlandLow statementInlandLow : spStatementInlandLowList) {
|
|
|
for (ShorePowerConnRecordInfoVo yearData : currentYearDataList) {
|
|
|
if (spStatementInlandLow.getDistrict().equals(
|
|
|
ShorePowerConnRecordInfoEnum.getByArea(Integer.parseInt(yearData.getArea()))
|
|
|
.getArea())) {
|
|
|
statementInlandLow.setBoatUseNumberYearTotal(yearData.getTotal());
|
|
|
- statementInlandLow.setPowerConnHoursYearTotal(
|
|
|
- yearData.getDuration().divide(BigDecimal.valueOf(60), 2,
|
|
|
- RoundingMode.HALF_UP));
|
|
|
+// statementInlandLow.setPowerConnHoursYearTotal(
|
|
|
+// yearData.getDuration().divide(BigDecimal.valueOf(60), 2,
|
|
|
+// RoundingMode.HALF_UP));
|
|
|
+ statementInlandLow.setPowerConnHoursYearTotal(yearData.getDuration());
|
|
|
statementInlandLow.setElectricityUsageYearTotal(yearData.getElect());
|
|
|
}
|
|
|
}
|