开启库存校验库存数量
This commit is contained in:
@@ -443,7 +443,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
throw new BadRequestException("商品不存在或已下架, id: " + addCartDTO.getSkuId());
|
throw new BadRequestException("商品不存在或已下架, id: " + addCartDTO.getSkuId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (product.getStockNumber() < 1) {
|
if (product.getIsStock() != null && product.getIsStock() == 1 &&product.getStockNumber() < 1) {
|
||||||
throw new BadRequestException(product.getName() + "商品库存不足");
|
throw new BadRequestException(product.getName() + "商品库存不足");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user