This commit is contained in:
feng
2026-02-11 09:55:11 +08:00
parent 49f316dd82
commit 677b4d5080
@@ -232,20 +232,11 @@ public class SysMessageNoticeServiceImpl extends ServiceImpl<SysMessageNoticeMap
*/
private List<String> getAccessibleNoticeIds(LoginUser loginUser) {
LambdaQueryWrapper<SysMessageNoticeScope> scopeWrapper = new LambdaQueryWrapper<>();
scopeWrapper.select(SysMessageNoticeScope::getNoticeId)
.eq(SysMessageNoticeScope::getScopeId, loginUser.getId())
.or()
.likeRight(SysMessageNoticeScope::getScopeId,
sysCache.getDepartByOrgCode(GlobalUtils.getFirstDepartOrgCode(loginUser.getOrgCode())).getOrgCode())
.or()
.likeRight(SysMessageNoticeScope::getScopeId,
sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(loginUser.getOrgCode())).getOrgCode())
.or()
.likeRight(SysMessageNoticeScope::getScopeId,
sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(loginUser.getOrgCode())).getOrgCode())
.or()
.likeRight(SysMessageNoticeScope::getScopeId,
sysCache.getDepartByOrgCode(loginUser.getOrgCode()).getOrgCode());
List<String> scopes = new ArrayList<>();
scopes.add(loginUser.getId());
scopes.addAll(GlobalUtils.getOrgCodeTreeByCode(loginUser.getOrgCode()));
scopeWrapper.select(SysMessageNoticeScope::getNoticeId);
scopeWrapper.in(SysMessageNoticeScope::getScopeId, scopes);
List<SysMessageNoticeScope> planScopes = scopeService.list(scopeWrapper);
return planScopes.stream().map(SysMessageNoticeScope::getNoticeId).collect(Collectors.toList());
}