| | |
| | | List<Item> itemsTotal; |
| | | List<Item> items = new ArrayList<>(); |
| | | //按字符串排序 |
| | | List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted).reversed()).collect(Collectors.toList()); |
| | | List<Item> itemList = itemService.cacheGetAll().stream() |
| | | .sorted(Comparator.comparing( |
| | | item -> Integer.parseInt(item.getSorted()), |
| | | Comparator.reverseOrder() |
| | | )) |
| | | .collect(Collectors.toList()); |
| | | |
| | | //按数字排序 |
| | | // List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted, (x,y)->{ |
| | | // int xInt = 0; |