From b2fce0dc7dc4ea5dec9792a2bc3ceb9d33d6e07b Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期一, 04 九月 2023 13:59:52 +0800
Subject: [PATCH] 修改后台社区动态加载不出来
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java
index 1596bc8..b18c0a2 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java
@@ -87,18 +87,26 @@
*/
@Override
public R verifyMcsCoupon(Long couponId, Long userId) {
- McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda()
- .eq(McsMerchant::getUserId, userId).eq(McsMerchant::getIsDel, false));
- if (isNull(mcsMerchant) || !mcsMerchant.getUserId().equals(userId)) {
+ McsCoupon mcsCoupon = this.baseMapper.selectById(couponId);
+ if (isNull(mcsCoupon)) {
+ return R.fail("无效券码");
+ }
+ McsGame mcsGame = mcsGameDAO.selectById(mcsCoupon.getGameId());
+ if (isNull(mcsGame)) {
+ return R.fail("资源不存在");
+ }
+ McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsGame.getMerchantId());
+ if (isNull(mcsMerchant)) {
+ return R.fail("资源不存在");
+ }
+ if (!mcsMerchant.getUserId().equals(userId)) {
return R.fail("限指定商家核验");
}
- McsCoupon mcsCoupon = this.baseMapper.selectById(couponId);
- if (isNull(mcsCoupon) || mcsCoupon.getIsVerified()) {
- return R.fail("无效卷码");
+ if (mcsCoupon.getIsVerified()) {
+ return R.fail("该券已核销");
}
Date nowDate = new Date();
- McsGame mcsGame = mcsGameDAO.selectById(mcsCoupon.getGameId());
- if (isNull(mcsGame) || mcsGame.getExpireAt().before(nowDate)) {
+ if (mcsGame.getExpireAt().before(nowDate)) {
return R.fail("已过期");
}
R<LoginUserInfoVO> userInfoVOR = userService.getUserInfoByUserId(mcsCoupon.getUserId().toString());
--
Gitblit v1.7.1