【8.1.0】【role】修复多角色查询warn

pull/60/head
fengshuonan 2024-01-16 19:44:58 +08:00
parent 7d95e327c0
commit 631da61f7a
1 changed files with 5 additions and 4 deletions

View File

@ -218,10 +218,11 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
// 按数据范围降序排列50-全部数据最大
sysRoleLambdaQueryWrapper.orderByDesc(SysRole::getDataScopeType);
SysRole sysRole = this.getOne(sysRoleLambdaQueryWrapper, false);
if (sysRole != null) {
if (sysRole.getDataScopeType() != null) {
return DataScopeTypeEnum.codeToEnum(sysRole.getDataScopeType());
List<SysRole> sysRoleList = this.list(sysRoleLambdaQueryWrapper);
if (ObjectUtil.isNotEmpty(sysRoleList)) {
Integer dataScopeType = sysRoleList.get(0).getDataScopeType();
if (dataScopeType != null) {
return DataScopeTypeEnum.codeToEnum(dataScopeType);
}
}