Commit b7c765ad068b02a4dbc0349e06dbfc7d609db76f
1 parent
08d5ab00
解决oracle11g,部门展示不出的问题
Showing
1 changed file
with
4 additions
and
3 deletions
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/FindsDepartsChildrenUtil.java
1 | package org.jeecg.modules.system.util; | 1 | package org.jeecg.modules.system.util; |
2 | 2 | ||
3 | +import org.jeecg.common.util.oConvertUtils; | ||
3 | import org.jeecg.modules.system.entity.SysDepart; | 4 | import org.jeecg.modules.system.entity.SysDepart; |
4 | import org.jeecg.modules.system.model.DepartIdModel; | 5 | import org.jeecg.modules.system.model.DepartIdModel; |
5 | import org.jeecg.modules.system.model.SysDepartTreeModel; | 6 | import org.jeecg.modules.system.model.SysDepartTreeModel; |
@@ -31,7 +32,7 @@ public class FindsDepartsChildrenUtil { | @@ -31,7 +32,7 @@ public class FindsDepartsChildrenUtil { | ||
31 | List<SysDepartTreeModel> records = new ArrayList<>(); | 32 | List<SysDepartTreeModel> records = new ArrayList<>(); |
32 | for (int i = 0; i < recordList.size(); i++) { | 33 | for (int i = 0; i < recordList.size(); i++) { |
33 | SysDepart depart = recordList.get(i); | 34 | SysDepart depart = recordList.get(i); |
34 | - records.add(new SysDepartTreeModel(recordList.get(i))); | 35 | + records.add(new SysDepartTreeModel(depart)); |
35 | } | 36 | } |
36 | List<SysDepartTreeModel> tree = findChildren(records, idList); | 37 | List<SysDepartTreeModel> tree = findChildren(records, idList); |
37 | setEmptyChildrenAsNull(tree); | 38 | setEmptyChildrenAsNull(tree); |
@@ -52,7 +53,7 @@ public class FindsDepartsChildrenUtil { | @@ -52,7 +53,7 @@ public class FindsDepartsChildrenUtil { | ||
52 | List<SysDepartTreeModel> treeList = new ArrayList<>(); | 53 | List<SysDepartTreeModel> treeList = new ArrayList<>(); |
53 | for (int i = 0; i < recordList.size(); i++) { | 54 | for (int i = 0; i < recordList.size(); i++) { |
54 | SysDepartTreeModel branch = recordList.get(i); | 55 | SysDepartTreeModel branch = recordList.get(i); |
55 | - if ("".equals(branch.getParentId())) { | 56 | + if (oConvertUtils.isEmpty(branch.getParentId())) { |
56 | treeList.add(branch); | 57 | treeList.add(branch); |
57 | DepartIdModel departIdModel = new DepartIdModel().convert(branch); | 58 | DepartIdModel departIdModel = new DepartIdModel().convert(branch); |
58 | idList.add(departIdModel); | 59 | idList.add(departIdModel); |
@@ -73,7 +74,7 @@ public class FindsDepartsChildrenUtil { | @@ -73,7 +74,7 @@ public class FindsDepartsChildrenUtil { | ||
73 | DepartIdModel idModel = idList.get(i); | 74 | DepartIdModel idModel = idList.get(i); |
74 | for (int i1 = 0; i1 < recordList.size(); i1++) { | 75 | for (int i1 = 0; i1 < recordList.size(); i1++) { |
75 | SysDepartTreeModel m = recordList.get(i1); | 76 | SysDepartTreeModel m = recordList.get(i1); |
76 | - if (m.getParentId().equals(model.getId())) { | 77 | + if (m.getParentId()!=null && m.getParentId().equals(model.getId())) { |
77 | model.getChildren().add(m); | 78 | model.getChildren().add(m); |
78 | DepartIdModel dim = new DepartIdModel().convert(m); | 79 | DepartIdModel dim = new DepartIdModel().convert(m); |
79 | idModel.getChildren().add(dim); | 80 | idModel.getChildren().add(dim); |