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 | 1 | package org.jeecg.modules.system.util; |
2 | 2 | |
3 | +import org.jeecg.common.util.oConvertUtils; | |
3 | 4 | import org.jeecg.modules.system.entity.SysDepart; |
4 | 5 | import org.jeecg.modules.system.model.DepartIdModel; |
5 | 6 | import org.jeecg.modules.system.model.SysDepartTreeModel; |
... | ... | @@ -31,7 +32,7 @@ public class FindsDepartsChildrenUtil { |
31 | 32 | List<SysDepartTreeModel> records = new ArrayList<>(); |
32 | 33 | for (int i = 0; i < recordList.size(); i++) { |
33 | 34 | SysDepart depart = recordList.get(i); |
34 | - records.add(new SysDepartTreeModel(recordList.get(i))); | |
35 | + records.add(new SysDepartTreeModel(depart)); | |
35 | 36 | } |
36 | 37 | List<SysDepartTreeModel> tree = findChildren(records, idList); |
37 | 38 | setEmptyChildrenAsNull(tree); |
... | ... | @@ -52,7 +53,7 @@ public class FindsDepartsChildrenUtil { |
52 | 53 | List<SysDepartTreeModel> treeList = new ArrayList<>(); |
53 | 54 | for (int i = 0; i < recordList.size(); i++) { |
54 | 55 | SysDepartTreeModel branch = recordList.get(i); |
55 | - if ("".equals(branch.getParentId())) { | |
56 | + if (oConvertUtils.isEmpty(branch.getParentId())) { | |
56 | 57 | treeList.add(branch); |
57 | 58 | DepartIdModel departIdModel = new DepartIdModel().convert(branch); |
58 | 59 | idList.add(departIdModel); |
... | ... | @@ -73,7 +74,7 @@ public class FindsDepartsChildrenUtil { |
73 | 74 | DepartIdModel idModel = idList.get(i); |
74 | 75 | for (int i1 = 0; i1 < recordList.size(); i1++) { |
75 | 76 | SysDepartTreeModel m = recordList.get(i1); |
76 | - if (m.getParentId().equals(model.getId())) { | |
77 | + if (m.getParentId()!=null && m.getParentId().equals(model.getId())) { | |
77 | 78 | model.getChildren().add(m); |
78 | 79 | DepartIdModel dim = new DepartIdModel().convert(m); |
79 | 80 | idModel.getChildren().add(dim); |
... | ... |