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())) {
|
||||
matchPredicate = matchPredicate // 额外加如下条件
|
||||
.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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user