From 53db8309e994e2c95db289ed6ae2dec44d851c14 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 24 Apr 2024 21:08:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91CRM=20?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=88=A0=E9=99=A4=E6=97=B6=EF=BC=8C=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=95=86=E5=93=81=E6=95=B0=E9=87=8F=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java | 2 +- .../crm/service/product/CrmProductCategoryServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java b/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java index 27fb6f9ce..07a6dad60 100644 --- a/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java +++ b/yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java @@ -87,7 +87,7 @@ public interface ErrorCodeConstants { ErrorCode PRODUCT_CATEGORY_USED = new ErrorCode(1_020_009_002, "产品分类已关联产品"); ErrorCode PRODUCT_CATEGORY_PARENT_NOT_EXISTS = new ErrorCode(1_020_009_003, "父分类不存在"); ErrorCode PRODUCT_CATEGORY_PARENT_NOT_FIRST_LEVEL = new ErrorCode(1_020_009_004, "父分类不能是二级分类"); - ErrorCode product_CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_020_009_005, "存在子分类,无法删除"); + ErrorCode PRODUCT_CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_020_009_005, "存在子分类,无法删除"); // ========== 商机状态 1_020_010_000 ========== ErrorCode BUSINESS_STATUS_TYPE_NOT_EXISTS = new ErrorCode(1_020_010_000, "商机状态组不存在"); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/CrmProductCategoryServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/CrmProductCategoryServiceImpl.java index 6399039ba..ce168883a 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/CrmProductCategoryServiceImpl.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/CrmProductCategoryServiceImpl.java @@ -110,10 +110,10 @@ public class CrmProductCategoryServiceImpl implements CrmProductCategoryService validateProductCategoryExists(id); // 1.2 校验是否还有子分类 if (productCategoryMapper.selectCountByParentId(id) > 0) { - throw exception(product_CATEGORY_EXISTS_CHILDREN); + throw exception(PRODUCT_CATEGORY_EXISTS_CHILDREN); } // 1.3 校验是否被产品使用 - if (crmProductService.getProductByCategoryId(id) !=null) { + if (crmProductService.getProductByCategoryId(id) > 0) { throw exception(PRODUCT_CATEGORY_USED); } // 2. 删除