From 5041554e7bf313340dcb465a3149df4fba0e4119 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期二, 30 九月 2025 14:29:10 +0800
Subject: [PATCH] 店铺扫码抽奖功能
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
index 6a960c2..f759752 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
@@ -201,7 +201,6 @@
storeCouponSingle.setClaimStatus(ClaimStatusEnum.CLAIM.name());
storeCouponSingle.setClaimUserId(userId);
storeCouponSingle.setClaimUserName(nickName);
- storeCouponSingleService.updateById(storeCouponSingle);
//鏍¢獙鏄惁鍦ㄥ崟鍝佸嵎绫婚鍙栬繃
LambdaQueryWrapper<StoreCoupon> storeCoupQuery = Wrappers.<StoreCoupon>lambdaQuery()
.eq(StoreCoupon::getId, storeCouponSingle.getStoreCoupRef()).last("FOR UPDATE");
@@ -213,8 +212,12 @@
throw new ServiceException("褰撳墠搴楅摵浼樻儬鍗风姸鎬佸紓甯�");
}
//棰嗗彇瀵瑰簲鐨勪紭鎯犲嵎鍐欏叆璁板綍
- memberCouponService.receiveCoupon(storeCouponSingle.getCouponId(),userId , nickName);
+ MemberCoupon memberCoupon = memberCouponService.receiveCoupon(storeCouponSingle.getCouponId(), userId, nickName);
+ String memberCouponId = memberCoupon.getId();
+ storeCouponSingle.setMemberCouponId(memberCouponId);
+ storeCouponSingleService.updateById(storeCouponSingle);
StoreCouponClaimRecord storeCouponClaimRecord = getStoreCouponClaimRecord(storeCouponSingle, userId);
+ storeCouponClaimRecord.setMemberCouponId(memberCouponId);
this.save(storeCouponClaimRecord);
LambdaUpdateWrapper<StoreCoupon> updateStoreCoupon = Wrappers.<StoreCoupon>lambdaUpdate().eq(StoreCoupon::getId, storeCoupon.getId())
.set(StoreCoupon::getCouponClaimNum, storeCoupon.getCouponClaimNum() + 1)
--
Gitblit v1.8.0