From 18832cf72d8b604c2b98f657919433be643a81f1 Mon Sep 17 00:00:00 2001 From: Agent Date: Tue, 31 Mar 2026 16:01:47 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=9B=B4=E6=8E=A5=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/building/service/impl/ProductServiceImpl.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/com/example/building/service/impl/ProductServiceImpl.java b/src/main/java/com/example/building/service/impl/ProductServiceImpl.java index 7695616..8f1e998 100644 --- a/src/main/java/com/example/building/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/example/building/service/impl/ProductServiceImpl.java @@ -68,16 +68,9 @@ public class ProductServiceImpl implements ProductService { /** * 删除分类 - * 检查是否有商品使用该分类,存在则不允许删除 */ @Override public void deleteCategory(String id) { - // 检查是否有商品使用该分类 - Long count = productMapper.selectCount(new LambdaQueryWrapper() - .eq(Product::getCategoryId, id)); - if (count > 0) { - throw new RuntimeException("该分类下有商品,无法删除"); - } categoryMapper.deleteById(id); }