From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- 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