Commit 39ac9053fdd1993c6e604ea3b1671faf793d87ff
1 parent
92d6b8ad
【缺陷修复】退款回收优惠券错误
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 | 178 | */ |
| 179 | 179 | @Transactional(rollbackFor = Exception.class) |
| 180 | 180 | public void invalidateCoupon(Long couponId, Long userId) { |
| 181 | + if (couponId == null || couponId <= 0) { | |
| 182 | + return; | |
| 183 | + } | |
| 181 | 184 | // 1.1 校验优惠券 |
| 182 | 185 | CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId); |
| 183 | 186 | if (coupon == null) { | ... | ... |