Sfoglia il codice sorgente

修复直播问题

yh 1 settimana fa
parent
commit
727fea8a12

+ 9 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java

@@ -353,6 +353,15 @@ public class LiveCouponServiceImpl implements ILiveCouponService
         liveCouponUserService.insertLiveCouponUser(userRecord);
         liveCouponIssueUserService.insertLiveCouponIssueUser(record);
 
+        // 更新优惠卷数量
+        if (issue.getRemainCount() > 0) {
+            LiveCouponIssue liveCouponIssue = new LiveCouponIssue();
+            liveCouponIssue.setId(issue.getId());
+            liveCouponIssue.setRemainCount(issue.getRemainCount() - 1);
+            liveCouponIssueMapper.updateLiveCouponIssue(liveCouponIssue);
+        }
+
+
         // 对于非无门槛优惠券,记录到Redis(防止重复领取)
         if (!isNoThresholdCoupon) {
             redisCache.hashPut(String.format(LiveKeysConstant.LIVE_HOME_PAGE_CONFIG_COUPON, coupon.getLiveId(), coupon.getCouponIssueId()), String.valueOf(coupon.getUserId()), JSONUtil.toJsonStr(record));