|
@@ -107,7 +107,10 @@ public class CouponMgrController extends BaseApiController {
|
|
|
// 排除采购商品已绑定的优惠劵
|
|
|
List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, 3));
|
|
|
List<Long> couponIdList = goodsList.stream().map(Goods::getRefId).map(Long::new).collect(Collectors.toList());
|
|
|
- couponIdList.removeIf(c -> c.equals(Long.valueOf(coupon.getCouponId())));
|
|
|
+ if (coupon.getCouponId() != null) {
|
|
|
+ // 商品自己绑定的优惠劵不去除
|
|
|
+ couponIdList.removeIf(c -> c.equals(Long.valueOf(coupon.getCouponId())));
|
|
|
+ }
|
|
|
coupon.setExcludeCouponIds(couponIdList);
|
|
|
}
|
|
|
List<Coupon> list = new ArrayList<Coupon>();
|