| | |
| | | if (xpPricing == null) { |
| | | throw new ServiceException("当前区域未开通服务", I18nKeyConstant.NO_CURRENT_REGION); |
| | | } |
| | | List<XpRoutePlan> xpRoutePlan = xpRoutePlanMapper.selectList(new LambdaQueryWrapper<XpRoutePlan>().eq(XpRoutePlan::getAuditStatus, 2).eq(XpRoutePlan::getCityCode, cityCode)); |
| | | routeAndFareDto.setOpenCityId(openCities.getId()); |
| | | List<XpRoutePlan> xpRoutePlan = xpRoutePlanMapper.selectList(new LambdaQueryWrapper<XpRoutePlan>().eq(XpRoutePlan::getAuditStatus, 2).eq(XpRoutePlan::getOpenCityId, cityCode)); |
| | | |
| | | // 找出用户偏好 |
| | | Object cacheObject = redisService.getCacheObject(CacheConstants.USER_ROUTE_PREFERENCE + userId); |
| | |
| | | if (xpRoutePlan != null) { |
| | | routeAndFareDto.setRoutePlanRule(routePlan.getRoutePlanRule()); |
| | | } |
| | | Object userPref = redisService.getCacheObject(CacheConstants.USER_ROUTE_PREFERENCE + userId); |
| | | if (userPref != null) { |
| | | try { |
| | | routeAndFareDto.setRoutePlanRule(Integer.valueOf(userPref.toString())); |
| | | } catch (Exception ignored) { |
| | | // keep city default |
| | | } |
| | | } |
| | | // Object userPref = redisService.getCacheObject(CacheConstants.USER_ROUTE_PREFERENCE + userId); |
| | | // if (userPref != null) { |
| | | // try { |
| | | // routeAndFareDto.setRoutePlanRule(Integer.valueOf(userPref.toString())); |
| | | // } catch (Exception ignored) { |
| | | // // keep city default |
| | | // } |
| | | // } |
| | | |
| | | // 算距离 |
| | | R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto); |