Skip to content

Commit

Permalink
bugfix MALL:已过期的优惠劵,还显示可以使用
Browse files Browse the repository at this point in the history
  • Loading branch information
YunaiV committed Mar 1, 2024
1 parent da6e01f commit 6b06bf8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ public Map<Long, Integer> getTakeCountMapByTemplateIds(Collection<Long> template

@Override
public List<CouponDO> getMatchCouponList(Long userId, AppCouponMatchReqVO matchReqVO) {
return couponMapper.selectListByUserIdAndStatusAndUsePriceLeAndProductScope(userId,
List<CouponDO> 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
Expand Down

0 comments on commit 6b06bf8

Please sign in to comment.