Commit 39ac9053fdd1993c6e604ea3b1671faf793d87ff

Authored by 壁虎
1 parent 92d6b8ad

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

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) {
... ...