mirror of https://gitee.com/stylefeng/roses
【7.6.0】【personal】更新当前公司部门数
parent
2f43ea22f3
commit
6b3ad58210
|
@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.sys.modular.org.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
|
@ -320,8 +321,11 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
||||||
homeCompanyInfo.setCurrentCompanyPersonNum(0L);
|
homeCompanyInfo.setCurrentCompanyPersonNum(0L);
|
||||||
} else {
|
} else {
|
||||||
List<Long> orgIdList = organizations.stream().map(HrOrganization::getOrgId).collect(Collectors.toList());
|
List<Long> orgIdList = organizations.stream().map(HrOrganization::getOrgId).collect(Collectors.toList());
|
||||||
long userCount = sysUserOrgService.count(new LambdaQueryWrapper<SysUserOrg>().in(SysUserOrg::getOrgId, orgIdList));
|
LambdaQueryWrapper<SysUserOrg> userWrapper = new LambdaQueryWrapper<SysUserOrg>().in(SysUserOrg::getOrgId, orgIdList);
|
||||||
homeCompanyInfo.setCurrentCompanyPersonNum(userCount);
|
userWrapper.select(SysUserOrg::getUserId);
|
||||||
|
List<SysUserOrg> list = sysUserOrgService.list(userWrapper);
|
||||||
|
Set<Long> currentOrgUserSize = list.stream().map(SysUserOrg::getUserId).collect(Collectors.toSet());
|
||||||
|
homeCompanyInfo.setCurrentCompanyPersonNum(Convert.toLong(currentOrgUserSize.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return homeCompanyInfo;
|
return homeCompanyInfo;
|
||||||
|
|
Loading…
Reference in New Issue