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 |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 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 0e3c914..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)
@@ -80,10 +86,10 @@
 			return R.fail("抽奖活动不存在");
 		}
 		if (LocalDateTime.now().isAfter(lotteryEvent.getStartTime())) {
-			return R.fail("删除失败");
+			return R.fail("活动已开始,不能删除!");
 		}
 		if (!lotteryEvent.getShopId().equals(dto.getShopId())) {
-			return R.fail("删除失败");
+			return R.fail("删除失败,该活动不属于该店铺");
 		}
 		lotteryEvent.setDelFlag(1);
 		lotteryEventService.updateById(lotteryEvent);
@@ -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