Commit 0e9827e5a08185989b8123a9de57d9e80c1ac6b8
Committed by
Gitee
!1181 【缺陷修复】退款回收优惠券错误
Merge pull request !1181 from 壁虎在家/master-jdk17
Showing
1 changed file
with
3 additions
and
0 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java
| @@ -178,6 +178,9 @@ public class CouponServiceImpl implements CouponService { | @@ -178,6 +178,9 @@ public class CouponServiceImpl implements CouponService { | ||
| 178 | */ | 178 | */ |
| 179 | @Transactional(rollbackFor = Exception.class) | 179 | @Transactional(rollbackFor = Exception.class) |
| 180 | public void invalidateCoupon(Long couponId, Long userId) { | 180 | public void invalidateCoupon(Long couponId, Long userId) { |
| 181 | + if (couponId == null || couponId <= 0) { | ||
| 182 | + return; | ||
| 183 | + } | ||
| 181 | // 1.1 校验优惠券 | 184 | // 1.1 校验优惠券 |
| 182 | CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId); | 185 | CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId); |
| 183 | if (coupon == null) { | 186 | if (coupon == null) { |