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 {