From 9f0f577b53a38d34abed362fedea801d1f2e54bd Mon Sep 17 00:00:00 2001 From: xuyuncong <3422692813@qq.com> Date: Tue, 4 Nov 2025 15:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=9F=E8=AE=A1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RepairStatisticsServiceImpl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairStatisticsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairStatisticsServiceImpl.java index 90a44231..9400e567 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairStatisticsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairStatisticsServiceImpl.java @@ -729,6 +729,7 @@ public class RepairStatisticsServiceImpl implements RepairStatisticsService { newOrderNode.put("selectType", "jinchang"); newOrderNode.put("total", workerStat.get("ticketCount")); statsList.add(newOrderNode); + respMap.put("count", workerStat.get("ticketCount")); // 添加维修中统计 Map workingNode = new HashMap<>(); @@ -762,6 +763,18 @@ public class RepairStatisticsServiceImpl implements RepairStatisticsService { } } + // 排序:根据 count 字段降序 + resp.sort((a, b) -> { + Object countA = a.get("count"); + Object countB = b.get("count"); + + if (countA == null) return 1; + if (countB == null) return -1; + + int valA = Integer.parseInt(countA.toString()); + int valB = Integer.parseInt(countB.toString()); + return Integer.compare(valB, valA); // 降序 + }); return resp; } }