| | |
| | | |
| | | |
| | | // 获取起步里程 |
| | | XpPricing xpPricing = this.baseMapper.selectOne(new LambdaQueryWrapper<XpPricing>().eq(XpPricing::getCityId, dto.getOpenCityId())); |
| | | Integer startMileage = XpPricingUtil.getStartMileage(xpPricing.getStartingFareJson()); |
| | | if (startMileage == null) { |
| | | throw new ServiceException("当前区域未开通服务", I18nKeyConstant.NO_CURRENT_REGION); |
| | | } |
| | | // XpPricing xpPricing = this.baseMapper.selectOne(new LambdaQueryWrapper<XpPricing>().eq(XpPricing::getCityId, dto.getOpenCityId())); |
| | | // Integer startMileage = XpPricingUtil.getStartMileage(xpPricing.getStartingFareJson()); |
| | | // if (startMileage == null) { |
| | | // throw new ServiceException("当前区域未开通服务", I18nKeyConstant.NO_CURRENT_REGION); |
| | | // } |
| | | |
| | | |
| | | // 根据id获取手机号 |
| | |
| | | // 生成订单数据 |
| | | XpOrder xpOrder = new XpOrder(); |
| | | |
| | | xpOrder.setStartMileage(Double.valueOf(startMileage)); |
| | | // xpOrder.setStartMileage(Double.valueOf(startMileage)); |
| | | |
| | | xpOrder.setAppUserId(Long.valueOf(uid)); |
| | | xpOrder.setOrderNumber("XP" + System.currentTimeMillis()); |
| | |
| | | Integer distance = 0; |
| | | Integer duration = 0; |
| | | if (distanceAndDuration.getCode() != 200) { |
| | | throw new ServiceException("订单生成失败", I18nKeyConstant.ORDER_CREATE_FAIL); |
| | | // throw new ServiceException("订单生成失败", I18nKeyConstant.ORDER_CREATE_FAIL); |
| | | } |
| | | distance = distanceAndDuration.getData().getDistance(); |
| | | duration = distanceAndDuration.getData().getDuration(); |
| | | // distance = distanceAndDuration.getData().getDistance(); |
| | | // duration = distanceAndDuration.getData().getDuration(); |
| | | |
| | | |
| | | // 产生订单 |