【8.3.3】【role】更新角色树和角色的树构建

dev-8.3.3
stylefeng 2025-01-26 22:42:03 +08:00
parent 8cb191fc0c
commit a274908614
2 changed files with 12 additions and 3 deletions

View File

@ -25,9 +25,10 @@
package cn.stylefeng.roses.kernel.sys.api.pojo.role;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractTreeNode;
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractSortedTreeNode;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -37,7 +38,7 @@ import java.util.List;
* @since 2025/1/24 11:16
*/
@Data
public class SysRoleTreeDTO implements AbstractTreeNode<SysRoleTreeDTO> {
public class SysRoleTreeDTO implements AbstractSortedTreeNode<SysRoleTreeDTO> {
/**
* idid
@ -104,4 +105,11 @@ public class SysRoleTreeDTO implements AbstractTreeNode<SysRoleTreeDTO> {
this.children = childrenNodes;
}
@Override
public BigDecimal getSort() {
if (nodeType == null) {
return new BigDecimal(0);
}
return new BigDecimal(nodeType);
}
}

View File

@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.sys.modular.role.factory;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.rule.constants.TreeConstants;
import cn.stylefeng.roses.kernel.rule.tree.factory.SortedTreeBuildFactory;
import cn.stylefeng.roses.kernel.sys.api.pojo.role.SysRoleTreeDTO;
import cn.stylefeng.roses.kernel.sys.modular.role.entity.RoleCategory;
import cn.stylefeng.roses.kernel.sys.modular.role.entity.SysRole;
@ -57,7 +58,7 @@ public class RoleTreeFactory {
roleTreeList.add(roleTree);
}
return roleTreeList;
return new SortedTreeBuildFactory<SysRoleTreeDTO>().doTreeBuild(roleTreeList);
}
}