From 7f70ec9f4e2d15b2d7ef51d9ce000dd99d2865a2 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 22 Mar 2021 21:04:20 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4diam'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bweb/controller/HighCouponController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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);