From 74a147085ceb530508e5d0627190ff1a4d003071 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Sun, 2 Jul 2023 08:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90personal?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E5=BD=93=E5=89=8D=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/service/HrOrganizationService.java | 10 +++++++ .../impl/HrOrganizationServiceImpl.java | 30 +++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java index 534159a64..846d9c538 100644 --- a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java +++ b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java @@ -121,6 +121,16 @@ public interface HrOrganizationService extends IService { */ CompanyDeptDTO getOrgCompanyInfo(HrOrganization hrOrganization); + /** + * 根据组织机构id,获取这个组织机构id对应的公司部门信息 + * + * @param orgId 组织机构id + * @return 单独返回公司信息 + * @author fengshuonan + * @since 2023/7/2 8:38 + */ + CompanyDeptDTO getOrgCompanyInfo(Long orgId); + /** * 获取组织机构统计信息,包含系统的统计,包含当前用户公司的统计 *

diff --git a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java index a645e849a..f4e670e33 100644 --- a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java +++ b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java @@ -19,7 +19,6 @@ import cn.stylefeng.roses.kernel.sys.api.callback.RemoveOrgCallbackApi; import cn.stylefeng.roses.kernel.sys.api.enums.org.OrgTypeEnum; import cn.stylefeng.roses.kernel.sys.api.exception.enums.OrgExceptionEnum; import cn.stylefeng.roses.kernel.sys.api.pojo.org.CompanyDeptDTO; -import cn.stylefeng.roses.kernel.sys.api.pojo.user.UserOrgDTO; import cn.stylefeng.roses.kernel.sys.modular.org.constants.OrgConstants; import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrganization; import cn.stylefeng.roses.kernel.sys.modular.org.factory.OrganizationFactory; @@ -277,6 +276,27 @@ public class HrOrganizationServiceImpl extends ServiceImpl hrOrganizationLambdaQueryWrapper = new LambdaQueryWrapper<>(); + hrOrganizationLambdaQueryWrapper.eq(HrOrganization::getOrgId, orgId); + hrOrganizationLambdaQueryWrapper.select(HrOrganization::getOrgType, HrOrganization::getOrgId, HrOrganization::getOrgParentId); + HrOrganization hrOrganization = this.getOne(hrOrganizationLambdaQueryWrapper, false); + + if (hrOrganization == null) { + return null; + } + + // 查询机构对应的公司部门信息 + return this.getOrgCompanyInfo(hrOrganization); + } + @Override public HomeCompanyInfo orgStatInfo() { @@ -297,17 +317,17 @@ public class HrOrganizationServiceImpl extends ServiceImpl wrapper = Wrappers.lambdaQuery(HrOrganization.class)