|
|
|
@ -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<HighCouponHandselModel> coupon = highCouponHandselService.getHandselListByCoupon(highCoupon.getId()); |
|
|
|
|
model.setHandselCouponList(coupon); |
|
|
|
|
|
|
|
|
|
// 组装赠送卡卷id
|
|
|
|
|
List<Long> handselCouponId = new ArrayList<>(); |
|
|
|
|
if (coupon.size() > 0) { |
|
|
|
|
for (HighCouponHandsel handsel : coupon) { |
|
|
|
|
handselCouponId.add(handsel.getHandselCouponId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
model.setHandselCouponId(handselCouponId); |
|
|
|
|
|
|
|
|
|
return model; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|