From 8059e9b991c15edbac508e6b658a0d9571d11b1c Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期五, 01 八月 2025 12:46:00 +0800
Subject: [PATCH] bug修改

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
index 6444bad..7da8395 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
@@ -19,9 +19,11 @@
 import com.ruoyi.goods.service.lottery.IUserLotteryEventService;
 import com.ruoyi.system.api.domain.poji.goods.Goods;
 import com.ruoyi.system.api.domain.poji.shop.Shop;
+import com.ruoyi.system.api.service.RemoteMemberService;
 import com.ruoyi.system.api.service.RemoteShopService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -36,6 +38,7 @@
  * @author zhibing.pu
  * @Date 2025/5/8 18:13
  */
+@Slf4j
 @Api(value = "商户端商户相关接口", tags = "商户端商户相关接口", description = "商户端商户相关接口")
 @RestController
 @RequestMapping("/mer/lotteryEvent")
@@ -55,6 +58,9 @@
 	
 	@Resource
 	private GoodsService goodsService;
+	
+	@Resource
+	private RemoteMemberService remoteMemberService;
 	
 	
 	@RequestMapping(value = "/getShopLotteryDrawList", method = RequestMethod.POST)
@@ -95,7 +101,7 @@
 	@ApiOperation(value = "获取门店抽奖详情【2.0】")
 	public R<TLotteryEvent> getShopLotteryDrawInfo(@RequestBody DelShopLotteryDrawDto dto) {
 		TLotteryEvent lotteryEvent = lotteryEventService.getById(dto.getId());
-		if (null == lotteryEvent) {
+		if (null == lotteryEvent || 1 == lotteryEvent.getDelFlag()) {
 			return R.fail("抽奖活动不存在");
 		}
 		if (!lotteryEvent.getShopId().equals(dto.getShopId().intValue())) {
@@ -112,6 +118,10 @@
 	public R editShopLotteryDraw(@RequestBody TLotteryEvent lotteryEvent) {
 		if (lotteryEvent.getId() == null) {
 			lotteryEvent.setId(IdUtils.simpleUUID());
+			String weiXinQrCode = remoteMemberService.getWeiXinQrCode("id=" + lotteryEvent.getId() + "&activityType=" + lotteryEvent.getActivityType(), "/pages/turntable/index");
+			lotteryEvent.setWxMiniProgramQrCode(weiXinQrCode);
+			lotteryEvent.setCreateTime(LocalDateTime.now());
+			lotteryEvent.setCreateUserId(lotteryEvent.getCreateUserId());
 		}
 		lotteryEvent.setUpdateTime(LocalDateTime.now());
 		lotteryEvent.setUpdateUserId(SecurityUtils.getUserId());

--
Gitblit v1.7.1