| | |
| | | import com.xiaopeng.api.dto.map.RouteStaleCheckDto; |
| | | import com.xiaopeng.api.dto.map.SelectNavigationRouteDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.feignClient.order.XpOrderClient; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.vo.HotFixInfoVo; |
| | | import com.xiaopeng.api.vo.operation.MultiRouteAndFareVo; |
| | |
| | | private final IXpGeoQueryEntityService xpGeoQueryEntityService; |
| | | private final RedisService redisService; |
| | | private final ImageTagProcessor imageTagProcessor; |
| | | private final XpOrderClient xpOrderClient; |
| | | |
| | | |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, RedisService redisService, ImageTagProcessor imageTagProcessor) { |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, RedisService redisService, ImageTagProcessor imageTagProcessor, XpOrderClient xpOrderClient) { |
| | | this.xpPricingService = xpPricingService; |
| | | this.xpGeoQueryEntityService = xpGeoQueryEntityService; |
| | | this.redisService = redisService; |
| | | this.imageTagProcessor = imageTagProcessor; |
| | | this.xpOrderClient = xpOrderClient; |
| | | } |
| | | |
| | | |
| | |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<?> saveOrder(@RequestBody @Validated XpOrderDto dto, HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | R<Long> hasOrderResult = xpOrderClient.hasUnPayOrder(uid); |
| | | if (hasOrderResult == null || R.isError(hasOrderResult)) { |
| | | return R.fail("订单状态查询失败"); |
| | | } |
| | | Long existingOrderId = hasOrderResult.getData(); |
| | | if (existingOrderId != null && existingOrderId > 0) { |
| | | return R.fail("有未支付订单"); |
| | | } |
| | | String orderId = xpPricingService.saveOrder(dto, uid); |
| | | if(orderId==null){ |
| | | String language = request.getHeader("language"); |