From 771fc6353fe9ef5e9f1095de75f29210adfe3751 Mon Sep 17 00:00:00 2001 From: hongjli <3117313295@qq.com> Date: 星期五, 23 五月 2025 15:26:40 +0800 Subject: [PATCH] 管路&气柜产能负载对返回结果集进行排序 --- aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipingRouteStatServiceImpl.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 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..8102872 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 @@ -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