|
|
|
@@ -40,8 +40,12 @@ public abstract class BaseBatchOrderAdapterService implements OrderAdapterServic |
|
|
|
WxOrderMapper wxOrderMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxComposeChildOrderPrice getChildCouponOrderPrice(WxCoupon coupon,boolean isPress,Long orderGroupId,Integer couponNumber) { |
|
|
|
public WxComposeChildOrderPrice getChildCouponOrderPrice(OrderComposeSaveDto orderdto,WxCoupon coupon,boolean isPress,Long orderGroupId,Integer couponNumber) { |
|
|
|
Integer perPrice = OrderHelper.getCouponPerPayment(coupon, isPress, orderGroupId); |
|
|
|
//在线配送加上运费 |
|
|
|
if (EnumOrderShopingType.DISTRIBUTION.getCode().equals(orderdto.getShippingType())) { |
|
|
|
perPrice = perPrice + coupon.getFreightPrice(); |
|
|
|
} |
|
|
|
return new WxComposeChildOrderPrice(perPrice, couponNumber, coupon.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -54,12 +58,9 @@ public abstract class BaseBatchOrderAdapterService implements OrderAdapterServic |
|
|
|
int payment = 0; |
|
|
|
for (OrderComposeSaveDto ocsd : orderSave) { |
|
|
|
boolean isPress = ocsd.getSignleOrder().isPressOrder(); |
|
|
|
WxComposeChildOrderPrice price = getChildCouponOrderPrice(ocsd.getWxCoupon(), isPress, ocsd.getSignleOrder().getOrderGroupId(), ocsd.getCount()); |
|
|
|
WxComposeChildOrderPrice price = getChildCouponOrderPrice(ocsd,ocsd.getWxCoupon(), isPress, ocsd.getSignleOrder().getOrderGroupId(), ocsd.getCount()); |
|
|
|
payment = payment+price.getRealPayMent(); |
|
|
|
//在线配送加上运费 |
|
|
|
if (EnumOrderShopingType.DISTRIBUTION.getCode().equals(ocsd.getShippingType())) { |
|
|
|
payment = payment + ocsd.getWxCoupon().getFreightPrice(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
order.setPayment(payment); |
|
|
|
order.setCreateDate(new Date()); |
|
|
|
|