diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index ad995979..0e2a2c12 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -170,11 +170,9 @@ public class HighCouponController { } HighCouponHandselModel highCouponHandsel; - // 查询数据库中的赠送卡卷列表 - List list = highCouponHandselService.getHandselListByCoupon(highCoupon.getId()); // 上传数据与数据库对比,需要新增的数据 for (Long couponId : highCoupon.getHandselCouponId()) { - List collect = list.stream().filter(o -> o.getHandselCouponId().equals(couponId)).collect(Collectors.toList()); + List collect = coupon.getHandselCouponList().stream().filter(o -> o.getHandselCouponId().equals(couponId)).collect(Collectors.toList()); if (collect == null || collect.size() == 0) { highCouponHandsel = new HighCouponHandselModel(); highCouponHandsel.setHandselCouponId(couponId); @@ -187,7 +185,7 @@ public class HighCouponController { } // 上传数据与数据库对比,需要删除的数据 - for (HighCouponHandsel handsel : list) { + for (HighCouponHandsel handsel : coupon.getHandselCouponList()) { List collect = highCoupon.getHandselCouponId().stream().filter(o -> o.equals(handsel.getHandselCouponId())).collect(Collectors.toList()); if (collect == null || collect.size() == 0) { handsel.setStatus(0);