...
|
...
|
@@ -10,7 +10,6 @@ import com.yohobuy.ufo.model.order.constants.ChangePriceStatus; |
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.alarm.SmsAlarmEvent;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
|
|
import com.yohoufo.common.utils.AddressUtil;
|
|
|
import com.yohoufo.dal.order.SellerChangePriceRecordMapper;
|
...
|
...
|
@@ -26,7 +25,6 @@ import com.yohoufo.order.charge.ChargeService; |
|
|
import com.yohoufo.order.charge.coupon.CouponService;
|
|
|
import com.yohoufo.order.charge.model.*;
|
|
|
import com.yohoufo.order.constants.ActivityTypeEnum;
|
|
|
import com.yohoufo.order.common.BlackTypeEnum;
|
|
|
import com.yohoufo.order.event.BuyerCancelEvent;
|
|
|
import com.yohoufo.order.event.ErpBuyerOrderEvent;
|
|
|
import com.yohoufo.order.event.NotPaidNoticeEvent;
|
...
|
...
|
@@ -367,22 +365,6 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
logger.info("generate new orderCode:{}",orderCode);
|
|
|
|
|
|
//优惠券支付结果
|
|
|
|
|
|
Optional<CouponPayResult> tempPayResult;
|
|
|
//订单金额明细
|
|
|
AmountDetailBo amountDetailBo = AmountDetailBo.builder()
|
|
|
//商品金额
|
|
|
.goodsAmount(chargeResult.getGoodsAmount())
|
|
|
//运费原价
|
|
|
.shippingAmount(chargeResult.getShippingAmount())
|
|
|
//活动金额
|
|
|
.activityCutAmount(chargeResult.getActivityCutResult().getActivityCutAmount())
|
|
|
//活动券减免金额
|
|
|
.couponCutAmount((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode())).isPresent() ? tempPayResult.get().getCouponAmount() : 0.00)
|
|
|
//运费券减免金额
|
|
|
.shippingCouponCutAmount((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.SHIPPING_COUPON.getCode())).isPresent() ? tempPayResult.get().getCouponAmount() : 0.00)
|
|
|
.build();
|
|
|
|
|
|
List<CouponPayResult> couponPayResults = chargeResult.getCouponPayResultList().getCouponPayResults();
|
|
|
// 减库存,skup更新成不可售,入库
|
|
|
//BigDecimal shipFee = new BigDecimal(delivery_way_sf_cost);
|
...
|
...
|
@@ -410,7 +392,7 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
.activityCutAmount(BigDecimal.valueOf(chargeResult.getActivityCutResult().getActivityCutAmount()))
|
|
|
.build()
|
|
|
)
|
|
|
.amountDetailBo(amountDetailBo)
|
|
|
.amountDetailBo(buildOrderAmountDetailBo(chargeResult))
|
|
|
.build();
|
|
|
|
|
|
BuyerOrderSubmitResult submitResult = ordeCreationService.doSubmitOrder(orderBuilder);
|
...
|
...
|
@@ -495,6 +477,30 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
return orderAttributes;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单金额明细
|
|
|
* @param chargeResult
|
|
|
* @return
|
|
|
*/
|
|
|
protected AmountDetailBo buildOrderAmountDetailBo(ChargeResult chargeResult) {
|
|
|
//订单金额明细
|
|
|
AmountDetailBo amountDetailBo = new AmountDetailBo();
|
|
|
//商品金额
|
|
|
amountDetailBo.setGoodsAmount(chargeResult.getGoodsAmount());
|
|
|
//运费原价
|
|
|
amountDetailBo.setShippingAmount(chargeResult.getShippingAmount());
|
|
|
//活动金额
|
|
|
amountDetailBo.setActivityCutAmount(chargeResult.getActivityCutResult().getActivityCutAmount());
|
|
|
|
|
|
Optional<CouponPayResult> tempPayResult;
|
|
|
//活动券减免金额
|
|
|
amountDetailBo.setCouponCutAmount((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode())).isPresent() ? tempPayResult.get().getCouponAmount() : 0.00);
|
|
|
//运费券减免金额
|
|
|
amountDetailBo.setShippingCouponCutAmount((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.SHIPPING_COUPON.getCode())).isPresent() ? tempPayResult.get().getCouponAmount() : 0.00);
|
|
|
|
|
|
return amountDetailBo;
|
|
|
}
|
|
|
|
|
|
protected int buildDeliveryWay() {
|
|
|
return OrderConstant.DELIVERY_WAY_SF;
|
|
|
}
|
...
|
...
|
|