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);
|
||||
|
||||
/**
|
||||
* 获取职务名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/17 15:02
|
||||
*/
|
||||
String getPositionName(Long positionId);
|
||||
|
||||
}
|
||||
|
|
|
@ -173,7 +173,9 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
// 如果多组织列表为空,则直接返回默认的职务名称
|
||||
if (ObjectUtil.isEmpty(ptDuty)) {
|
||||
for (HrOrganizationDTO result : results) {
|
||||
result.setPositionName(expandDutyInfo.getDuty());
|
||||
if (ObjectUtil.isEmpty(result.getPositionName())) {
|
||||
result.setPositionName(expandDutyInfo.getDuty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,12 +191,30 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
// 遍历参数的组织机构列表,填充职务名称
|
||||
for (HrOrganizationDTO result : results) {
|
||||
if (result.getOrgId().equals(masterOrgIdCompanyId)) {
|
||||
result.setPositionName(dutyItem.getDutyName());
|
||||
if (ObjectUtil.isEmpty(result.getPositionName())) {
|
||||
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
|
||||
public Integer positionNum() {
|
||||
return Convert.toInt(this.count());
|
||||
|
|
|
@ -241,6 +241,9 @@ public class SysUserOrgServiceServiceImpl extends ServiceImpl<SysUserOrgMapper,
|
|||
continue;
|
||||
}
|
||||
|
||||
// 填充用户的职务名称positionName
|
||||
companyInfo.setPositionName(hrPositionService.getPositionName(sysUserOrg.getPositionId()));
|
||||
|
||||
// 判断是否已经加了这个公司
|
||||
boolean alreadyHave = false;
|
||||
for (HrOrganizationDTO dtoItem : results) {
|
||||
|
|
Loading…
Reference in New Issue