From 985e48474a3decdcab3d5d99dc0b5211b381c2a6 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 02 七月 2025 09:19:45 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang into 2.0
---
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 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 5c0b77d..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,10 +99,10 @@
@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())) {
+ if (!lotteryEvent.getShopId().equals(dto.getShopId().intValue())) {
return R.fail("查询失败");
}
List<TLotteryEventPrize> list = lotteryEventPrizeService.list(new LambdaQueryWrapper<TLotteryEventPrize>().eq(TLotteryEventPrize::getLotteryEventId, dto.getId()));
@@ -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());
@@ -139,7 +145,7 @@
if (null == lotteryEvent) {
return R.fail("抽奖活动不存在");
}
- if (!lotteryEvent.getShopId().equals(dto.getShopId())) {
+ if (!lotteryEvent.getShopId().equals(dto.getShopId().intValue())) {
return R.fail("查询失败");
}
Page<ShopWinningRecordVo> page = new Page<>();
--
Gitblit v1.7.1