同步 Boot 和 Cloud 代码的差异,保持一致性

This commit is contained in:
YunaiV
2024-03-01 19:57:41 +08:00
parent 1661315cd0
commit 636b9ad8ce
33 changed files with 290 additions and 153 deletions

View File

@@ -194,9 +194,12 @@ public class CouponServiceImpl implements CouponService {
@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