| | |
| | | List<XpHistoryStartPointsVo> objects = new ArrayList<XpHistoryStartPointsVo>(); |
| | | if(!data.isEmpty()){ |
| | | //收藏的数据 |
| | | List<XpHistoryStartPointsVo> collect = data.stream().filter(s -> s.getIsCollect() == 1).collect(Collectors.toList()); |
| | | collect.sort((o1, o2)->o1.getDistance().compareTo(o2.getDistance()) * -1); |
| | | List<XpHistoryStartPointsVo> collect = data.stream().filter(s -> s.getIsCollect() == 1) |
| | | .sorted(Comparator.comparing(XpHistoryStartPointsVo::getDistance)).collect(Collectors.toList()); |
| | | objects.addAll(collect); |
| | | //非收藏的数据 |
| | | List<XpHistoryStartPointsVo> collect1 = data.stream().filter(s -> s.getIsCollect() == 2).collect(Collectors.toList()); |
| | | collect1.sort((o1, o2)->o1.getDistance().compareTo(o2.getDistance()) * -1); |
| | | List<XpHistoryStartPointsVo> collect1 = data.stream().filter(s -> s.getIsCollect() == 2) |
| | | .sorted(Comparator.comparing(XpHistoryStartPointsVo::getDistance)).collect(Collectors.toList()); |
| | | objects.addAll(collect1); |
| | | } |
| | | return objects; |
| | |
| | | List<XpHistoryEndPointsVo> objects = new ArrayList<XpHistoryEndPointsVo>(); |
| | | if(!data.isEmpty()){ |
| | | //收藏的数据 |
| | | List<XpHistoryEndPointsVo> collect = data.stream().filter(s -> s.getIsCollect() == 1).collect(Collectors.toList()); |
| | | collect.sort((o1, o2)->o1.getDistance().compareTo(o2.getDistance()) * -1); |
| | | List<XpHistoryEndPointsVo> collect = data.stream().filter(s -> s.getIsCollect() == 1) |
| | | .sorted(Comparator.comparing(XpHistoryEndPointsVo::getDistance)).collect(Collectors.toList()); |
| | | objects.addAll(collect); |
| | | //非收藏的数据 |
| | | List<XpHistoryEndPointsVo> collect1 = data.stream().filter(s -> s.getIsCollect() == 2).collect(Collectors.toList()); |
| | | collect1.sort((o1, o2)->o1.getDistance().compareTo(o2.getDistance()) * -1); |
| | | List<XpHistoryEndPointsVo> collect1 = data.stream().filter(s -> s.getIsCollect() == 2) |
| | | .sorted(Comparator.comparing(XpHistoryEndPointsVo::getDistance)).collect(Collectors.toList()); |
| | | objects.addAll(collect1); |
| | | } |
| | | return objects; |