| | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | |
| | | List<HistoryPointDto> history = new ArrayList<>(); |
| | | if(null != dto.getVehicleId()){ |
| | | history = redisService.getCacheList("VEHICLE_HISTORY_POINT_LIST:" + dto.getVehicleId()); |
| | | if(history.size() > 10){ |
| | | history = history.subList(history.size() - 10, history.size()); |
| | | } |
| | | redisService.setCacheList("VEHICLE_HISTORY_POINT_LIST:" + dto.getVehicleId(), history); |
| | | } |
| | | if(history.size() > 10){ |
| | | history = history.subList(history.size() - 10, history.size()); |
| | | } |
| | | redisService.setCacheList("VEHICLE_HISTORY_POINT_LIST:" + dto.getVehicleId(), history); |
| | | RouteVo routeVo = gdMapGeocodingUtil.getDistanceAndTime(dto.getOrigin(), dto.getDestination(), pointStrParam, fenceId,dto.getRoutePlanRule(), history); |
| | | if(routeVo==null){ |
| | | return R.fail("没有找到路线"); |