bugfix MALL:已过期的优惠劵,还显示可以使用
This commit is contained in:
parent
da6e01f6b5
commit
6b06bf8a3d
@ -194,9 +194,12 @@ public class CouponServiceImpl implements CouponService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CouponDO> getMatchCouponList(Long userId, AppCouponMatchReqVO matchReqVO) {
|
public List<CouponDO> getMatchCouponList(Long userId, AppCouponMatchReqVO matchReqVO) {
|
||||||
return couponMapper.selectListByUserIdAndStatusAndUsePriceLeAndProductScope(userId,
|
List<CouponDO> list = couponMapper.selectListByUserIdAndStatusAndUsePriceLeAndProductScope(userId,
|
||||||
CouponStatusEnum.UNUSED.getStatus(),
|
CouponStatusEnum.UNUSED.getStatus(),
|
||||||
matchReqVO.getPrice(), matchReqVO.getSpuIds(), matchReqVO.getCategoryIds());
|
matchReqVO.getPrice(), matchReqVO.getSpuIds(), matchReqVO.getCategoryIds());
|
||||||
|
// 兜底逻辑:如果 CouponExpireJob 未执行,status 未变成 EXPIRE ,但是 validEndTime 已经过期了,需要进行过滤
|
||||||
|
list.removeIf(coupon -> !LocalDateTimeUtils.isBetween(coupon.getValidStartTime(), coupon.getValidEndTime()));
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user