From 91235a3a410dfa4640bbf543fef778ed85c799d4 Mon Sep 17 00:00:00 2001 From: Mlin Date: Tue, 25 Jul 2023 17:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=98=89=E5=85=86=E7=BB=84=E7=BB=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=86=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrgChartServiceImpl.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 3f96e6c3..36587533 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -173,8 +173,17 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } private void findCompanyItemByParantId(String id, int currentLevel, String level, RecordSet rs, List> list, String whereSql, boolean expand) { - String sql = "select id, fname, ftype, fparentid,fobjid,fecid,fnumber,fisvitual from jcl_org_map " + whereSql + " and fparentid = " + id; - + String sql = "select id, fname, ftype, fparentid,fobjid,fecid,fnumber,fisvitual from jcl_org_map " + whereSql; + DetachUtil detachUtil = new DetachUtil(user); + if (detachUtil.isDETACH()) { + if ("0".equals(id)) { + sql += " and ftype = 1 and fobjid in(" + detachUtil.getJclRoleLevels() + ")"; + } else { + sql += " and fparentid = " + id + " and ftype !=1"; + } + } else { + sql += " and fparentid = " + id; + } rs.executeQuery(sql); List> currentList = new ArrayList<>(); while (rs.next()) { @@ -463,7 +472,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { DetachUtil detachUtil = new DetachUtil(user); if (detachUtil.isDETACH()) { if ("0".equals(id)) { - sql += " and t.ftype = 1 and t.fparentid = " + id + " and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")"; +// sql += " and t.ftype = 1 and t.fparentid = " + id + " and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")"; + sql += " and t.ftype = 1 and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")"; } else { if (StringUtils.isNotBlank(deptLeader)) { deptLeader = deptLeader.split(",")[0];