From ff063db138c69b528962a43ecbbc7d64b099bdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=99=93=E5=BC=BA?= Date: Wed, 27 Sep 2023 14:11:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B5=8B=E8=AF=95=E5=A5=97?= =?UTF-8?q?=E4=BB=B6=E6=8A=A5=E5=91=8A=EF=BC=8C=E5=85=B6=E4=B8=AD=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=8C=89=E7=85=A7=E5=BC=80=E5=A7=8B=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E8=BF=9B=E8=A1=8C=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sonic/controller/services/impl/ResultsServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/ResultsServiceImpl.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/ResultsServiceImpl.java index 58244e5d..ff65155d 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/ResultsServiceImpl.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/ResultsServiceImpl.java @@ -165,6 +165,10 @@ public JSONArray findCaseStatus(int id) { jsonObject.put("status", status); jsonObject.put("device", device); result.add(jsonObject); + // 按照执行开始时间排序 - 升序 + result.sort(Comparator.comparing( + obj -> ((JSONObject) obj).getDate("startTime")) + ); } return result; } else {