!421 缓存部门命名优化

Merge pull request !421 from 重楼/jjjjjjjj/dev
This commit is contained in:
芋道源码 2023-02-28 16:51:34 +00:00 committed by Gitee
commit 7c04190f6f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -76,9 +76,9 @@ public class DeptServiceImpl implements DeptService {
// 第二步构建缓存
ImmutableMap.Builder<Long, DeptDO> builder = ImmutableMap.builder();
ImmutableMultimap.Builder<Long, DeptDO> parentBuilder = ImmutableMultimap.builder();
depts.forEach(sysRoleDO -> {
builder.put(sysRoleDO.getId(), sysRoleDO);
parentBuilder.put(sysRoleDO.getParentId(), sysRoleDO);
depts.forEach(deptDO -> {
builder.put(deptDO.getId(), deptDO);
parentBuilder.put(deptDO.getParentId(), deptDO);
});
deptCache = builder.build();
parentDeptCache = parentBuilder.build();