From b4aa07b797d32380406674660381da69a495f0b4 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 16 Nov 2023 09:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=E5=9B=BE?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E9=83=A8=E5=88=86=E6=9D=83=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/impl/OrgChartServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 323ad9d6..8bb6e732 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -100,6 +100,13 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { String sql; if (isSearchCurrent) { sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? "; + boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass); + boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id); + if (isRealTime && user.getUID() != 1 && isRealDimension) { + DetachUtil detachUtil = new DetachUtil(user); + String ids = detachUtil.getJclRoleLevels(); + sql = sql + " and id in ("+ids+")"; + } if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'"; }