From 5c05759ad4bcfbaf6879f1950bf65fcc4ca4cbf4 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 6 Aug 2024 09:59:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=A0=B9=E7=BB=93=E7=82=B9=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=EF=BC=8C=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/service/impl/ChartServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 4398c23a..05553f5c 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -141,6 +141,10 @@ public class ChartServiceImpl extends Service implements ChartService { // 向下查询数据 if (null != topChartPO) { + // 如果根结点是部门,顶层层级设置为1 + if(topChartPO.getFtype().equals("2")){ + topChartPO.setDepartmentDepth(1); + } findChildData(topChartPO, dataList, Integer.parseInt(depth), id, hideDepartment); } From fe60767829550b95c1ada4b297eabd96da554f44 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 6 Aug 2024 11:00:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=A0=B9=E7=BB=93=E7=82=B9=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=EF=BC=8C=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/organization/service/impl/ChartServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 05553f5c..a2936ad1 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -1735,7 +1735,7 @@ public class ChartServiceImpl extends Service implements ChartService { } } else { sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + - " union select " + dbType.concat("d", "subcompanyid") + "as id, subcompanyid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; + " union select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; if (isNotCurrentDimension) { sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany;