|
@@ -128,7 +128,7 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
() -> spStatementShipUsageMonthMapper.selectOriginSelfDataMonth(thisDate, lastDate));
|
|
|
CompletableFuture.allOf(future1, future2, future5).join();
|
|
|
List<SpStatementShipUsageDetail> spStatementShipUsageDetails = future1.get();
|
|
|
- log.info("查询到12月份连电平台记录数:"+spStatementShipUsageDetails.size());
|
|
|
+ log.info("查询到连电平台记录数:"+spStatementShipUsageDetails.size());
|
|
|
// SpStatementShipUsageMonthVo originMonth = makeOriginMonthData(spStatementShipUsageDetails);
|
|
|
|
|
|
SpStatementShipUsageMonthVo originMonth = new SpStatementShipUsageMonthVo();
|
|
@@ -136,12 +136,12 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
List<SpStatementShipUsageDetail> nhdybzhList = spStatementShipUsageDetails.stream()
|
|
|
.filter(x -> "低压(标准化)".equals(x.getConnectType())).collect(
|
|
|
Collectors.toList());
|
|
|
- log.info("查询到12月份连电平台【低压标准化】记录数:"+nhdybzhList.size());
|
|
|
+ log.info("查询到连电平台【低压标准化】记录数:"+nhdybzhList.size());
|
|
|
// 过滤非内河低压标准化数据
|
|
|
List<SpStatementShipUsageDetail> otherList = spStatementShipUsageDetails.stream()
|
|
|
.filter(x -> !"低压(标准化)".equals(x.getConnectType())).collect(
|
|
|
Collectors.toList());
|
|
|
- log.info("查询到12月份连电平台【非低压标准化】记录数:"+otherList.size());
|
|
|
+ log.info("查询到连电平台【非低压标准化】记录数:"+otherList.size());
|
|
|
// 求和 低压(标准化)
|
|
|
SpStatementShipUsageMonthVo nhdybzhListMonth = makeOriginMonthDataV2d1(nhdybzhList);
|
|
|
// 求和 非低压(标准化)(高压和低压大容量)
|
|
@@ -153,7 +153,7 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
originMonth.setShorePowerCount(
|
|
|
nhdybzhListMonth.getShorePowerCount().add(otherListMonth.getShorePowerCount()));
|
|
|
|
|
|
- SpStatementShipUsageMonthVo ghMonth = future2.get();
|
|
|
+// SpStatementShipUsageMonthVo ghMonth = future2.get();
|
|
|
SpStatementShipUsageMonthVo originSelfMonth = future5.get();
|
|
|
// 查询市级平台 除本月之前当年累计
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future3 = CompletableFuture.supplyAsync(
|
|
@@ -166,9 +166,9 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
// () -> spStatementShipUsageMonthMapper.selectOriginSelfDataYear(yearCountBegin, thisDate));
|
|
|
CompletableFuture.allOf(future3, future4).join();
|
|
|
SpStatementShipUsageMonthVo originYear = future3.get();
|
|
|
- SpStatementShipUsageMonthVo ghYear = future4.get();
|
|
|
+// SpStatementShipUsageMonthVo ghYear = future4.get();
|
|
|
//SpStatementShipUsageMonthVo originSelfYear = future6.get();
|
|
|
- if (ghMonth == null) {
|
|
|
+/* if (ghMonth == null) {
|
|
|
ghMonth = new SpStatementShipUsageMonthVo();
|
|
|
}
|
|
|
if (originYear == null) {
|
|
@@ -176,10 +176,13 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
}
|
|
|
if (ghYear == null) {
|
|
|
ghYear = new SpStatementShipUsageMonthVo();
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (originSelfMonth == null) {
|
|
|
originSelfMonth = new SpStatementShipUsageMonthVo();
|
|
|
}
|
|
|
+ if (originYear == null) {
|
|
|
+ originYear = new SpStatementShipUsageMonthVo();
|
|
|
+ }
|
|
|
// if (originSelfYear == null) {
|
|
|
// originSelfYear = new SpStatementShipUsageMonthVo();
|
|
|
// }
|
|
@@ -209,7 +212,7 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
origin.setReportDate(DateUtils.stringToDate(thisYear + "-" + thisMonth, "yyyy-MM"));
|
|
|
origin.setDataSource(0);
|
|
|
spStatementShipUsageMonths.add(origin);
|
|
|
- SpStatementShipUsageMonth gh = new SpStatementShipUsageMonth();
|
|
|
+ /*SpStatementShipUsageMonth gh = new SpStatementShipUsageMonth();
|
|
|
Thread.sleep(1);
|
|
|
gh.setId(snowflakeGenerator.next().toString());
|
|
|
gh.setShipUsageMonth(ghMonth.getShipUsage().setScale(2, RoundingMode.HALF_UP));
|
|
@@ -226,8 +229,7 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
spStatementShipUsageMonths.add(gh);
|
|
|
//新增线下数据
|
|
|
//月度的
|
|
|
- SpStatementShipUsageMonthVo underLineMonth = spStatementShipUsageMonthMapper.getUnderLineMonthData(
|
|
|
- toDate);
|
|
|
+ SpStatementShipUsageMonthVo underLineMonth = spStatementShipUsageMonthMapper.getUnderLineMonthData(toDate);
|
|
|
//之前线下年度
|
|
|
// SpStatementShipUsageMonthVo underLineYear = spStatementShipUsageMonthMapper.getUnderLineYearData(toDateBegin, toDate);
|
|
|
// 查询上个月报表中的当年累计值
|
|
@@ -262,33 +264,66 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
underLine.setShorePowerCountYear(BigDecimal.ZERO);
|
|
|
underLine.setShorePowerTimeMonth(BigDecimal.ZERO);
|
|
|
underLine.setShorePowerTimeYear(BigDecimal.ZERO);
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // 新增 市级平台手动填报数据,从连电平台推送的 SHORE_POWER_BLBERTHMONTHUSE表中查询数据
|
|
|
+ // 当月数据
|
|
|
+ SpStatementShipUsageMonthVo handDataThisMonth = spStatementShipUsageMonthMapper.selectHandDataWithDate(thisYear + "-" + thisMonth);
|
|
|
+ // 当年累计数据
|
|
|
+ SpStatementShipUsageMonthVo handDataThisYear = spStatementShipUsageMonthMapper.selectHandDataYear(thisYear+"-01", thisYear + "-" + thisMonth);
|
|
|
+ SpStatementShipUsageMonth handData = new SpStatementShipUsageMonth();
|
|
|
+ if (handDataThisMonth != null || handDataThisYear != null) {
|
|
|
+ if (handDataThisMonth == null) {
|
|
|
+ handDataThisMonth = new SpStatementShipUsageMonthVo();
|
|
|
+ }
|
|
|
+ if (handDataThisYear == null) {
|
|
|
+ handDataThisYear = new SpStatementShipUsageMonthVo();
|
|
|
+ }
|
|
|
+ handData.setId(snowflakeGenerator.next().toString());
|
|
|
+ handData.setReportDate(toDate);
|
|
|
+ handData.setDataSource(3);
|
|
|
+ handData.setShipUsageYear(handDataThisYear.getShipUsage().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ handData.setShipUsageMonth(handDataThisMonth.getShipUsage().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ handData.setShorePowerCountMonth(handDataThisMonth.getShorePowerCount().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ handData.setShorePowerCountYear(handDataThisYear.getShorePowerCount().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ handData.setShorePowerTimeMonth(handDataThisMonth.getShorePowerTime().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ handData.setShorePowerTimeYear(handDataThisYear.getShorePowerTime().setScale(2, RoundingMode.HALF_UP));
|
|
|
+ spStatementShipUsageMonths.add(handData);
|
|
|
+ } else {
|
|
|
+ handData.setShipUsageYear(BigDecimal.ZERO);
|
|
|
+ handData.setShipUsageMonth(BigDecimal.ZERO);
|
|
|
+ handData.setShorePowerCountMonth(BigDecimal.ZERO);
|
|
|
+ handData.setShorePowerCountYear(BigDecimal.ZERO);
|
|
|
+ handData.setShorePowerTimeMonth(BigDecimal.ZERO);
|
|
|
+ handData.setShorePowerTimeYear(BigDecimal.ZERO);
|
|
|
}
|
|
|
+
|
|
|
+ // 2024年是内河非标数据+
|
|
|
SpStatementShipUsageMonth sum = new SpStatementShipUsageMonth();
|
|
|
Thread.sleep(1);
|
|
|
sum.setId(snowflakeGenerator.next().toString());
|
|
|
sum.setReportDate(DateUtils.stringToDate(thisYear + "-" + thisMonth, "yyyy-MM"));
|
|
|
sum.setDataSource(99);
|
|
|
- sum.setShipUsageMonth(
|
|
|
- origin.getShipUsageMonth().add(gh.getShipUsageMonth()).add(underLine.getShipUsageMonth())
|
|
|
+ sum.setShipUsageMonth(origin.getShipUsageMonth().add(handData.getShipUsageMonth())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
- sum.setShipUsageYear(
|
|
|
- origin.getShipUsageYear().add(gh.getShipUsageYear()).add(underLine.getShipUsageYear())
|
|
|
+ sum.setShipUsageYear(origin.getShipUsageYear().add(handData.getShipUsageYear())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
- sum.setShorePowerCountMonth(origin.getShorePowerCountMonth().add(gh.getShorePowerCountMonth())
|
|
|
- .add(underLine.getShorePowerCountMonth()).setScale(2, RoundingMode.HALF_UP));
|
|
|
- sum.setShorePowerCountYear(origin.getShorePowerCountYear().add(gh.getShorePowerCountYear())
|
|
|
- .add(underLine.getShorePowerCountYear()).setScale(2, RoundingMode.HALF_UP));
|
|
|
- sum.setShorePowerTimeMonth(origin.getShorePowerTimeMonth().add(gh.getShorePowerTimeMonth())
|
|
|
- .add(underLine.getShorePowerTimeMonth()).setScale(2, RoundingMode.HALF_UP));
|
|
|
- sum.setShorePowerTimeYear(origin.getShorePowerTimeYear().add(gh.getShorePowerTimeYear())
|
|
|
- .add(underLine.getShorePowerTimeYear()).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ sum.setShorePowerCountMonth(origin.getShorePowerCountMonth().add(handData.getShorePowerCountMonth())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ sum.setShorePowerCountYear(origin.getShorePowerCountYear().add(handData.getShorePowerCountYear())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ sum.setShorePowerTimeMonth(origin.getShorePowerTimeMonth().add(handData.getShorePowerTimeMonth())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ sum.setShorePowerTimeYear(origin.getShorePowerTimeYear().add(handData.getShorePowerTimeYear())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
spStatementShipUsageMonths.add(sum);
|
|
|
- //zoro备注:要多算一部分数据,外电1,2,3
|
|
|
+
|
|
|
+ // 2025年1月开始不做 外高桥发电码头船舶(外一电、外二电、外三电) 数据统计,改为统计靠泊邮轮港码头船舶(大容量)
|
|
|
+/* //zoro备注:要多算一部分数据,外电1,2,3
|
|
|
List<SpStatementShipUsageDetail> sbWgq = spStatementShipUsageMonthMapper.selectWgqMonth(
|
|
|
thisDate, lastDate, lastCycleStart, lastCycleEnd);
|
|
|
SpStatementShipUsageMonthVo wgqMonth = makeOriginMonthData(sbWgq);
|
|
|
- SpStatementShipUsageMonthVo wgqYear = spStatementShipUsageMonthMapper.selectWgqYear(
|
|
|
- dateStrLast);
|
|
|
+ SpStatementShipUsageMonthVo wgqYear = spStatementShipUsageMonthMapper.selectWgqYear(dateStrLast);
|
|
|
if (wgqYear == null) {
|
|
|
wgqYear = new SpStatementShipUsageMonthVo();
|
|
|
}
|
|
@@ -305,7 +340,40 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
wgq.setShorePowerCountYear(wgqYear.getShorePowerCount().add(wgqMonth.getShorePowerCount())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
- spStatementShipUsageMonths.add(wgq);
|
|
|
+ spStatementShipUsageMonths.add(wgq);*/
|
|
|
+
|
|
|
+ // 靠泊邮轮港码头船舶(大容量)
|
|
|
+ // 主要统计“上海港国际客运中心开发有限公司”和“上海吴淞口国际邮轮港发展有限公司”两家公司的“高压”和“低压大容量”两类连船记录数据。
|
|
|
+ List<SpStatementShipUsageDetail> ylgdrlList = spStatementShipUsageDetails.stream()
|
|
|
+ .filter(x -> "上海吴淞口国际邮轮港发展有限公司".equals(x.getEnterprisesName())
|
|
|
+ || "上海港国际客运中心开发有限公司".equals(x.getEnterprisesName()))
|
|
|
+ .filter(x -> !"低压(标准化)".equals(x.getConnectType()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ log.info("查询到连电平台【靠泊邮轮港码头船舶(大容量)】记录数:"+ylgdrlList.size());
|
|
|
+
|
|
|
+ SpStatementShipUsageMonthVo ylgdrlMonth = makeOriginMonthDataV2d1(ylgdrlList);
|
|
|
+ SpStatementShipUsageMonthVo ylgdrlYear = spStatementShipUsageMonthMapper.selectylgdrlYear(dateStrLast);
|
|
|
+ if (ylgdrlMonth == null) {
|
|
|
+ ylgdrlMonth = new SpStatementShipUsageMonthVo();
|
|
|
+ }
|
|
|
+ if (ylgdrlYear == null) {
|
|
|
+ ylgdrlYear = new SpStatementShipUsageMonthVo();
|
|
|
+ }
|
|
|
+ SpStatementShipUsageMonth ylgdrl = new SpStatementShipUsageMonth();
|
|
|
+ ylgdrl.setId(snowflakeGenerator.next().toString());
|
|
|
+ ylgdrl.setDataSource(103);
|
|
|
+ ylgdrl.setReportDate(DateUtils.stringToDate(thisYear + "-" + thisMonth, "yyyy-MM"));
|
|
|
+ ylgdrl.setShorePowerCountMonth(ylgdrlMonth.getShorePowerCount());
|
|
|
+ ylgdrl.setShipUsageMonth(ylgdrlMonth.getShipUsage());
|
|
|
+ ylgdrl.setShorePowerTimeMonth(ylgdrlMonth.getShorePowerTime());
|
|
|
+ ylgdrl.setShipUsageYear(ylgdrlYear.getShipUsage().add(ylgdrlMonth.getShipUsage())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ ylgdrl.setShorePowerTimeYear(ylgdrlYear.getShorePowerTime().add(ylgdrlMonth.getShorePowerTime())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ ylgdrl.setShorePowerCountYear(ylgdrlYear.getShorePowerCount().add(ylgdrlMonth.getShorePowerCount())
|
|
|
+ .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ spStatementShipUsageMonths.add(ylgdrl);
|
|
|
+
|
|
|
//有一个合计的用于上海市岸电使用指标完成情况统计表,对应的dataSource为101
|
|
|
//获取对应月的数据
|
|
|
// List<SpStatementShipUsageDetail> nwSum = spStatementShipUsageMonthMapper.selectNhAndWgMonth(thisDate,lastDate,lastCycleStart,lastCycleEnd);
|