From dec8951aae400e54f6ee83a8f95867dba9da8af1 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期五, 23 五月 2025 17:17:33 +0800
Subject: [PATCH] [钣金计划大表] 优化:焊缝统计导出Excel样式

---
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 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 53dd3b5..248f120 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
@@ -1744,7 +1744,7 @@
                                 // 浣跨敤涓撶敤鏌ヨ鏂规硶鏌ヨ璁捐浜ц兘鏁版嵁
                                 // 鎸夋枃妗h姹傦細鏍规嵁process_name鍜宲lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
                                 capacityPlans = apsGasPipelineCapacityPlanMapper.selectDesignCapacityForInterface2(
-                                        processName.trim(), year, month, null, plant);
+                                        processName.trim(), year, month, major, plant);
                                 
                                 // 灏嗙粨鏋滃瓨鍏ョ紦瀛�
                                 capacityPlanCache.put(cacheKey, capacityPlans);
@@ -1811,7 +1811,7 @@
                             // 浣跨敤涓撶敤鏌ヨ鏂规硶鏌ヨ璁捐浜ц兘鏁版嵁
                             // 鎸夋枃妗h姹傦細鏍规嵁process_name鍜宲lant鍘籥ps_gas_pipeline_capacity_plan琛ㄤ腑鏌ヨ
                             capacityPlans = apsGasPipelineCapacityPlanMapper.selectDesignCapacityForInterface2(
-                                    processName, year, month, null, plant);
+                                    processName, year, month, major, plant);
                             
                             // 灏嗙粨鏋滃瓨鍏ョ紦瀛�
                             capacityPlanCache.put(cacheKey, capacityPlans);
@@ -1854,6 +1854,30 @@
         result.put("timePoints", timePoints);
         result.put("rowGroupBy", rowGroupBy);
         
+        // 鏍规嵁鏂囨。娉ㄦ剰鐐�3锛屾坊鍔犳帓搴忛�昏緫
+        if (!plantTable.isEmpty()) {
+            // 瀵硅仛鍚堢粨鏋滆繘琛屾帓搴�
+            Collections.sort(plantTable, (map1, map2) -> {
+                String key1 = map1.keySet().iterator().next();
+                String key2 = map2.keySet().iterator().next();
+                
+                // 棣栧厛鎸塺owGroupBy鎺掑簭锛坧rocessName鎴杦orkshop锛�
+                int result1 = key1.compareTo(key2);
+                if (result1 != 0) {
+                    return result1;
+                }
+                
+                // 濡傛灉rowGroupBy鐩稿悓锛屽啀鎸塸lant鎺掑簭
+                Map<String, Object> detail1 = (Map<String, Object>) map1.get(key1);
+                Map<String, Object> detail2 = (Map<String, Object>) map2.get(key2);
+                
+                String plant1 = detail1.containsKey("plant") ? (String) detail1.get("plant") : "";
+                String plant2 = detail2.containsKey("plant") ? (String) detail2.get("plant") : "";
+                
+                return plant1.compareTo(plant2);
+            });
+        }
+        
         return result;
     }
     

--
Gitblit v1.9.3