From 5674bfafc89b3b5247ac3007d49c70b3c35d79fd Mon Sep 17 00:00:00 2001 From: wangzhs Date: Wed, 15 Mar 2023 14:03:00 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9][=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB]=E5=88=86=E7=B1=BB=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E5=AD=98=E5=9C=A82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/service/category/ProductCategoryServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/ProductCategoryServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/ProductCategoryServiceImpl.java index f0d10b8b8..21dfb9dee 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/ProductCategoryServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/category/ProductCategoryServiceImpl.java @@ -77,7 +77,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService { throw exception(CATEGORY_PARENT_NOT_EXISTS); } // 父分类不能是二级分类 - if (Objects.equals(id, ProductCategoryDO.PARENT_ID_NULL)) { + if (!Objects.equals(category.getParentId(), ProductCategoryDO.PARENT_ID_NULL)) { throw exception(CATEGORY_PARENT_NOT_FIRST_LEVEL); } }