| | |
| | | } else { |
| | | //大于总层数先取totalLyaer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | int remainCount = templist.size() % totalLayer; |
| | | if (targetSlot == 931) { |
| | | baseInfoList = templist.subList(0, templist.size() - remainCount); |
| | | if (targetSlot == 930) { |
| | | baseInfoList = templist.subList(0, totalLayer - 1); |
| | | } else { |
| | | //930时玻璃顺序倒序、同一对玻璃倒序 |
| | | baseInfoList = templist.subList(0, templist.size() - remainCount); |
| | | Map<Integer, List<T>> listMap = baseInfoList.stream().collect(Collectors.groupingBy(T::getHollowSequence)); |
| | | Map<Integer, List<T>> sortListMap = new TreeMap<>(Collections.reverseOrder()); |
| | | sortListMap.putAll(listMap); |
| | | List<T> resultList = new ArrayList<>(); |
| | | for (Map.Entry<Integer, List<T>> e : sortListMap.entrySet()) { |
| | | for (T t : e.getValue()) { |
| | | resultList.add(t); |
| | | } |
| | | } |
| | | baseInfoList = resultList; |
| | | } |
| | | } |
| | | } |