mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】更新用户部门为空的逻辑补充
parent
43acfd697a
commit
0e036b5ec8
|
@ -295,6 +295,14 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
// 4. 当前公司下的机构数量
|
||||
Long userId = LoginContext.me().getLoginUser().getUserId();
|
||||
UserOrgDTO userMainOrgInfo = sysUserOrgService.getUserMainOrgInfo(userId);
|
||||
|
||||
// 当前用户没公司,则直接设置为0
|
||||
if (userMainOrgInfo == null) {
|
||||
homeCompanyInfo.setCurrentCompanyPersonNum(0L);
|
||||
homeCompanyInfo.setCurrentCompanyPersonNum(0L);
|
||||
return homeCompanyInfo;
|
||||
}
|
||||
|
||||
Long companyId = userMainOrgInfo.getCompanyId();
|
||||
|
||||
// 获取当前公司的所有子公司数量(含当前公司)
|
||||
|
|
|
@ -140,6 +140,12 @@ public class SysUserOrgServiceImpl extends ServiceImpl<SysUserOrgMapper, SysUser
|
|||
queryWrapper.eq(SysUserOrg::getUserId, userId);
|
||||
queryWrapper.eq(SysUserOrg::getMainFlag, YesOrNotEnum.Y.getCode());
|
||||
List<SysUserOrg> sysUserOrgList = this.list(queryWrapper);
|
||||
|
||||
// 部门为空,直接返回null
|
||||
if (ObjectUtil.isEmpty(sysUserOrgList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (sysUserOrgList.size() > 1) {
|
||||
throw new SysException(MAIN_FLAG_COUNT_ERROR, userId);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue