作者 yangfu

子部门列表修改

@@ -120,6 +120,7 @@ func (tree *Tree) AllSubDepartment(node TreeNode) []TreeNode { @@ -120,6 +120,7 @@ func (tree *Tree) AllSubDepartment(node TreeNode) []TreeNode {
120 var stack []*Tree 120 var stack []*Tree
121 stack = append(stack, treeNode) 121 stack = append(stack, treeNode)
122 var res []TreeNode 122 var res []TreeNode
  123 + rootId := treeNode.Node.(*Org).OrgId
123 for { 124 for {
124 if len(stack) == 0 { 125 if len(stack) == 0 {
125 break 126 break
@@ -127,7 +128,7 @@ func (tree *Tree) AllSubDepartment(node TreeNode) []TreeNode { @@ -127,7 +128,7 @@ func (tree *Tree) AllSubDepartment(node TreeNode) []TreeNode {
127 pop := stack[0] 128 pop := stack[0]
128 stack = stack[1:] 129 stack = stack[1:]
129 /***特殊处理***/ 130 /***特殊处理***/
130 - if org, ok := pop.Node.(*Org); ok && fmt.Sprintf("%v", org.OrgId) != treeNode.Node.ID() { 131 + if org, ok := pop.Node.(*Org); ok && org.OrgId != int64(rootId) {
131 if org.IsOrg == IsOrgFlag { 132 if org.IsOrg == IsOrgFlag {
132 continue 133 continue
133 } 134 }