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; }