| @@ -2158,7 +2158,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| Long orderNumber; | Long orderNumber; | ||||
| // 4.1 券价格 | // 4.1 券价格 | ||||
| WxComposeChildOrderPrice price = orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()) | WxComposeChildOrderPrice price = orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()) | ||||
| .getChildCouponOrderPrice(coupon, orderdto.getSignleOrder().isPressOrder(), orderdto.getSignleOrder().getOrderGroupId(), couponNumber); | |||||
| .getChildCouponOrderPrice(orderdto,coupon, orderdto.getSignleOrder().isPressOrder(), orderdto.getSignleOrder().getOrderGroupId(), couponNumber); | |||||
| Integer orderStatus = OrderHelper.getOrderStatusWxCoupon(coupon, orderdto.getSignleOrder().getOrderGroupId()); | Integer orderStatus = OrderHelper.getOrderStatusWxCoupon(coupon, orderdto.getSignleOrder().getOrderGroupId()); | ||||
| @@ -37,7 +37,7 @@ public interface OrderAdapterService { | |||||
| * @param coupon | * @param coupon | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxComposeChildOrderPrice getChildCouponOrderPrice(WxCoupon coupon,boolean isPress,Long orderGroupId,Integer couponNumber); | |||||
| WxComposeChildOrderPrice getChildCouponOrderPrice(OrderComposeSaveDto orderdto,WxCoupon coupon,boolean isPress,Long orderGroupId,Integer couponNumber); | |||||
| /** | /** | ||||
| * 计算每一个子订单的补贴 | * 计算每一个子订单的补贴 | ||||
| @@ -13,6 +13,7 @@ import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayOrder; | import com.iformall.domain.po.WxPayOrder; | ||||
| import com.iformall.enums.EnumComposeOrder; | import com.iformall.enums.EnumComposeOrder; | ||||
| import com.iformall.enums.EnumOrderShopingType; | |||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.mapper.WxOrderMapper; | import com.iformall.mapper.WxOrderMapper; | ||||
| import com.iformall.service.order.OrderAdapterService; | import com.iformall.service.order.OrderAdapterService; | ||||
| @@ -53,9 +54,13 @@ public class SingleOrderAdapterService implements OrderAdapterService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxComposeChildOrderPrice getChildCouponOrderPrice(WxCoupon coupon, boolean isPress, Long orderGroupId, | |||||
| public WxComposeChildOrderPrice getChildCouponOrderPrice(OrderComposeSaveDto orderdto,WxCoupon coupon, boolean isPress, Long orderGroupId, | |||||
| Integer couponNumber) { | Integer couponNumber) { | ||||
| Integer perPrice = OrderHelper.getCouponPerPayment(coupon, isPress, orderGroupId); | 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()); | return new WxComposeChildOrderPrice(perPrice, couponNumber, coupon.getId()); | ||||
| } | } | ||||
| @@ -40,8 +40,12 @@ public abstract class BaseBatchOrderAdapterService implements OrderAdapterServic | |||||
| WxOrderMapper wxOrderMapper; | WxOrderMapper wxOrderMapper; | ||||
| @Override | @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); | 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()); | return new WxComposeChildOrderPrice(perPrice, couponNumber, coupon.getId()); | ||||
| } | } | ||||
| @@ -54,12 +58,9 @@ public abstract class BaseBatchOrderAdapterService implements OrderAdapterServic | |||||
| int payment = 0; | int payment = 0; | ||||
| for (OrderComposeSaveDto ocsd : orderSave) { | for (OrderComposeSaveDto ocsd : orderSave) { | ||||
| boolean isPress = ocsd.getSignleOrder().isPressOrder(); | 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(); | payment = payment+price.getRealPayMent(); | ||||
| //在线配送加上运费 | |||||
| if (EnumOrderShopingType.DISTRIBUTION.getCode().equals(ocsd.getShippingType())) { | |||||
| payment = payment + ocsd.getWxCoupon().getFreightPrice(); | |||||
| } | |||||
| } | } | ||||
| order.setPayment(payment); | order.setPayment(payment); | ||||
| order.setCreateDate(new Date()); | order.setCreateDate(new Date()); | ||||