|
@@ -66,7 +66,7 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
lastCycleMonth = 11;
|
|
|
} else if (thisMonth == 2) {
|
|
|
lastMonth = thisMonth - 1;
|
|
|
- lastYear = thisYear - 1;
|
|
|
+ lastYear = thisYear;
|
|
|
lastCycleYear = thisYear - 1;
|
|
|
lastCycleMonth = 12;
|
|
|
} else {
|
|
@@ -111,12 +111,12 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future4 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectGhDataYear(dateStrLast));
|
|
|
//企业自维护的在中间表中没有额外计算即可
|
|
|
- CompletableFuture<SpStatementShipUsageMonthVo> future6 = CompletableFuture.supplyAsync(
|
|
|
- () -> spStatementShipUsageMonthMapper.selectOriginSelfDataYear(yearCountBegin, thisDate));
|
|
|
- CompletableFuture.allOf(future3, future4, future6).join();
|
|
|
+// CompletableFuture<SpStatementShipUsageMonthVo> future6 = CompletableFuture.supplyAsync(
|
|
|
+// () -> spStatementShipUsageMonthMapper.selectOriginSelfDataYear(yearCountBegin, thisDate));
|
|
|
+ CompletableFuture.allOf(future3, future4).join();
|
|
|
SpStatementShipUsageMonthVo originYear = future3.get();
|
|
|
SpStatementShipUsageMonthVo ghYear = future4.get();
|
|
|
- SpStatementShipUsageMonthVo originSelfYear = future6.get();
|
|
|
+ //SpStatementShipUsageMonthVo originSelfYear = future6.get();
|
|
|
if (ghMonth == null) {
|
|
|
ghMonth = new SpStatementShipUsageMonthVo();
|
|
|
}
|
|
@@ -129,28 +129,28 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
if (originSelfMonth == null) {
|
|
|
originSelfMonth = new SpStatementShipUsageMonthVo();
|
|
|
}
|
|
|
- if (originSelfYear == null) {
|
|
|
- originSelfYear = new SpStatementShipUsageMonthVo();
|
|
|
- }
|
|
|
+// if (originSelfYear == null) {
|
|
|
+// originSelfYear = new SpStatementShipUsageMonthVo();
|
|
|
+// }
|
|
|
ArrayList<SpStatementShipUsageMonth> spStatementShipUsageMonths = new ArrayList<>();
|
|
|
SpStatementShipUsageMonth origin = new SpStatementShipUsageMonth();
|
|
|
origin.setId(snowflakeGenerator.next().toString());
|
|
|
origin.setShipUsageMonth(originMonth.getShipUsage().add(originSelfMonth.getShipUsage())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
- origin.setShipUsageYear(originYear.getShipUsage().add(originMonth.getShipUsage())
|
|
|
- .add(originSelfYear.getShipUsage()).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ origin.setShipUsageYear(originYear.getShipUsage().add(originMonth.getShipUsage()).add(originSelfMonth.getShipUsage())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
origin.setShorePowerTimeMonth(
|
|
|
originMonth.getShorePowerTime().add(originSelfMonth.getShorePowerTime())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
origin.setShorePowerTimeYear(
|
|
|
- originYear.getShorePowerTime().add(originMonth.getShorePowerTime())
|
|
|
- .add(originSelfYear.getShorePowerTime()).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ originYear.getShorePowerTime().add(originMonth.getShorePowerTime()).add(originSelfMonth.getShorePowerTime())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
origin.setShorePowerCountMonth(
|
|
|
originMonth.getShorePowerCount().add(originSelfMonth.getShorePowerCount())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
origin.setShorePowerCountYear(
|
|
|
- originYear.getShorePowerCount().add(originMonth.getShorePowerCount())
|
|
|
- .add(originSelfYear.getShorePowerCount()).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ originYear.getShorePowerCount().add(originMonth.getShorePowerCount()).add(originSelfMonth.getShorePowerCount())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
origin.setReportDate(DateUtils.stringToDate(thisYear + "-" + thisMonth, "yyyy-MM"));
|
|
|
origin.setDataSource(0);
|
|
|
spStatementShipUsageMonths.add(origin);
|
|
@@ -496,10 +496,10 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
//查询去年同期数据
|
|
|
SpStatementSg sameTimeLastYear = spStatementSgService.getOne(
|
|
|
Wrappers.<SpStatementSg>lambdaQuery().eq(SpStatementSg::getReportDate,
|
|
|
- lastYear + "-" + (thisMonth < 10 ? "0" + thisMonth : thisMonth)));
|
|
|
+ thisYear - 1 + "-" + (thisMonth < 10 ? "0" + thisMonth : thisMonth)));
|
|
|
//获取去年最后一个月
|
|
|
SpStatementSg last = spStatementSgService.getOne(
|
|
|
- Wrappers.<SpStatementSg>lambdaQuery().eq(SpStatementSg::getReportDate, lastYear + "-12"));
|
|
|
+ Wrappers.<SpStatementSg>lambdaQuery().eq(SpStatementSg::getReportDate, thisYear -1 + "-12"));
|
|
|
SpStatementSg spStatementSg = new SpStatementSg();
|
|
|
spStatementSg.setId(snowflakeGenerator.next().toString());
|
|
|
spStatementSg.setReportDate(DateUtils.dateToString(toDate, "yyyy-MM"));
|