Commit 91dd58b40936f7f33cfffa4220341b391093871b
1 parent
12798af40d
Exists in
master
and in
6 other branches
bbbbbb
Showing 2 changed files with 12 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
91dd58b
| ... | ... | @@ -680,6 +680,8 @@ |
| 680 | 680 | setReport(tzMap, weights, antExChuModels.get(antExChuModels.size() - 1).getYqWeight(), PatientWeightServiceImpl.getBmi(antExChuModels.get(antExChuModels.size() - 1).getYqWeight(), antExChuModels.get(antExChuModels.size() - 1).getHeight())); |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | + CollectionUtils.sortListByMapKeyWithDateYmd(restList, "checkTime"); | |
| 684 | + | |
| 683 | 685 | return RespBuilder.buildSuccess("tabList", restList, "xyMap", xyMap, "tzMap", tzMap); |
| 684 | 686 | } |
| 685 | 687 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
91dd58b
| ... | ... | @@ -243,5 +243,15 @@ |
| 243 | 243 | }); |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | + | |
| 247 | + public static void sortListByMapKeyWithDateYmd(List<Map<String, Object>> list, final String key) { | |
| 248 | + if(CollectionUtils.isNotEmpty(list) && StringUtils.isNotEmpty(key)) { | |
| 249 | + Collections.sort(list, new Comparator<Map<String, Object>>() { | |
| 250 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 251 | + return new Long(DateUtil.parseYMD((String) o1.get(key)).getTime() - DateUtil.parseYMDHMS((String) o2.get(key)).getTime()).intValue(); | |
| 252 | + } | |
| 253 | + }); | |
| 254 | + } | |
| 255 | + } | |
| 246 | 256 | } |