Commit 07f72cae by 徐康

Merge branch 'feature/20210122_xukang_麦咖啡p5v3'

parents f5ba0150 2c3d9b4e
package cn.freemud.enums;
public enum CouponExtendTypeEnum {
TYPE_11(11, "太阳蛋"),
;
private Integer code;
private String desc;
CouponExtendTypeEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
......@@ -584,6 +584,7 @@ public class CheckMCCafeOrder {
}
});
}
List<String> skuIdList = shoppingCartGoodsDto.getProducts().stream().map(o -> o.getSkuId()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(mcCafeCouponVos)) {
MCCafeCouponRequest mcCafeCouponRequest = MCCafeCouponRequest.builder()
.ver(88)
......@@ -617,6 +618,10 @@ public class CheckMCCafeOrder {
throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT, "部分优惠券暂时不可用");
}
}
if(o.getCodeInfo().getExtend_type().equals(CouponExtendTypeEnum.TYPE_11.getCode()) && CollectionUtils.isNotEmpty(o.getCodeInfo().getBind_products())
&& !o.getCodeInfo().getBind_products().stream().filter(p -> skuIdList.contains(p.getSku_id())).findFirst().isPresent()) {
throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT, "太阳蛋优惠券必须搭配固定商品同时购买");
}
});
}
}
......
......@@ -110,4 +110,16 @@ public class McdNetCouponInfoRespDto {
*/
private List<McdNetCouponProductRespDto> products;
/**
* 绑定商品
*/
private List<BindProductDto> bind_products;
@Data
public static class BindProductDto {
private String sku_id;
private String spu_id;
private String product_name;
}
}
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