diff --git a/src/main/java/com/huoran/iasf/entity/SysPermission.java b/src/main/java/com/huoran/iasf/entity/SysPermission.java index 103206d..6f5b6ca 100644 --- a/src/main/java/com/huoran/iasf/entity/SysPermission.java +++ b/src/main/java/com/huoran/iasf/entity/SysPermission.java @@ -45,7 +45,7 @@ public class SysPermission implements Serializable { @NotNull(message = "所属菜单不能为空") @ApiModelProperty(value = "父级菜单权限id") - private String pid; + private Integer pid; @ApiModelProperty(value = "排序") private Integer orderNum; diff --git a/src/main/java/com/huoran/iasf/service/impl/PermissionServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/PermissionServiceImpl.java index 71d08fc..9535e4b 100644 --- a/src/main/java/com/huoran/iasf/service/impl/PermissionServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/PermissionServiceImpl.java @@ -251,7 +251,7 @@ public class PermissionServiceImpl extends ServiceImpl build(List treeNodes) { List trees = new ArrayList<>(); for (SysPermission treeNode : treeNodes) { - if ("0".equals(treeNode.getPid())) { + if (treeNode.getPid()==0) { treeNode.setLevel(1); trees.add(findChildren(treeNode,treeNodes)); }