【8.3.3】【system】【cache】更新组织机构缓存的应用

pull/62/head
stylefeng 2025-01-10 13:57:00 +08:00
parent 243be73ea5
commit e3c48a828f
5 changed files with 27 additions and 20 deletions

View File

@ -9,6 +9,8 @@ import cn.stylefeng.roses.kernel.sys.api.pojo.org.CompanyDeptDTO;
/**
*
* <p>
*
*
* @author fengshuonan
* @since 2024-01-16 20:10

View File

@ -9,6 +9,8 @@ import java.util.HashMap;
/**
* id
* <p>
*
*
* @author fengshuonan
* @since 2023/7/17 15:36

View File

@ -7,6 +7,8 @@ import cn.stylefeng.roses.kernel.sys.api.OrganizationServiceApi;
/**
*
* <p>
*
*
* @author fengshuonan
* @since 2023/7/14 16:46

View File

@ -44,6 +44,12 @@ public class HrOrganizationDTO {
@ChineseDescription("主键")
private Long orgId;
/**
* 1-2-
*/
@ChineseDescription("组织机构类型1-公司2-部门")
private Integer orgType;
/**
* id
*/

View File

@ -344,8 +344,11 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
// 查询父级是否是公司
Long orgParentId = hrOrganization.getOrgParentId();
HrOrganization parentOrgInfo = this.getById(orgParentId);
return this.getOrgCompanyInfo(parentOrgInfo);
HrOrganizationDTO parentOrgInfo = this.getOrgInfo(orgParentId);
HrOrganization parentEntity = new HrOrganization();
BeanUtil.copyProperties(parentOrgInfo, parentEntity);
return this.getOrgCompanyInfo(parentEntity);
}
@Override
@ -356,16 +359,14 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
}
// 查询组织机构对应的信息
LambdaQueryWrapper<HrOrganization> 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) {
HrOrganizationDTO orgInfo = this.getOrgInfo(orgId);
if (orgInfo == null) {
return null;
}
// 查询机构对应的公司部门信息
HrOrganization hrOrganization = new HrOrganization();
BeanUtil.copyProperties(orgInfo, hrOrganization);
return this.getOrgCompanyInfo(hrOrganization);
}
@ -384,8 +385,9 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
// 查询组织机构对应的信息
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);
hrOrganizationLambdaQueryWrapper.select(HrOrganization::getOrgId, HrOrganization::getOrgType,
HrOrganization::getOrgParentId, HrOrganization::getOrgPids, HrOrganization::getOrgName,
HrOrganization::getOrgShortName, HrOrganization::getOrgSort, HrOrganization::getOrgCode);
HrOrganization hrOrganization = this.getOne(hrOrganizationLambdaQueryWrapper, false);
if (ObjectUtil.isEmpty(hrOrganization)) {
@ -578,16 +580,9 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
return OrgConstants.NONE_PARENT_ORG;
}
LambdaQueryWrapper<HrOrganization> hrOrganizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
hrOrganizationLambdaQueryWrapper.eq(HrOrganization::getOrgId, orgId);
hrOrganizationLambdaQueryWrapper.select(HrOrganization::getOrgName);
HrOrganization one = this.getOne(hrOrganizationLambdaQueryWrapper);
if (one != null) {
return one.getOrgName();
}
return OrgConstants.NONE_PARENT_ORG;
// 获取组织机构详情
HrOrganizationDTO orgInfo = this.getOrgInfo(orgId);
return orgInfo.getOrgName();
}
@Override