From e908329cc006225dfe38472ea3730159629e879f 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:22:00 +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 --- .../src/main/java/com/ruoyi/system/api/domain/SysDept.java | 2 +- .../java/com/ruoyi/common/core/web/domain/TreeEntity.java | 5 ++--- .../ruoyi-gen/src/main/resources/vm/java/bo.java.vm | 2 +- .../ruoyi-gen/src/main/resources/vm/java/domain.java.vm | 2 +- .../src/main/java/com/ruoyi/system/domain/SysMenu.java | 2 +- .../com/ruoyi/system/service/impl/SysMenuServiceImpl.java | 4 ++-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDept.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDept.java index c4a0585c..a580821f 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDept.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysDept.java @@ -26,7 +26,7 @@ import javax.validation.constraints.Size; @NoArgsConstructor @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/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/TreeEntity.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/TreeEntity.java index c58d6dc4..3cf1525d 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/TreeEntity.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/TreeEntity.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; import java.util.ArrayList; import java.util.List; @@ -17,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; @@ -39,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-modules/ruoyi-gen/src/main/resources/vm/java/bo.java.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/bo.java.vm index 9bb608e6..c6ec5f2c 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/bo.java.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/bo.java.vm @@ -28,7 +28,7 @@ import com.ruoyi.common.core.web.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-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm index adc65a2e..2c482af9 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm @@ -26,7 +26,7 @@ import com.ruoyi.common.core.web.domain.TreeEntity; #if($table.crud || $table.sub) #set($Entity="BaseEntity") #elseif($table.tree) -#set($Entity="TreeEntity") +#set($Entity="TreeEntity<${ClassName}>") #end @Data @EqualsAndHashCode(callSuper = true) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenu.java index d46390bd..8f3a5468 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenu.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysMenu.java @@ -25,7 +25,7 @@ import javax.validation.constraints.Size; @NoArgsConstructor @TableName("sys_menu") @ApiModel("菜单权限业务对象") -public class SysMenu extends TreeEntity { +public class SysMenu extends TreeEntity { /** * 菜单ID diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 03f1b6de..0631508a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -143,8 +143,8 @@ 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(); - if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { + List cMenus = menu.getChildren(); + if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus));