mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
promotion: 订单使用品类券时,根据品类过滤可用商品
This commit is contained in:
parent
8bbaaf1ce9
commit
71efa0ed6f
@ -103,6 +103,9 @@ public class TradeCouponPriceCalculator implements TradePriceCalculator {
|
|||||||
if (PromotionProductScopeEnum.SPU.getScope().equals(coupon.getProductScope())) {
|
if (PromotionProductScopeEnum.SPU.getScope().equals(coupon.getProductScope())) {
|
||||||
matchPredicate = matchPredicate // 额外加如下条件
|
matchPredicate = matchPredicate // 额外加如下条件
|
||||||
.and(orderItem -> coupon.getProductScopeValues().contains(orderItem.getSpuId()));
|
.and(orderItem -> coupon.getProductScopeValues().contains(orderItem.getSpuId()));
|
||||||
|
} else if (PromotionProductScopeEnum.CATEGORY.getScope().equals(coupon.getProductScope())) {
|
||||||
|
matchPredicate = matchPredicate // 额外加如下条件
|
||||||
|
.and(orderItem -> coupon.getProductScopeValues().contains(orderItem.getCategoryId()));
|
||||||
}
|
}
|
||||||
return filterList(result.getItems(), matchPredicate);
|
return filterList(result.getItems(), matchPredicate);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user