From aff8e14eaecd067eff040991482af471e91c3ef4 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Sat, 1 Oct 2022 13:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.2.5=E3=80=91=E3=80=90org=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96=E4=B8=8A=E7=BA=A7=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/api/OrganizationServiceApi.java | 17 +++- .../impl/HrOrganizationServiceImpl.java | 94 +++++++++++-------- 2 files changed, 73 insertions(+), 38 deletions(-) diff --git a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/OrganizationServiceApi.java b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/OrganizationServiceApi.java index b9e59fd87..133f366af 100644 --- a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/OrganizationServiceApi.java +++ b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/system/api/OrganizationServiceApi.java @@ -73,13 +73,28 @@ public interface OrganizationServiceApi { /** * 获取指定组织机构的上级组织机构是什么 + *

+ * 逐级向上获取直到获取到最高级 * * @param orgId 指定机构id - * @param parentLevelNum 上级机构的层级数,从0开始 + * @param parentLevelNum 上级机构的层级数,从0开始,0代表直接返回本部门 * @return 上级机构的id * @author fengshuonan * @date 2022/9/18 15:02 */ Long getParentLevelOrgId(Long orgId, Integer parentLevelNum); + /** + * 获取该部门从最高一级上级开始计算的子组织 + *

+ * 逐级向下获取,直到获取到本层机构 + * + * @param orgId 指定机构id + * @param highestLevelNum 自上而下的层级数,从0开始,0代表直接返回本部门 + * @return 计算后的上级机构id + * @author fengshuonan + * @date 2022/10/1 11:37 + */ + Long getHighestLevelOrgId(Long orgId, Integer highestLevelNum); + } diff --git a/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java b/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java index bfb411cdf..5f7be6333 100644 --- a/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java +++ b/kernel-s-system/system-business-organization/src/main/java/cn/stylefeng/roses/kernel/system/modular/organization/service/impl/HrOrganizationServiceImpl.java @@ -415,44 +415,12 @@ public class HrOrganizationServiceImpl extends ServiceImpl