mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 00:15:06 +08:00
promotion: 订单使用品类券时,根据品类过滤可用商品
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user