소스 검색

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

- 注释掉了优惠券库存数量的空值和零值检查
- 移除了库存不足时抛出运行时异常的逻辑
- 保留了库存数量减1的更新操作
fcw 3 달 전
부모
커밋
8a0051f996
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      alien-store/src/main/java/shop/alien/store/service/impl/StorePlatformBenefitsServiceImpl.java

+ 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);