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