From 4bb2511df63c3d6516f3222458bc413909d89281 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期五, 25 七月 2025 20:12:42 +0800 Subject: [PATCH] bug修改 --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 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 68ab24a..d6fc5dc 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,6 +19,7 @@ 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; @@ -56,6 +57,9 @@ @Resource private GoodsService goodsService; + @Resource + private RemoteMemberService remoteMemberService; + @RequestMapping(value = "/getShopLotteryDrawList", method = RequestMethod.POST) @ApiOperation(value = "获取门店抽奖活动列表【2.0】") @@ -80,10 +84,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); @@ -95,7 +99,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 +116,8 @@ 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.setUpdateTime(LocalDateTime.now()); lotteryEvent.setUpdateUserId(SecurityUtils.getUserId()); -- Gitblit v1.7.1