浏览代码

refactor(store): 移除优惠券库存检查逻辑

- 注释掉了优惠券库存数量的空值和零值检查
- 移除了库存不足时抛出运行时异常的逻辑
- 保留了库存数量减1的更新操作
fcw 3 月之前
父节点
当前提交
8a0051f996

+ 3 - 3
alien-store/src/main/java/shop/alien/store/service/impl/StorePlatformBenefitsServiceImpl.java

@@ -242,9 +242,9 @@ public class StorePlatformBenefitsServiceImpl extends ServiceImpl<StorePlatformB
         }
         
         // 检查库存
-        if (lifeDiscountCoupon.getSingleQty() == null || lifeDiscountCoupon.getSingleQty() <= 0) {
-            throw new RuntimeException("优惠券库存不足");
-        }
+//        if (lifeDiscountCoupon.getSingleQty() == null || lifeDiscountCoupon.getSingleQty() <= 0) {
+//            throw new RuntimeException("优惠券库存不足");
+//        }
         
         // 更新库存:减1
         lifeDiscountCoupon.setSingleQty(lifeDiscountCoupon.getSingleQty() - 1);