From 6b06bf8a3da6afca15e22755ab8e39116f986b8f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 1 Mar 2024 13:55:37 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20MALL=EF=BC=9A=E5=B7=B2=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E7=9A=84=E4=BC=98=E6=83=A0=E5=8A=B5=EF=BC=8C=E8=BF=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/promotion/service/coupon/CouponServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 51f1d2201d..f281987f15 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -194,9 +194,12 @@ public Map getTakeCountMapByTemplateIds(Collection template @Override public List getMatchCouponList(Long userId, AppCouponMatchReqVO matchReqVO) { - return couponMapper.selectListByUserIdAndStatusAndUsePriceLeAndProductScope(userId, + List list = couponMapper.selectListByUserIdAndStatusAndUsePriceLeAndProductScope(userId, CouponStatusEnum.UNUSED.getStatus(), matchReqVO.getPrice(), matchReqVO.getSpuIds(), matchReqVO.getCategoryIds()); + // 兜底逻辑:如果 CouponExpireJob 未执行,status 未变成 EXPIRE ,但是 validEndTime 已经过期了,需要进行过滤 + list.removeIf(coupon -> !LocalDateTimeUtils.isBetween(coupon.getValidStartTime(), coupon.getValidEndTime())); + return list; } @Override