mirror of https://gitee.com/stylefeng/roses
【8.3.3】【dataScope】修正数据范围的注解
parent
5ed091836a
commit
d9fa5a8ab3
|
@ -15,6 +15,8 @@ import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
|||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.annotations.DataScope;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.config.DataScopeConfig;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.holder.DataScopeHolder;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext;
|
||||
import cn.stylefeng.roses.kernel.event.sdk.publish.BusinessEventPublisher;
|
||||
import cn.stylefeng.roses.kernel.log.api.util.BusinessLogUtil;
|
||||
|
@ -215,7 +217,14 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
List<HrOrganization> records = hrOrganizationPage.getRecords();
|
||||
|
||||
// 填充组织机构层级的详情
|
||||
List<OrganizationLevel> list = organizationLevelService.findList(new OrganizationLevelRequest());
|
||||
List<OrganizationLevel> list;
|
||||
DataScopeConfig tempDataScopeConfig = DataScopeHolder.get();
|
||||
try {
|
||||
DataScopeHolder.set(null);
|
||||
list = organizationLevelService.findList(new OrganizationLevelRequest());
|
||||
} finally {
|
||||
DataScopeHolder.set(tempDataScopeConfig);
|
||||
}
|
||||
for (HrOrganization record : records) {
|
||||
record.setOrganizationLevel(list.stream().filter(item -> item.getLevelCode().equals(record.getLevelCode())).findFirst().orElse(null));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue