【8.0.5】【org】更新org接口

pull/60/head
fengshuonan 2024-01-06 17:49:59 +08:00
parent 0a88ef4405
commit f251d45b4f
3 changed files with 112 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.sys.api;
import cn.stylefeng.roses.kernel.sys.api.enums.org.DetectModeEnum;
import cn.stylefeng.roses.kernel.sys.api.pojo.org.CompanyDeptDTO;
import cn.stylefeng.roses.kernel.sys.api.pojo.org.HrOrganizationDTO;
/**
* api
@ -54,4 +55,12 @@ public interface OrganizationServiceApi {
*/
CompanyDeptDTO getOrgCompanyInfo(Long orgId);
/**
* id
*
* @author fengshuonan
* @since 2024/1/6 11:21
*/
HrOrganizationDTO getOrgInfo(Long orgId);
}

View File

@ -0,0 +1,83 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.sys.api.pojo.org;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import lombok.Data;
import java.math.BigDecimal;
/**
*
*
* @author fengshuonan
* @since 2024/1/6 11:20
*/
@Data
public class HrOrganizationDTO {
/**
*
*/
@ChineseDescription("主键")
private Long orgId;
/**
* id
*/
@ChineseDescription("父id")
private Long orgParentId;
/**
* ids
*/
@ChineseDescription("父ids")
private String orgPids;
/**
*
*/
@ChineseDescription("组织名称")
private String orgName;
/**
*
*/
@ChineseDescription("组织机构简称")
private String orgShortName;
/**
*
*/
@ChineseDescription("组织编码")
private String orgCode;
/**
*
*/
@ChineseDescription("排序")
private BigDecimal orgSort;
}

View File

@ -25,6 +25,7 @@ import cn.stylefeng.roses.kernel.sys.api.enums.org.DetectModeEnum;
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.org.HrOrganizationDTO;
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;
@ -355,6 +356,25 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
return this.getOrgCompanyInfo(hrOrganization);
}
@Override
public HrOrganizationDTO getOrgInfo(Long orgId) {
// 查询组织机构对应的信息
LambdaQueryWrapper<HrOrganization> hrOrganizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
hrOrganizationLambdaQueryWrapper.eq(HrOrganization::getOrgId, orgId);
hrOrganizationLambdaQueryWrapper.select(HrOrganization::getOrgId, HrOrganization::getOrgParentId, HrOrganization::getOrgPids,
HrOrganization::getOrgName, HrOrganization::getOrgShortName, HrOrganization::getOrgSort, HrOrganization::getOrgCode);
HrOrganization hrOrganization = this.getOne(hrOrganizationLambdaQueryWrapper, false);
if (ObjectUtil.isEmpty(hrOrganization)) {
return new HrOrganizationDTO();
}
HrOrganizationDTO hrOrganizationDTO = new HrOrganizationDTO();
BeanUtil.copyProperties(hrOrganization, hrOrganizationDTO);
return hrOrganizationDTO;
}
@Override
public HomeCompanyInfo orgStatInfo() {