From 83e3827db400c41765c095d228768d7b2d9bfbe6 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 22 Mar 2021 21:49:37 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4daim'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hai/service/impl/HighCouponServiceImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 74435425..663c1965 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -7,6 +7,7 @@ import com.hai.common.exception.SysCode; import com.hai.dao.HighCouponHandselMapper; import com.hai.dao.HighCouponMapper; import com.hai.entity.*; +import com.hai.model.HighCouponCodeModel; import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponModel; import com.hai.service.*; @@ -248,8 +249,20 @@ public class HighCouponServiceImpl implements HighCouponService { BeanUtils.copyProperties(highCoupon, model); // 查询有效库存 model.setSalesCount(highCouponCodeService.getStockCountByCoupon(highCoupon.getId())); + // 查询赠送卡卷列表 - model.setHandselCouponList(highCouponHandselService.getHandselListByCoupon(highCoupon.getId())); + List coupon = highCouponHandselService.getHandselListByCoupon(highCoupon.getId()); + model.setHandselCouponList(coupon); + + // 组装赠送卡卷id + List handselCouponId = new ArrayList<>(); + if (coupon.size() > 0) { + for (HighCouponHandsel handsel : coupon) { + handselCouponId.add(handsel.getHandselCouponId()); + } + } + model.setHandselCouponId(handselCouponId); + return model; }