Commit 864d4292 by huiyang.chen

fix 随单购优惠提供给券码

parent d6e507d3
...@@ -4,6 +4,7 @@ public enum SaveCouponType { ...@@ -4,6 +4,7 @@ public enum SaveCouponType {
COUPON(1, "代金券"), COUPON(1, "代金券"),
FREIGHT_COUPON(2, "运费券"), FREIGHT_COUPON(2, "运费券"),
MON_COUPON(3, "随单购月卡"),
; ;
private Integer code; private Integer code;
......
...@@ -398,6 +398,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -398,6 +398,7 @@ public class ShoppingCartMCoffeeServiceImpl {
code = mcCafeUniversalCouponCode; code = mcCafeUniversalCouponCode;
payCardPrice = Long.valueOf(payCardFee); payCardPrice = Long.valueOf(payCardFee);
} }
assortmentSdkService.setShoppingCartCouponCode(partnerId, storeId, userId, code, shoppingCartBaseService, SaveCouponType.MON_COUPON.getCode());
} }
// 当couponCode不为空时,需参与价格计算 // 当couponCode不为空时,需参与价格计算
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList,shoppingCartInfoRequestVo.getFreightCouponCode(), code); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList,shoppingCartInfoRequestVo.getFreightCouponCode(), code);
...@@ -446,11 +447,16 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -446,11 +447,16 @@ public class ShoppingCartMCoffeeServiceImpl {
CustomerInfoVo assortmentCustomerInfoVo = getCustomerInfoVo(requestVo.getSessionId()); CustomerInfoVo assortmentCustomerInfoVo = getCustomerInfoVo(requestVo.getSessionId());
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCartForCoupon(requestVo.getPartnerId(), requestVo.getStoreId(), requestVo.getUserId(), "", shoppingCartBaseService); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCartForCoupon(requestVo.getPartnerId(), requestVo.getStoreId(), requestVo.getUserId(), "", shoppingCartBaseService);
String buyMonthlyCard = assortmentSdkService.getShoppingCartCoupon(requestVo.getPartnerId(), requestVo.getStoreId(), requestVo.getUserId(), shoppingCartBaseService, SaveCouponType.MON_COUPON.getCode());
Long payCardPrice = null;
if (StringUtils.isNotEmpty(buyMonthlyCard)){
payCardPrice = Long.valueOf(payCardFee);
}
// 当couponCode不为空时,需参与价格计算 // 当couponCode不为空时,需参与价格计算
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(null, null, cartGoodsList,null,null); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(null, null, cartGoodsList,null,buyMonthlyCard);
// 促销活动的优惠金额计算 // 促销活动的优惠金额计算
calculationService.updateShoppingCartGoodsDiscount(requestVo.getPartnerId(), requestVo.getStoreId(), requestVo.getUserId(), requestVo.getAppId(), requestVo.getOrderType(), assortmentCustomerInfoVo.isMemberPaid(), requestVo.getMenuType(), requestVo.getReceiveId(), null, calculationService.updateShoppingCartGoodsDiscount(requestVo.getPartnerId(), requestVo.getStoreId(), requestVo.getUserId(), requestVo.getAppId(), requestVo.getOrderType(), assortmentCustomerInfoVo.isMemberPaid(), requestVo.getMenuType(), requestVo.getReceiveId(), null,
cartGoodsList, coupons, new ArrayList<>(), shoppingCartGoodsResponseVo,null); cartGoodsList, coupons, new ArrayList<>(), shoppingCartGoodsResponseVo,payCardPrice);
String moneyCoupon = assortmentSdkService.getShoppingCartCoupon(requestVo.getPartnerId(), String moneyCoupon = assortmentSdkService.getShoppingCartCoupon(requestVo.getPartnerId(),
requestVo.getStoreId(), requestVo.getUserId(), shoppingCartBaseService,SaveCouponType.COUPON.getCode()); requestVo.getStoreId(), requestVo.getUserId(), shoppingCartBaseService,SaveCouponType.COUPON.getCode());
String deliveryFeeCoupon = assortmentSdkService.getShoppingCartCoupon(requestVo.getPartnerId(),requestVo.getStoreId(),requestVo.getUserId(),shoppingCartBaseService,SaveCouponType.FREIGHT_COUPON.getCode()); String deliveryFeeCoupon = assortmentSdkService.getShoppingCartCoupon(requestVo.getPartnerId(),requestVo.getStoreId(),requestVo.getUserId(),shoppingCartBaseService,SaveCouponType.FREIGHT_COUPON.getCode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment