【8.0】【sys】更新通用机构树的数据范围筛选

pull/57/head
fengshuonan 2023-07-18 23:53:17 +08:00
parent 3ee655a874
commit f2ace559d4
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.roses.kernel.rule.tree.factory.DefaultTreeBuildFactory;
import cn.stylefeng.roses.kernel.sys.api.callback.RemoveOrgCallbackApi;
import cn.stylefeng.roses.kernel.sys.api.constants.SysConstants;
import cn.stylefeng.roses.kernel.sys.api.context.DataScopeContext;
import cn.stylefeng.roses.kernel.sys.api.enums.org.DetectModeEnum;
import cn.stylefeng.roses.kernel.sys.api.enums.org.OrgTypeEnum;
import cn.stylefeng.roses.kernel.sys.api.exception.enums.OrgExceptionEnum;
@ -592,6 +593,12 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
queryWrapper.eq(HrOrganization::getOrgType, OrgTypeEnum.COMPANY.getCode());
}
// 更新数据范围的筛选条件
Set<Long> dataScope = DataScopeContext.me().currentUserOrgScopeList();
if (ObjectUtil.isNotEmpty(dataScope)) {
queryWrapper.in(HrOrganization::getOrgId, dataScope);
}
return queryWrapper;
}