邀请活动不在时间范围内

This commit is contained in:
2024-11-14 14:29:08 +08:00
parent f947e2d608
commit 57247cc934
3 changed files with 8 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ public class TbShopShareController {
*/ */
@GetMapping("getByShopId") @GetMapping("getByShopId")
public Result queryById(@RequestParam Integer shopId) { public Result queryById(@RequestParam Integer shopId) {
return Result.successWithData(tbShopShareService.queryByShopId(shopId)); return tbShopShareService.queryByShopId(shopId);
} }

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.system.cashierservice.service; package com.chaozhanggui.system.cashierservice.service;
import com.chaozhanggui.system.cashierservice.entity.TbShopShare; 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.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
@@ -18,7 +19,7 @@ public interface TbShopShareService {
* @param shopId 主键 * @param shopId 主键
* @return 实例对象 * @return 实例对象
*/ */
TbShopShare queryByShopId(Integer shopId); Result queryByShopId(Integer shopId);
} }

View File

@@ -7,6 +7,7 @@ import com.chaozhanggui.system.cashierservice.dao.TbShopShareMapper;
import com.chaozhanggui.system.cashierservice.entity.TbShopCoupon; import com.chaozhanggui.system.cashierservice.entity.TbShopCoupon;
import com.chaozhanggui.system.cashierservice.entity.TbShopShare; import com.chaozhanggui.system.cashierservice.entity.TbShopShare;
import com.chaozhanggui.system.cashierservice.service.TbShopShareService; import com.chaozhanggui.system.cashierservice.service.TbShopShareService;
import com.chaozhanggui.system.cashierservice.sign.Result;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
@@ -33,7 +34,7 @@ public class TbShopShareServiceImpl implements TbShopShareService {
@Override @Override
public TbShopShare queryByShopId(Integer shopId) { public Result queryByShopId(Integer shopId) {
TbShopShare tbShopShare = tbShopShareMapper.queryByShopId(shopId); TbShopShare tbShopShare = tbShopShareMapper.queryByShopId(shopId);
if (tbShopShare != null) { if (tbShopShare != null) {
if (CollectionUtil.isNotEmpty(tbShopShare.getNewCoupons())) { 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) { private String setCouponInfo(TbShopCoupon tbShopCoupon) {