From 1d180d33a9e25c11504c4ec3c0c1935d561cd64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=85=E6=99=A8?= <136767481@qq.com> Date: Mon, 12 May 2025 14:44:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(mall):=20=E4=BC=98=E5=8C=96=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=9C=8D=E5=8A=A1=E6=8E=A5=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 PdfUtil 类中的未使用代码- 简化了 TzCategoryServiceImpl 中的分类添加逻辑- 增加了 TzCategoryServiceImpl 中根据父级 ID 查询子类信息的方法注释 --- .../java/org/dromara/common/excel/utils/PdfUtil.java | 3 +++ .../mall/service/impl/TzCategoryServiceImpl.java | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/PdfUtil.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/PdfUtil.java index 62f3e2c..665c990 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/PdfUtil.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/PdfUtil.java @@ -8,6 +8,9 @@ import com.aspose.words.SaveFormat; import java.io.*; +/** + * @author Maosw + */ public class PdfUtil { diff --git a/ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/impl/TzCategoryServiceImpl.java b/ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/impl/TzCategoryServiceImpl.java index bc1e91d..ff54e64 100644 --- a/ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/impl/TzCategoryServiceImpl.java +++ b/ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/impl/TzCategoryServiceImpl.java @@ -78,11 +78,7 @@ public class TzCategoryServiceImpl implements ITzCategoryService { } bo.setRecTime(new Date()); TzCategory add = MapstructUtils.convert(bo, TzCategory.class); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setCategoryId(add.getCategoryId()); - } - return flag; + return baseMapper.insert(add) > 0; } /** @@ -115,6 +111,12 @@ public class TzCategoryServiceImpl implements ITzCategoryService { return baseMapper.deleteByIds(ids) > 0; } + /** + * 根据父级ID查询子类信息 + * + * @param parentId + * @return + */ @Override public List listByParentId(Long parentId) { return baseMapper.selectVoList(new LambdaQueryWrapper().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));