| | |
| | | import com.xiaopeng.order.job.base.QuartzManager; |
| | | import com.xiaopeng.order.job.base.TimeJobType; |
| | | import com.xiaopeng.order.job.jobs.OrderCancelJob; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | // 根据订单所属开通城市id 查询定价 |
| | | R<XpPricing> pricingByCityId = xpPricingClient.getPricingByCityId(order.getCityId()); |
| | | XpPricing pricing = pricingByCityId.getData(); |
| | | |
| | | if (pricing == null) { |
| | | throw new ServiceException("当前城市未配置定价规则", I18nKeyConstant.ORDER_PRICING_NOT_EXISTS); |
| | | } |
| | | Long id = pricing.getId(); |
| | | Integer pricingType = pricing.getPricingType(); |
| | | String basicPricingJson = pricing.getBasicPricingJson(); |
| | | String startingFareJson = pricing.getStartingFareJson(); |
| | | String dynamicPricingJson = pricing.getDynamicPricingJson(); |
| | | String priceRule = pricing.getPriceRule(); |
| | | if (pricing == null) { |
| | | throw new ServiceException("当前城市未配置定价规则", I18nKeyConstant.ORDER_PRICING_NOT_EXISTS); |
| | | } |
| | | // 根据计价规则计算费用 |
| | | BigDecimal startMoney = BigDecimal.ZERO;// 起步价 |
| | | BigDecimal mileageMoney = BigDecimal.ZERO;// 里程费 |
| | | BigDecimal durationMoney = BigDecimal.ZERO;// 时长费 |
| | | BigDecimal waitMoney = BigDecimal.ZERO;// 等待费 |
| | | BigDecimal longDistancemoney = BigDecimal.ZERO;// 远途费 |
| | | BigDecimal redPacketMoney = BigDecimal.ZERO;// 红包抵扣金额 |
| | | BigDecimal couponMoney = BigDecimal.ZERO;// 优惠券抵扣金额 |
| | | if (pricingType==1){ |
| | | |
| | | }else{ |
| | | |
| | | } |
| | | if (org.springframework.util.StringUtils.hasLength(basicPricingJson)){ |
| | | |
| | | } |
| | | if (org.springframework.util.StringUtils.hasLength(startingFareJson)){ |
| | | |
| | | } |
| | | if (org.springframework.util.StringUtils.hasLength(dynamicPricingJson)){ |
| | | |
| | | } |
| | | if (org.springframework.util.StringUtils.hasLength(priceRule)){ |
| | | |
| | | } |
| | | // 计算完价格后 挑选优惠券 |
| | | GetUserCouponDto getUserCouponDto = new GetUserCouponDto(); |
| | | getUserCouponDto.setUserId(Long.valueOf(uid)); |