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