From 7b45bb819a6517f07783976c78bdf5aa4b9f1d38 Mon Sep 17 00:00:00 2001 From: xbx <1827135378@qq.com> Date: Tue, 23 Apr 2024 08:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B9=E6=8D=AE=E4=B8=93?= =?UTF-8?q?=E4=B8=9A=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/service/impl/Cet_4ServiceImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/service/impl/Cet_4ServiceImpl.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/service/impl/Cet_4ServiceImpl.java index 59ec13d9..4b69d1eb 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/service/impl/Cet_4ServiceImpl.java +++ b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/service/impl/Cet_4ServiceImpl.java @@ -394,6 +394,14 @@ public class Cet_4ServiceImpl extends ServiceImpl implements json.put("passRate", df.format(passRate)); ansArray.add(json); } + //将ans按照entrydate从小到大排序 + ansArray.sort((o1, o2) -> { + JSONObject json1 = (JSONObject) o1; + JSONObject json2 = (JSONObject) o2; + String entryDate1 = json1.getString("entryDate"); + String entryDate2 = json2.getString("entryDate"); + return entryDate1.compareTo(entryDate2); + }); ans.put((String) major, ansArray); } } else { @@ -451,6 +459,14 @@ public class Cet_4ServiceImpl extends ServiceImpl implements json.put("passRate", df.format(passRate)); ansArray.add(json); } + //将ans按照entrydate从小到大排序 + ansArray.sort((o1, o2) -> { + JSONObject json1 = (JSONObject) o1; + JSONObject json2 = (JSONObject) o2; + String entryDate1 = json1.getString("entryDate"); + String entryDate2 = json2.getString("entryDate"); + return entryDate1.compareTo(entryDate2); + }); ans.put((String) major, ansArray); } }