From cdf6ec50828a6cf1c62fb06f93f4cd55ab68fd09 Mon Sep 17 00:00:00 2001 From: zhangdaihao Date: Mon, 20 May 2019 16:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3oracle=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/system/util/FindsDepartsChildrenUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/FindsDepartsChildrenUtil.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/FindsDepartsChildrenUtil.java index a53a59af..b1f52cf2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/FindsDepartsChildrenUtil.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/FindsDepartsChildrenUtil.java @@ -1,5 +1,6 @@ package org.jeecg.modules.system.util; +import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.model.DepartIdModel; import org.jeecg.modules.system.model.SysDepartTreeModel; @@ -31,7 +32,7 @@ public class FindsDepartsChildrenUtil { List records = new ArrayList<>(); for (int i = 0; i < recordList.size(); i++) { SysDepart depart = recordList.get(i); - records.add(new SysDepartTreeModel(recordList.get(i))); + records.add(new SysDepartTreeModel(depart)); } List tree = findChildren(records, idList); setEmptyChildrenAsNull(tree); @@ -52,7 +53,7 @@ public class FindsDepartsChildrenUtil { List treeList = new ArrayList<>(); for (int i = 0; i < recordList.size(); i++) { SysDepartTreeModel branch = recordList.get(i); - if ("".equals(branch.getParentId())) { + if (oConvertUtils.isEmpty(branch.getParentId())) { treeList.add(branch); DepartIdModel departIdModel = new DepartIdModel().convert(branch); idList.add(departIdModel); @@ -73,7 +74,7 @@ public class FindsDepartsChildrenUtil { DepartIdModel idModel = idList.get(i); for (int i1 = 0; i1 < recordList.size(); i1++) { SysDepartTreeModel m = recordList.get(i1); - if (m.getParentId().equals(model.getId())) { + if (m.getParentId()!=null && m.getParentId().equals(model.getId())) { model.getChildren().add(m); DepartIdModel dim = new DepartIdModel().convert(m); idModel.getChildren().add(dim); -- GitLab