Commit 8da1db4c by 徐康

买3赠1

parent 7fa1ef62
...@@ -107,6 +107,17 @@ public class ShoppingCartGoodsDto { ...@@ -107,6 +107,17 @@ public class ShoppingCartGoodsDto {
*/ */
private Long payCardFee; private Long payCardFee;
/**
* 麦咖啡-买三赠一券活动号
*/
private String buyThreeGiveOneActivityCode;
/**
* 麦咖啡-买三赠一券默认券号
*/
private String buyThreeGiveOneCouponCode;
@Data @Data
public static class CartGoodsDetailDto { public static class CartGoodsDetailDto {
/** /**
......
...@@ -241,12 +241,36 @@ public class CreateOrderVo { ...@@ -241,12 +241,36 @@ public class CreateOrderVo {
private String monthlyCardCode; private String monthlyCardCode;
/** /**
* 麦咖啡-买三赠一券活动号
*/
private String buyThreeGiveOneActivityCode;
/**
* 麦咖啡-买三赠一券默认券号
*/
private String buyThreeGiveOneCouponCode;
private List<CouponType> couponTypeList;
/**
* 是否使用电子风味卡,如果不为空则为使用 * 是否使用电子风味卡,如果不为空则为使用
*/ */
@Valid @Valid
@ApiModelProperty(value = "电子风味卡") @ApiModelProperty(value = "电子风味卡")
private UnionPayCard unionPayCard; private UnionPayCard unionPayCard;
@Data
public class CouponType {
/**
* 券类型 1:买三赠一券
*/
private Integer type;
/**
* 券code
*/
private String code;
}
/** /**
* 电子风味卡 * 电子风味卡
*/ */
......
...@@ -107,6 +107,18 @@ public class ShoppingCartInfoRequestVo { ...@@ -107,6 +107,18 @@ public class ShoppingCartInfoRequestVo {
private String monthlyCardCode; private String monthlyCardCode;
/**
* 麦咖啡-买三赠一券活动号
*/
private String buyThreeGiveOneActivityCode;
/**
* 麦咖啡-买三赠一券默认券号
*/
private String buyThreeGiveOneCouponCode;
private List<CreateOrderVo.CouponType> couponTypeList;
@Data @Data
public final static class SendGoods { public final static class SendGoods {
/** /**
......
...@@ -31,6 +31,7 @@ public enum ActivityTypeEnum { ...@@ -31,6 +31,7 @@ public enum ActivityTypeEnum {
TYPE_31(31, "折扣券"), TYPE_31(31, "折扣券"),
TYPE_32(32, "商品券"), TYPE_32(32, "商品券"),
TYPE_34(34, "运费券"), TYPE_34(34, "运费券"),
TYPE_35(35, "买三赠一券"),
TYPE_5(5, "整单满金额折"), TYPE_5(5, "整单满金额折"),
TYPE_51(51, "每满金额折"), TYPE_51(51, "每满金额折"),
TYPE_52(52, "阶梯满金额折"), TYPE_52(52, "阶梯满金额折"),
......
...@@ -481,6 +481,9 @@ public class CheckMCCafeOrder { ...@@ -481,6 +481,9 @@ public class CheckMCCafeOrder {
.menuType(createOrderVo.getMenuType()) .menuType(createOrderVo.getMenuType())
.buyMonthlyCard(createOrderVo.getBuyMonthlyCard()) .buyMonthlyCard(createOrderVo.getBuyMonthlyCard())
.monthlyCardCode(createOrderVo.getMonthlyCardCode()) .monthlyCardCode(createOrderVo.getMonthlyCardCode())
.buyThreeGiveOneActivityCode(createOrderVo.getBuyThreeGiveOneActivityCode())
.buyThreeGiveOneCouponCode(createOrderVo.getBuyThreeGiveOneCouponCode())
.couponTypeList(createOrderVo.getCouponTypeList())
.build(); .build();
List<MCCafeCouponVo> couponCodeList = new ArrayList<>(); List<MCCafeCouponVo> couponCodeList = new ArrayList<>();
if("remove".equals(createOrderVo.getCouponCode())) { if("remove".equals(createOrderVo.getCouponCode())) {
...@@ -495,6 +498,9 @@ public class CheckMCCafeOrder { ...@@ -495,6 +498,9 @@ public class CheckMCCafeOrder {
if (StringUtils.isNotBlank(createOrderVo.getFreightCouponCode())) { if (StringUtils.isNotBlank(createOrderVo.getFreightCouponCode())) {
couponCodeList.add(new MCCafeCouponVo(createOrderVo.getFreightCouponCode())); couponCodeList.add(new MCCafeCouponVo(createOrderVo.getFreightCouponCode()));
} }
if (CollectionUtils.isNotEmpty(createOrderVo.getCouponTypeList())) {
createOrderVo.getCouponTypeList().forEach(o -> couponCodeList.add(new MCCafeCouponVo(o.getCode())));
}
if (CollectionUtils.isNotEmpty(couponCodeList)) { if (CollectionUtils.isNotEmpty(couponCodeList)) {
// 校验couponCode // 校验couponCode
MCCafeCouponRequest mcCafeCouponRequest = MCCafeCouponRequest.builder() MCCafeCouponRequest mcCafeCouponRequest = MCCafeCouponRequest.builder()
...@@ -550,7 +556,8 @@ public class CheckMCCafeOrder { ...@@ -550,7 +556,8 @@ public class CheckMCCafeOrder {
List<MCCafeCouponVo> mcCafeCouponVos = new ArrayList<>(); List<MCCafeCouponVo> mcCafeCouponVos = new ArrayList<>();
if(CollectionUtils.isNotEmpty(shoppingCartGoodsDto.getActivityDiscountsDtos())) { if(CollectionUtils.isNotEmpty(shoppingCartGoodsDto.getActivityDiscountsDtos())) {
shoppingCartGoodsDto.getActivityDiscountsDtos().forEach(o-> { shoppingCartGoodsDto.getActivityDiscountsDtos().forEach(o-> {
if(ActivityTypeEnum.TYPE_3.getCode().equals(o.getActivityType()) || ActivityTypeEnum.TYPE_32.getCode().equals(o.getActivityType())) { if(ActivityTypeEnum.TYPE_3.getCode().equals(o.getActivityType()) || ActivityTypeEnum.TYPE_32.getCode().equals(o.getActivityType())
|| ActivityTypeEnum.TYPE_34.getCode().equals(o.getActivityType()) || ActivityTypeEnum.TYPE_35.getCode().equals(o.getActivityType())) {
mcCafeCouponVos.add(new MCCafeCouponVo(o.getActivityCode())); mcCafeCouponVos.add(new MCCafeCouponVo(o.getActivityCode()));
} }
}); });
......
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