|
@@ -109,9 +109,15 @@ public class CouponIssueServiceImp extends ServiceImpl<CouponIssueMapper, Coupon
|
|
|
@Transactional
|
|
|
public void issueCoupon(Long couponId, List<UserParam> userParam, Long issuer, String reason) {
|
|
|
CouponInfo couponInfo = couponInfoService.queryCouponInfoById(couponId);
|
|
|
+ if (couponInfo == null) {
|
|
|
+ throw new BizException("未找到优惠券信息");
|
|
|
+ }
|
|
|
if (couponInfo.getInventory() < userParam.size()) {
|
|
|
throw new BizException("库存不足");
|
|
|
}
|
|
|
+ if (couponInfo.getStatus() == EStatus.DISABLE.getValue()) {
|
|
|
+ throw new BizException("优惠券已被禁用");
|
|
|
+ }
|
|
|
// 判断优惠券类型 设置优惠券时间
|
|
|
Long startTime = null;
|
|
|
Long endTime = null;
|