From dce4dec4be993be9581c9a5e82db830d3cfdd22c Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Tue, 10 Mar 2026 14:15:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(portal):=20=E5=B0=86TreeSelect?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BAPortalTreeSelect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 替换HwPortalConfigTypeServiceImpl中的TreeSelect为PortalTreeSelect - 更新selectPortalConfigTypeTreeList方法返回类型为PortalTreeSelect - 修改buildPortalConfigTypeTreeSelect方法使用PortalTreeSelect - 更新IHwPortalConfigTypeService接口中的方法签名 - 删除旧的TreeSelect类定义 --- .../ruoyi/portal/domain/vo/TreeSelect.java | 70 ------------------- .../service/IHwPortalConfigTypeService.java | 6 +- .../impl/HwPortalConfigTypeServiceImpl.java | 8 +-- 3 files changed, 7 insertions(+), 77 deletions(-) delete mode 100644 ruoyi-portal/src/main/java/com/ruoyi/portal/domain/vo/TreeSelect.java diff --git a/ruoyi-portal/src/main/java/com/ruoyi/portal/domain/vo/TreeSelect.java b/ruoyi-portal/src/main/java/com/ruoyi/portal/domain/vo/TreeSelect.java deleted file mode 100644 index e15f928..0000000 --- a/ruoyi-portal/src/main/java/com/ruoyi/portal/domain/vo/TreeSelect.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.ruoyi.portal.domain.vo; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.ruoyi.portal.domain.HwPortalConfigType; - -/** - * Treeselect树结构实体类 - * - * @author ruoyi - */ -public class TreeSelect implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** 节点ID */ - private Long id; - - /** 节点名称 */ - private String label; - - /** 子节点 */ - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List children; - - public TreeSelect() - { - - } - - public TreeSelect(HwPortalConfigType portalConfigType) - { - this.id = portalConfigType.getConfigTypeId(); - this.label = portalConfigType.getConfigTypeName(); - this.children = portalConfigType.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - public Long getId() - { - return id; - } - - public void setId(Long id) - { - this.id = id; - } - - public String getLabel() - { - return label; - } - - public void setLabel(String label) - { - this.label = label; - } - - public List getChildren() - { - return children; - } - - public void setChildren(List children) - { - this.children = children; - } -} - diff --git a/ruoyi-portal/src/main/java/com/ruoyi/portal/service/IHwPortalConfigTypeService.java b/ruoyi-portal/src/main/java/com/ruoyi/portal/service/IHwPortalConfigTypeService.java index 5fd1632..f663847 100644 --- a/ruoyi-portal/src/main/java/com/ruoyi/portal/service/IHwPortalConfigTypeService.java +++ b/ruoyi-portal/src/main/java/com/ruoyi/portal/service/IHwPortalConfigTypeService.java @@ -1,7 +1,7 @@ package com.ruoyi.portal.service; import com.ruoyi.portal.domain.HwPortalConfigType; -import com.ruoyi.portal.domain.vo.TreeSelect; +import com.ruoyi.portal.domain.vo.PortalTreeSelect; import java.util.List; @@ -76,7 +76,7 @@ public interface IHwPortalConfigTypeService * @param portalConfigType 门户网站配置类型信息 * @return 门户网站配置类型树信息集合 */ - public List selectPortalConfigTypeTreeList(HwPortalConfigType portalConfigType); + public List selectPortalConfigTypeTreeList(HwPortalConfigType portalConfigType); /** * 构建前端所需要下拉树结构 @@ -84,7 +84,7 @@ public interface IHwPortalConfigTypeService * @param portalConfigTypes 门户网站配置类型列表 * @return 下拉树结构列表 */ - public List buildPortalConfigTypeTreeSelect(List portalConfigTypes); + public List buildPortalConfigTypeTreeSelect(List portalConfigTypes); /** * 构建前端所需要树结构 * diff --git a/ruoyi-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java b/ruoyi-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java index cc1c21f..223c6e1 100644 --- a/ruoyi-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java +++ b/ruoyi-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java @@ -6,7 +6,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.portal.domain.HwPortalConfigType; -import com.ruoyi.portal.domain.vo.TreeSelect; +import com.ruoyi.portal.domain.vo.PortalTreeSelect; import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper; import com.ruoyi.portal.service.IHwPortalConfigTypeService; import org.springframework.beans.factory.annotation.Autowired; @@ -169,7 +169,7 @@ public class HwPortalConfigTypeServiceImpl implements IHwPortalConfigTypeService * @return 门户网站配置类型树信息集合 */ @Override - public List selectPortalConfigTypeTreeList(HwPortalConfigType portalConfigType) { + public List selectPortalConfigTypeTreeList(HwPortalConfigType portalConfigType) { List portalConfigTypes = this.selectHwPortalConfigTypeList(portalConfigType); return buildPortalConfigTypeTreeSelect(portalConfigTypes); } @@ -181,9 +181,9 @@ public class HwPortalConfigTypeServiceImpl implements IHwPortalConfigTypeService * @return 下拉树结构列表 */ @Override - public List buildPortalConfigTypeTreeSelect(List portalConfigTypes) { + public List buildPortalConfigTypeTreeSelect(List portalConfigTypes) { List deptTrees = buildPortalConfigTypeTree(portalConfigTypes); - return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + return deptTrees.stream().map(PortalTreeSelect::new).collect(Collectors.toList()); }