1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| package com.basic.security.fragment.organizationHelper;
|
| import android.util.Log;
|
| import java.util.HashMap;
|
| public class TreeUtils {
| //第一级别为0
| public static int getLevel(TreePoint treePoint, HashMap<String, TreePoint> map) {
| if ("0".equals(treePoint.getPARENTID())) {
| return 0;
| } else {
| return 1 + getLevel(getTreePoint(treePoint.getPARENTID(), map), map);
| }
| }
|
| public static TreePoint getTreePoint(String ID, HashMap<String, TreePoint> map) {
| if (map.containsKey(ID)) {
| return map.get(ID);
| }
| Log.e("xlc", "ID:" + ID);
| return null;
| }
| }
|
|