Commit 4568d9fa by 周晓航

新增字段用于优惠券使用门槛

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent ef2565a0
......@@ -406,6 +406,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
//埋点添加购物车行为
this.buriedPointShoppingCart(addShoppingCartGoodsRequestVo, spuId, productName);
this.shoppingCartAddOrListCommonResponseHandle(shoppingCartGoodsResponseVo);
return ResponseUtil.success(shoppingCartGoodsResponseVo);
}
......@@ -867,8 +868,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
updateForPopupWindow(shoppingCartGoodsResponseVo, premiumExchangeResponseVoBaseResponse.getResult().getShowType(), chooseSendGoodList, shoppingCartInfoRequestVo.getSendGoods());
}
// 设置优惠券的使用门槛金额, 需要排除券的金额
Long useCouponThreshold = this.getUseCouponThreshold(shoppingCartGoodsResponseVo.getProducts());
shoppingCartGoodsResponseVo.setUseCouponThreshold(useCouponThreshold);
this.shoppingCartAddOrListCommonResponseHandle(shoppingCartGoodsResponseVo);
// 校验入参券是否可用
if (!checkAvailableCoupon(shoppingCartGoodsResponseVo, shoppingCartInfoRequestVo.getCouponCode())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_COUPON_NOT_USE);
......@@ -877,6 +877,20 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
/**
* 加车 和list接口 公用处理方法
* @param shoppingCartGoodsResponseVo
*/
private void shoppingCartAddOrListCommonResponseHandle(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo){
if (Objects.isNull(shoppingCartGoodsResponseVo)) {
return;
}
// 设置 使用信息
Long useCouponThreshold = this.getUseCouponThreshold(shoppingCartGoodsResponseVo.getProducts());
shoppingCartGoodsResponseVo.setUseCouponThreshold(useCouponThreshold);
}
/**
* 获取 券使用的门槛信息
* @param products
* @return
......
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