|
@@ -120,8 +120,10 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
CompletableFuture<List<SpStatementShipUsageDetail>> future1 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectOriginDataMonth(thisDate, lastDate,
|
|
|
lastCycleStart, lastCycleEnd));
|
|
|
+ // 查询当月内河非标岸电设备使用情况
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future2 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectGhDataMonth(toDate));
|
|
|
+ // 泊位本月使用情况
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future5 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectOriginSelfDataMonth(thisDate, lastDate));
|
|
|
CompletableFuture.allOf(future1, future2, future5).join();
|
|
@@ -137,8 +139,11 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
List<SpStatementShipUsageDetail> otherList = spStatementShipUsageDetails.stream()
|
|
|
.filter(x -> !"低压(标准化)".equals(x.getConnectType())).collect(
|
|
|
Collectors.toList());
|
|
|
+ // 求和 低压(标准化)
|
|
|
SpStatementShipUsageMonthVo nhdybzhListMonth = makeOriginMonthDataV2d1(nhdybzhList);
|
|
|
+ // 求和 非低压(标准化)(高压和低压大容量)
|
|
|
SpStatementShipUsageMonthVo otherListMonth = makeOriginMonthData(otherList);
|
|
|
+
|
|
|
originMonth.setShipUsage(nhdybzhListMonth.getShipUsage().add(otherListMonth.getShipUsage()));
|
|
|
originMonth.setShorePowerTime(
|
|
|
nhdybzhListMonth.getShorePowerTime().add(otherListMonth.getShorePowerTime()));
|
|
@@ -147,9 +152,10 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
|
|
|
SpStatementShipUsageMonthVo ghMonth = future2.get();
|
|
|
SpStatementShipUsageMonthVo originSelfMonth = future5.get();
|
|
|
- //除本月之前合计的
|
|
|
+ // 查询市级平台 除本月之前当年累计
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future3 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectOriginDataYear(dateStrLast));
|
|
|
+ // 查询港航部门报送数据即内河非标数据 除本月之前当年累计
|
|
|
CompletableFuture<SpStatementShipUsageMonthVo> future4 = CompletableFuture.supplyAsync(
|
|
|
() -> spStatementShipUsageMonthMapper.selectGhDataYear(dateStrLast));
|
|
|
//企业自维护的在中间表中没有额外计算即可
|
|
@@ -838,6 +844,13 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
return spStatementShipUsageMonthVo;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 低压标准化
|
|
|
+ * 受电时间使用连电平台推送 duration字段值,注意单位是分钟要除以60转换成小时
|
|
|
+ * 用电量使用连电平台推送 elect字段值
|
|
|
+ * @param spStatementShipUsageDetails
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private SpStatementShipUsageMonthVo makeOriginMonthDataV2d1(
|
|
|
List<SpStatementShipUsageDetail> spStatementShipUsageDetails) {
|
|
|
SpStatementShipUsageMonthVo spStatementShipUsageMonthVo = new SpStatementShipUsageMonthVo();
|
|
@@ -857,6 +870,13 @@ public class SpStatementShipUsageMonthServiceImpl extends
|
|
|
return spStatementShipUsageMonthVo;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 高压和低压大容量
|
|
|
+ * 受电时间需要自己计算:使用连电平台推送ENDTIME-STARTTIME,注意要转换为小时
|
|
|
+ * 用电量使用连电平台推送 elect字段值
|
|
|
+ * @param spStatementShipUsageDetails
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private SpStatementShipUsageMonthVo makeOriginMonthData(
|
|
|
List<SpStatementShipUsageDetail> spStatementShipUsageDetails) {
|
|
|
SpStatementShipUsageMonthVo spStatementShipUsageMonthVo = new SpStatementShipUsageMonthVo();
|