|
@@ -118,7 +118,7 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
// 计算各区
|
|
|
executeEveryDistrict(originList, lastReportDataList, spStatementInlandLowList, currentMonthDate);
|
|
|
// 计算合计
|
|
|
- executeTotal(spStatementInlandLowList, lastMonthDate);
|
|
|
+ executeTotal(spStatementInlandLowList, currentMonthDate, lastMonthDate);
|
|
|
log.info("最终存储的内河低压分析表1为:{}", JSONObject.toJSONString(spStatementInlandLowList));
|
|
|
// 查询本月报表数据
|
|
|
List<SpStatementInlandLow> currentList = this.selectCurrentMonthReport1Count(
|
|
@@ -170,7 +170,7 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
List<SpStatementInlandLow> spStatementInlandLowList = executeEveryDistrict2(currentMonthData,
|
|
|
lastReportDataList, currentDate);
|
|
|
// 计算合计
|
|
|
- executeTotal2(spStatementInlandLowList, lastMonthDate);
|
|
|
+ executeTotal2(spStatementInlandLowList, currentDate, lastMonthDate);
|
|
|
// 查询当月是否有数据
|
|
|
List<SpStatementInlandLow> currentList = this.selectCurrentMonthReport2Count(
|
|
|
spStatementInlandLowList.get(0).getReportDate());
|
|
@@ -279,7 +279,7 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
}
|
|
|
|
|
|
private void executeTotal(List<SpStatementInlandLow> spStatementInlandLowList,
|
|
|
- String lastMonthDate) {
|
|
|
+ String currentMonthDate, String lastMonthDate) {
|
|
|
// 计算合计
|
|
|
SpStatementInlandLow spStatementInlandLow = new SpStatementInlandLow();
|
|
|
spStatementInlandLow.setId(String.valueOf(snowflakeMakeConf.snowflakeStringId()));
|
|
@@ -316,16 +316,21 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
|| lastMonthReportData.getBoatUseNumberMonth().equals(BigDecimal.ZERO)) {
|
|
|
spStatementInlandLow.setBoatUseNumberChain(null);
|
|
|
} else {
|
|
|
- BigDecimal rate = (spStatementInlandLow.getBoatUseNumberMonth()
|
|
|
- .subtract(lastMonthReportData.getBoatUseNumberMonth())).multiply(
|
|
|
- BigDecimal.valueOf(100))
|
|
|
- .divide(lastMonthReportData.getBoatUseNumberMonth(), 2, RoundingMode.HALF_UP);
|
|
|
- spStatementInlandLow.setBoatUseNumberChain(rate);
|
|
|
+ String[] strings = currentMonthDate.split("-");
|
|
|
+ if(strings.length == 2 && Integer.valueOf(strings[1]) != 1) {
|
|
|
+ BigDecimal rate = (spStatementInlandLow.getBoatUseNumberMonth()
|
|
|
+ .subtract(lastMonthReportData.getBoatUseNumberMonth())).multiply(
|
|
|
+ BigDecimal.valueOf(100))
|
|
|
+ .divide(lastMonthReportData.getBoatUseNumberMonth(), 2, RoundingMode.HALF_UP);
|
|
|
+ spStatementInlandLow.setBoatUseNumberChain(rate);
|
|
|
+ }else{
|
|
|
+ spStatementInlandLow.setBoatUseNumberChain(null);
|
|
|
+ }
|
|
|
}
|
|
|
spStatementInlandLowList.add(spStatementInlandLow);
|
|
|
}
|
|
|
|
|
|
- private void executeTotal2(List<SpStatementInlandLow> spStatementInlandLowList,
|
|
|
+ private void executeTotal2(List<SpStatementInlandLow> spStatementInlandLowList, String currentDate,
|
|
|
String lastMonthDate) {
|
|
|
SpStatementInlandLow spStatementInlandLow = new SpStatementInlandLow();
|
|
|
spStatementInlandLow.setId(String.valueOf(snowflakeMakeConf.snowflakeStringId()));
|
|
@@ -362,11 +367,16 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
|| lastMonthReportData.getBoatUseNumberMonth().equals(BigDecimal.ZERO)) {
|
|
|
spStatementInlandLow.setBoatUseNumberChain(null);
|
|
|
} else {
|
|
|
- BigDecimal rate = (spStatementInlandLow.getBoatUseNumberMonth()
|
|
|
- .subtract(lastMonthReportData.getBoatUseNumberMonth())).multiply(
|
|
|
- BigDecimal.valueOf(100))
|
|
|
- .divide(lastMonthReportData.getBoatUseNumberMonth(), 2, RoundingMode.HALF_UP);
|
|
|
- spStatementInlandLow.setBoatUseNumberChain(rate);
|
|
|
+ String[] strings = currentDate.split("-");
|
|
|
+ if(strings.length == 2 && Integer.valueOf(strings[1]) != 1) {
|
|
|
+ BigDecimal rate = (spStatementInlandLow.getBoatUseNumberMonth()
|
|
|
+ .subtract(lastMonthReportData.getBoatUseNumberMonth())).multiply(
|
|
|
+ BigDecimal.valueOf(100))
|
|
|
+ .divide(lastMonthReportData.getBoatUseNumberMonth(), 2, RoundingMode.HALF_UP);
|
|
|
+ spStatementInlandLow.setBoatUseNumberChain(rate);
|
|
|
+ }else{
|
|
|
+ spStatementInlandLow.setBoatUseNumberChain(null);
|
|
|
+ }
|
|
|
}
|
|
|
spStatementInlandLowList.add(spStatementInlandLow);
|
|
|
}
|