mirror of https://gitee.com/stylefeng/roses
【portal】完善职务名称的设置
parent
b5397833af
commit
f28cd8d10e
|
@ -124,4 +124,12 @@ public interface HrPositionService extends IService<HrPosition>, PositionService
|
||||||
*/
|
*/
|
||||||
void fillDutyInfo(Long userId, List<HrOrganizationDTO> results);
|
void fillDutyInfo(Long userId, List<HrOrganizationDTO> results);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取职务名称
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/6/17 15:02
|
||||||
|
*/
|
||||||
|
String getPositionName(Long positionId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,9 +173,11 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
||||||
// 如果多组织列表为空,则直接返回默认的职务名称
|
// 如果多组织列表为空,则直接返回默认的职务名称
|
||||||
if (ObjectUtil.isEmpty(ptDuty)) {
|
if (ObjectUtil.isEmpty(ptDuty)) {
|
||||||
for (HrOrganizationDTO result : results) {
|
for (HrOrganizationDTO result : results) {
|
||||||
|
if (ObjectUtil.isEmpty(result.getPositionName())) {
|
||||||
result.setPositionName(expandDutyInfo.getDuty());
|
result.setPositionName(expandDutyInfo.getDuty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 多组织的职务列表不为空,则获取职务的masterOrgId对应的公司id
|
// 多组织的职务列表不为空,则获取职务的masterOrgId对应的公司id
|
||||||
for (DutyItem dutyItem : ptDuty) {
|
for (DutyItem dutyItem : ptDuty) {
|
||||||
|
@ -189,11 +191,29 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
||||||
// 遍历参数的组织机构列表,填充职务名称
|
// 遍历参数的组织机构列表,填充职务名称
|
||||||
for (HrOrganizationDTO result : results) {
|
for (HrOrganizationDTO result : results) {
|
||||||
if (result.getOrgId().equals(masterOrgIdCompanyId)) {
|
if (result.getOrgId().equals(masterOrgIdCompanyId)) {
|
||||||
|
if (ObjectUtil.isEmpty(result.getPositionName())) {
|
||||||
result.setPositionName(dutyItem.getDutyName());
|
result.setPositionName(dutyItem.getDutyName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPositionName(Long positionId) {
|
||||||
|
if (positionId == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<HrPosition> hrPositionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
hrPositionLambdaQueryWrapper.eq(HrPosition::getPositionId, positionId);
|
||||||
|
hrPositionLambdaQueryWrapper.select(HrPosition::getPositionName);
|
||||||
|
HrPosition one = this.getOne(hrPositionLambdaQueryWrapper, false);
|
||||||
|
if (one == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return one.getPositionName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer positionNum() {
|
public Integer positionNum() {
|
||||||
|
|
|
@ -241,6 +241,9 @@ public class SysUserOrgServiceServiceImpl extends ServiceImpl<SysUserOrgMapper,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填充用户的职务名称positionName
|
||||||
|
companyInfo.setPositionName(hrPositionService.getPositionName(sysUserOrg.getPositionId()));
|
||||||
|
|
||||||
// 判断是否已经加了这个公司
|
// 判断是否已经加了这个公司
|
||||||
boolean alreadyHave = false;
|
boolean alreadyHave = false;
|
||||||
for (HrOrganizationDTO dtoItem : results) {
|
for (HrOrganizationDTO dtoItem : results) {
|
||||||
|
|
Loading…
Reference in New Issue