|
@@ -312,17 +312,14 @@ public class KepOpcServerUtil {
|
|
public static List<JSONObject> recursionChildren(Collection<Branch> branchCollection) {
|
|
public static List<JSONObject> recursionChildren(Collection<Branch> branchCollection) {
|
|
List<JSONObject> jsonList = new ArrayList<>();
|
|
List<JSONObject> jsonList = new ArrayList<>();
|
|
for (Branch branch : branchCollection) {
|
|
for (Branch branch : branchCollection) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("label", branch.getName());
|
|
if (Blank.isNotEmpty(branch.getBranches())) {
|
|
if (Blank.isNotEmpty(branch.getBranches())) {
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
|
- jsonObject.put("label", branch.getName());
|
|
|
|
jsonObject.put("children", recursionChildren(branch.getBranches()));
|
|
jsonObject.put("children", recursionChildren(branch.getBranches()));
|
|
- jsonList.add(jsonObject);
|
|
|
|
} else {
|
|
} else {
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
|
- jsonObject.put("label", branch.getName());
|
|
|
|
jsonObject.put("children", generLeaf(branch.getLeaves()));
|
|
jsonObject.put("children", generLeaf(branch.getLeaves()));
|
|
- jsonList.add(jsonObject);
|
|
|
|
}
|
|
}
|
|
|
|
+ jsonList.add(jsonObject);
|
|
}
|
|
}
|
|
return jsonList;
|
|
return jsonList;
|
|
}
|
|
}
|