Commit cb6ba67162cf108ba26aa474efd31cea894feae5
1 parent
0b832311f4
Exists in
master
and in
6 other branches
排序
Showing 2 changed files with 13 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TempFacade.java
View file @
cb6ba67
... | ... | @@ -262,9 +262,8 @@ |
262 | 262 | restList.add(map); |
263 | 263 | } |
264 | 264 | } |
265 | - Object[] objects = restList.toArray(); | |
266 | - CollectionUtils.reverseArray(objects); | |
267 | - return RespBuilder.buildSuccess(objects); | |
265 | + com.lyms.platform.operate.web.utils.CollectionUtils.reverseList(restList); | |
266 | + return RespBuilder.buildSuccess(restList); | |
268 | 267 | } |
269 | 268 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
cb6ba67
... | ... | @@ -209,5 +209,16 @@ |
209 | 209 | return data.subList(startIndex, endIndex); |
210 | 210 | } |
211 | 211 | |
212 | + public static void reverseList(List<Map<String, Object>> restList) { | |
213 | + if(CollectionUtils.isNotEmpty(restList)) { | |
214 | + List<Map<String, Object>> tempList = new ArrayList<>(); | |
215 | + int size = restList.size(); | |
216 | + for (int i = size - 1; i > 0 ; i--) { | |
217 | + tempList.add(restList.get(i)); | |
218 | + } | |
219 | + restList.clear(); | |
220 | + restList.addAll(tempList); | |
221 | + } | |
222 | + } | |
212 | 223 | } |