Commit d7e2d2d2 by huiyang.chen

fix 随单购go

parent 7eadc4c7
...@@ -89,7 +89,7 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo { ...@@ -89,7 +89,7 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo {
/** /**
* 随单购是否购买月享卡 * 随单购是否购买月享卡
* 1:购买,2:不购买 * 1:不购买,2:月卡续费,3:新购月卡
*/ */
private String buyMonthlyCard; private String buyMonthlyCard;
/** /**
......
...@@ -307,6 +307,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -307,6 +307,7 @@ public class ShoppingCartMCoffeeServiceImpl {
Integer orderType = shoppingCartInfoRequestVo.getOrderType(); Integer orderType = shoppingCartInfoRequestVo.getOrderType();
String receiveId = shoppingCartInfoRequestVo.getReceiveId(); String receiveId = shoppingCartInfoRequestVo.getReceiveId();
Long payCardFee = shoppingCartInfoRequestVo.getPayCardFee(); Long payCardFee = shoppingCartInfoRequestVo.getPayCardFee();
String buyMonthlyCard = shoppingCartInfoRequestVo.getBuyMonthlyCard();
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService);
...@@ -318,8 +319,16 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -318,8 +319,16 @@ public class ShoppingCartMCoffeeServiceImpl {
// 重新存储最新购物车 // 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService);
} }
String code = "";
if (StringUtils.isNotEmpty(buyMonthlyCard) ) {
if (Objects.equals(buyMonthlyCard, "2")) {
code = mcCafeUniversalCouponCode;
} else if ( Objects.equals(buyMonthlyCard, "3")){
code = shoppingCartInfoRequestVo.getMonthlyCardCode();
}
}
// 当couponCode不为空时,需参与价格计算 // 当couponCode不为空时,需参与价格计算
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList,shoppingCartInfoRequestVo.getBuyMonthlyCard()); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList, code);
// 促销活动的优惠金额计算 // 促销活动的优惠金额计算
calculationService.updateShoppingCartGoodsDiscount(partnerId, storeId, userId, appId, orderType, assortmentCustomerInfoVo.isMemberPaid(), menuType, receiveId, null, calculationService.updateShoppingCartGoodsDiscount(partnerId, storeId, userId, appId, orderType, assortmentCustomerInfoVo.isMemberPaid(), menuType, receiveId, null,
...@@ -447,6 +456,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -447,6 +456,7 @@ public class ShoppingCartMCoffeeServiceImpl {
String menuType = shoppingCartInfoRequestVo.getMenuType(); String menuType = shoppingCartInfoRequestVo.getMenuType();
Integer orderType = shoppingCartInfoRequestVo.getOrderType(); Integer orderType = shoppingCartInfoRequestVo.getOrderType();
String receiveId = shoppingCartInfoRequestVo.getReceiveId(); String receiveId = shoppingCartInfoRequestVo.getReceiveId();
String buyMonthlyCard = shoppingCartInfoRequestVo.getBuyMonthlyCard();
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService);
...@@ -484,8 +494,17 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -484,8 +494,17 @@ public class ShoppingCartMCoffeeServiceImpl {
// 重新存储最新购物车 // 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, tableNumber, shoppingCartBaseService); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, tableNumber, shoppingCartBaseService);
String code = "";
if (StringUtils.isNotEmpty(buyMonthlyCard) ) {
if (Objects.equals(buyMonthlyCard, "2")) {
code = mcCafeUniversalCouponCode;
} else if ( Objects.equals(buyMonthlyCard, "3")){
code = shoppingCartInfoRequestVo.getMonthlyCardCode();
}
}
// 当couponCode不为空时,需参与价格计算 // 当couponCode不为空时,需参与价格计算
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList,shoppingCartInfoRequestVo.getBuyMonthlyCard()); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList,code);
//加价购商品 //加价购商品
List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods(); List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods();
...@@ -1111,9 +1130,9 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1111,9 +1130,9 @@ public class ShoppingCartMCoffeeServiceImpl {
coupon.setActivityCode(activityCode); coupon.setActivityCode(activityCode);
coupons.add(coupon); coupons.add(coupon);
} }
if (StringUtils.isNotEmpty(buyMonthlyCard) && Objects.equals(buyMonthlyCard, "1")){ if (StringUtils.isNotEmpty(buyMonthlyCard) ) {
ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon coupon = new ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon(); ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon coupon = new ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon();
coupon.setCode(mcCafeUniversalCouponCode); coupon.setCode(buyMonthlyCard);
coupons.add(coupon); coupons.add(coupon);
} }
......
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