【缺陷修复】退款回收优惠券错误

This commit is contained in:
壁虎 2025-01-05 16:19:40 +08:00
parent 92d6b8ad88
commit 39ac9053fd
1 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,9 @@ public class CouponServiceImpl implements CouponService {
*/
@Transactional(rollbackFor = Exception.class)
public void invalidateCoupon(Long couponId, Long userId) {
if (couponId == null || couponId <= 0) {
return;
}
// 1.1 校验优惠券
CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId);
if (coupon == null) {