| | |
| | | nearestNextVo.setTime(xpPoint.getParkingTimeLimit()); |
| | | nearestNextVo.setElectronicAreaId(xpPoint.getElectronicAreaId()); |
| | | nearestNextVo.setStationId(xpPoint.getStationId()==null?null:xpPoint.getStationId().toString()); |
| | | nearestNextVo.setIsCollect(2); |
| | | |
| | | // 判断是否收藏 |
| | | if(pointIdsByUserId.getData()!=null && !pointIdsByUserId.getData().isEmpty()){ |
| | |
| | | nearestNextVos.add(nearestNextVo); |
| | | } |
| | | } |
| | | List<NearestNextVo> objects = new ArrayList<NearestNextVo>(); |
| | | if (!nearestNextVos.isEmpty()) { |
| | | nearestNextVos = nearestNextVos.stream().sorted(Comparator.comparing(NearestNextVo::getDistance)).collect(Collectors.toList()); |
| | | //收藏的数据 |
| | | List<NearestNextVo> collect = nearestNextVos.stream().filter(s -> s.getIsCollect() == 1) |
| | | .sorted(Comparator.comparing(NearestNextVo::getDistance).reversed()).collect(Collectors.toList()); |
| | | objects.addAll(collect); |
| | | //非收藏的数据 |
| | | List<NearestNextVo> collect1 = nearestNextVos.stream().filter(s -> s.getIsCollect() == 2) |
| | | .sorted(Comparator.comparing(NearestNextVo::getDistance).reversed()).collect(Collectors.toList()); |
| | | objects.addAll(collect1); |
| | | |
| | | } |
| | | nearestVo.setPoints(nearestNextVos); |
| | | nearestVo.setTotal(nearestNextVos.size()); |