Commit b1521788bdd70a28e6a74a873e7b6329a0e082a9
Committed by
Gitee
!1409 修复确认退款报错和取消订单定时任务报错
Merge pull request !1409 from sunway/fix-20250820
Showing
1 changed file
with
4 additions
and
0 deletions
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java
| @@ -166,6 +166,10 @@ public class CouponServiceImpl implements CouponService { | @@ -166,6 +166,10 @@ public class CouponServiceImpl implements CouponService { | ||
| 166 | public void invalidateCouponsByAdmin(List<Long> giveCouponIds, Long userId) { | 166 | public void invalidateCouponsByAdmin(List<Long> giveCouponIds, Long userId) { |
| 167 | // 循环收回 | 167 | // 循环收回 |
| 168 | for (Long couponId : giveCouponIds) { | 168 | for (Long couponId : giveCouponIds) { |
| 169 | + // couponId为空或0则跳过 | ||
| 170 | + if (null == couponId || couponId <= 0) { | ||
| 171 | + continue; | ||
| 172 | + } | ||
| 169 | try { | 173 | try { |
| 170 | getSelf().invalidateCoupon(couponId, userId); | 174 | getSelf().invalidateCoupon(couponId, userId); |
| 171 | } catch (Exception e) { | 175 | } catch (Exception e) { |