参数收集清单、未符合项viewer角色下查找数据

This commit is contained in:
CD
2022-11-18 14:59:19 +08:00
parent d9b3f32594
commit 1e51819b28
7 changed files with 114 additions and 7 deletions
@@ -301,4 +301,7 @@ public interface ISysUserService extends IService<SysUser> {
boolean isRegulationOwner(LoginUser currentUser);
void setBrandAndDutyTerritory(String roles, String dutyTerritories, String brands, List<ProjectUserBrand> projectUserBrandList, List<ProjectUserDutyTerritory> projectUserDutyTerritoryList, String userId);
boolean isViewer(String userId);
}
@@ -749,4 +749,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
}
@Override
public boolean isViewer(String userId) {
boolean boo = false;
List<SysRole> roles = sysRoleMapper.getRoleByUserId(userId);
if (ObjectUtils.isNotEmpty(roles)) {
List<String> roleCodes = roles.stream().map(SysRole::getRoleCode).collect(Collectors.toList());
if (ObjectUtils.isNotEmpty(roleCodes) && roleCodes.contains(ProjectRoleEnum.VIEWER.getCode())) {
boo = true;
}
}
return boo;
}
}