From b60b39fc30384a1fa75765e8e10f9ad3bffe9480 Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期五, 23 五月 2025 15:15:34 +0800
Subject: [PATCH] Update ApsStandardProcessController.java
---
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
index 49878d5..53dd3b5 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java
@@ -1489,9 +1489,61 @@
// 鏌ヨ鍘熷鏁版嵁锛堜笉渚濊禆鏁版嵁搴撹仛鍚堬級
List<Map<String, Object>> rawData = apsGasPipingRouteStatMapper.selectRawStatData(queryParams);
+ // 濡傛灉娌℃湁鏌ヨ鍒板師濮嬫暟鎹紝浣嗛渶瑕佽繑鍥炴墍鏈夊伐搴�/杞﹂棿鐨勬暟鎹�
if (rawData.isEmpty()) {
+ // 鍒涘缓娌℃湁鏃堕棿闄愬埗鐨勫熀纭�鏌ヨ鍙傛暟
+ Map<String, Object> baseParams = new HashMap<>(queryParams);
+ baseParams.remove("yearStart");
+ baseParams.remove("monthStart");
+ baseParams.remove("yearEnd");
+ baseParams.remove("monthEnd");
+
+ // 鐩存帴浠巃ps_gas_piping_route_stat琛ㄦ煡璇㈡墍鏈夊彲鑳界殑宸ュ簭鍜岃溅闂�
+ List<Map<String, Object>> baseData = apsGasPipingRouteStatMapper.selectBaseStatData(baseParams);
+
+ // 涓烘瘡涓伐搴�/杞﹂棿鍒涘缓鍩轰簬鏃堕棿鐨勭┖鏁版嵁
+ for (Map<String, Object> data : baseData) {
+ String rowGroupValue = getStringValue(data, rowGroupBy);
+ if (rowGroupValue == null || rowGroupValue.trim().isEmpty()) continue;
+
+ Map<String, Object> rowEntry = new HashMap<>();
+ Map<String, Object> rowDetail = new HashMap<>();
+
+ // 娣诲姞鍩烘湰淇℃伅
+ String plant = getStringValue(data, "plant");
+ String major = getStringValue(data, "major");
+ String workshop = getStringValue(data, "workshop");
+
+ if (groupByPlant) rowDetail.put("plant", plant);
+ if (groupByMajor) rowDetail.put("major", major);
+ if (groupByWorkshop) rowDetail.put("workshop", workshop);
+
+ // 澶勭悊宸ュ簭鍚嶇О - 濡傛灉rowGroupBy涓簑orkshop锛岄渶瑕佹坊鍔爌rocessName瀛楁
+ if ("workshop".equals(rowGroupBy)) {
+ String processName = getStringValue(data, "processName");
+ rowDetail.put("processName", processName != null ? processName : "");
+ }
+
+ // 涓烘瘡涓椂闂寸偣鍒涘缓闆跺�兼暟鎹�
+ List<Map<String, Object>> timeDataList = new ArrayList<>();
+ for (String timePoint : timePoints) {
+ Map<String, Object> pointData = new HashMap<>();
+ pointData.put("planDay", timePoint);
+ pointData.put("requireTimes", BigDecimal.ZERO);
+ pointData.put("designTimes", BigDecimal.ZERO);
+ pointData.put("capacityLoad", BigDecimal.ZERO);
+ timeDataList.add(pointData);
+ }
+
+ rowDetail.put("timeData", timeDataList);
+ rowEntry.put(rowGroupValue, rowDetail);
+ plantTable.add(rowEntry);
+ }
+
result.put("plantTable", plantTable);
result.put("timePoints", timePoints);
+ result.put("rowGroupBy", rowGroupBy);
+
return result;
}
@@ -1690,9 +1742,9 @@
capacityPlans = capacityPlanCache.get(cacheKey);
} else {
// 浣跨敤涓撶敤鏌ヨ鏂规硶鏌ヨ璁捐浜ц兘鏁版嵁
- // 鎸夋枃妗h姹傦細鏍规嵁澶氫釜process_name鍜宮ajor銆乸lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
+ // 鎸夋枃妗h姹傦細鏍规嵁process_name鍜宲lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
capacityPlans = apsGasPipelineCapacityPlanMapper.selectDesignCapacityForInterface2(
- processName.trim(), year, month, major, plant);
+ processName.trim(), year, month, null, plant);
// 灏嗙粨鏋滃瓨鍏ョ紦瀛�
capacityPlanCache.put(cacheKey, capacityPlans);
@@ -1757,9 +1809,9 @@
capacityPlans = capacityPlanCache.get(cacheKey);
} else {
// 浣跨敤涓撶敤鏌ヨ鏂规硶鏌ヨ璁捐浜ц兘鏁版嵁
- // 鎸夋枃妗h姹傦細鏍规嵁process_name銆乵ajor銆乸lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
+ // 鎸夋枃妗h姹傦細鏍规嵁process_name鍜宲lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
capacityPlans = apsGasPipelineCapacityPlanMapper.selectDesignCapacityForInterface2(
- processName, year, month, major, plant);
+ processName, year, month, null, plant);
// 灏嗙粨鏋滃瓨鍏ョ紦瀛�
capacityPlanCache.put(cacheKey, capacityPlans);
--
Gitblit v1.9.3