From 57247cc934dfc6d78f1159292098663968bf33ad Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 14 Nov 2024 14:29:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E6=B4=BB=E5=8A=A8=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/controller/TbShopShareController.java | 2 +- .../system/cashierservice/service/TbShopShareService.java | 3 ++- .../service/impl/TbShopShareServiceImpl.java | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/TbShopShareController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/TbShopShareController.java index db76bd7..c3def20 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/TbShopShareController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/TbShopShareController.java @@ -33,7 +33,7 @@ public class TbShopShareController { */ @GetMapping("getByShopId") public Result queryById(@RequestParam Integer shopId) { - return Result.successWithData(tbShopShareService.queryByShopId(shopId)); + return tbShopShareService.queryByShopId(shopId); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareService.java index 998321b..adbac78 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareService.java @@ -1,6 +1,7 @@ package com.chaozhanggui.system.cashierservice.service; import com.chaozhanggui.system.cashierservice.entity.TbShopShare; +import com.chaozhanggui.system.cashierservice.sign.Result; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -18,7 +19,7 @@ public interface TbShopShareService { * @param shopId 主键 * @return 实例对象 */ - TbShopShare queryByShopId(Integer shopId); + Result queryByShopId(Integer shopId); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareServiceImpl.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareServiceImpl.java index 61795d8..abcf47b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareServiceImpl.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareServiceImpl.java @@ -7,6 +7,7 @@ import com.chaozhanggui.system.cashierservice.dao.TbShopShareMapper; import com.chaozhanggui.system.cashierservice.entity.TbShopCoupon; import com.chaozhanggui.system.cashierservice.entity.TbShopShare; import com.chaozhanggui.system.cashierservice.service.TbShopShareService; +import com.chaozhanggui.system.cashierservice.sign.Result; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Primary; @@ -33,7 +34,7 @@ public class TbShopShareServiceImpl implements TbShopShareService { @Override - public TbShopShare queryByShopId(Integer shopId) { + public Result queryByShopId(Integer shopId) { TbShopShare tbShopShare = tbShopShareMapper.queryByShopId(shopId); if (tbShopShare != null) { if (CollectionUtil.isNotEmpty(tbShopShare.getNewCoupons())) { @@ -77,8 +78,10 @@ public class TbShopShareServiceImpl implements TbShopShareService { } } } + return Result.successWithData(tbShopShare); + }else { + return Result.fail("邀请活动不在时间范围内"); } - return tbShopShare; } private String setCouponInfo(TbShopCoupon tbShopCoupon) {