From 3341eb5f2c6070d108d3fec0677e2ae00458c4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 15 Mar 2022 13:18:24 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20TreeEntity=20?= =?UTF-8?q?=E6=A0=91=E5=AE=9E=E4=BD=93=20=E5=8E=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E7=9F=A5=E6=B3=9B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/core/domain/TreeEntity.java | 4 ++-- .../java/com/ruoyi/common/core/domain/entity/SysDept.java | 2 +- .../java/com/ruoyi/common/core/domain/entity/SysMenu.java | 2 +- ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java | 2 +- .../src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java | 2 +- ruoyi-generator/src/main/resources/vm/java/bo.java.vm | 2 +- ruoyi-generator/src/main/resources/vm/java/domain.java.vm | 2 +- .../com/ruoyi/system/service/impl/SysMenuServiceImpl.java | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java index 5e7af739..f44eacd4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java @@ -16,7 +16,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = true) -public class TreeEntity extends BaseEntity { +public class TreeEntity extends BaseEntity { private static final long serialVersionUID = 1L; @@ -38,6 +38,6 @@ public class TreeEntity extends BaseEntity { */ @TableField(exist = false) @ApiModelProperty(value = "子部门") - private List children = new ArrayList<>(); + private List children = new ArrayList<>(); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index 46e99368..ccfe07d9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -24,7 +24,7 @@ import javax.validation.constraints.Size; @EqualsAndHashCode(callSuper = true) @TableName("sys_dept") @ApiModel("部门业务对象") -public class SysDept extends TreeEntity { +public class SysDept extends TreeEntity { private static final long serialVersionUID = 1L; /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index 00db9416..8668481b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -23,7 +23,7 @@ import javax.validation.constraints.Size; @EqualsAndHashCode(callSuper = true) @TableName("sys_menu") @ApiModel("菜单权限业务对象") -public class SysMenu extends TreeEntity { +public class SysMenu extends TreeEntity { /** * 菜单ID diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java index 1ca4a7ad..b480aa0c 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("test_tree") -public class TestTree extends TreeEntity { +public class TestTree extends TreeEntity { private static final long serialVersionUID = 1L; diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java index 29f4ac97..211a79f1 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java @@ -21,7 +21,7 @@ import javax.validation.constraints.NotNull; @Data @EqualsAndHashCode(callSuper = true) @ApiModel("测试树表业务对象") -public class TestTreeBo extends TreeEntity { +public class TestTreeBo extends TreeEntity { /** * 主键 diff --git a/ruoyi-generator/src/main/resources/vm/java/bo.java.vm b/ruoyi-generator/src/main/resources/vm/java/bo.java.vm index 94d60508..13b98731 100644 --- a/ruoyi-generator/src/main/resources/vm/java/bo.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/bo.java.vm @@ -28,7 +28,7 @@ import com.ruoyi.common.core.domain.TreeEntity; #if($table.crud || $table.sub) #set($Entity="BaseEntity") #elseif($table.tree) -#set($Entity="TreeEntity") +#set($Entity="TreeEntity<${ClassName}Bo>") #end @Data diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index 2cf259cc..8fde4ade 100644 --- a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -25,7 +25,7 @@ import com.ruoyi.common.core.domain.TreeEntity; #if($table.crud || $table.sub) #set($Entity="BaseEntity") #elseif($table.tree) - #set($Entity="TreeEntity") + #set($Entity="TreeEntity<${ClassName}>") #end @Data @TableName("${tableName}") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index a5827143..5b6213eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -143,7 +143,7 @@ public class SysMenuServiceImpl implements ISysMenuService { router.setComponent(getComponent(menu)); router.setQuery(menu.getQueryParam()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); - List cMenus = (List) menu.getChildren(); + List cMenus = menu.getChildren(); if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect");