Browse Source

更细商户端获取角色列表错误的问题

gaohp 6 months ago
parent
commit
0298f65a42

+ 4 - 4
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/dal/mysql/permission/RoleMapper.java

@@ -9,10 +9,7 @@ import cn.newfeifan.mall.module.system.dal.dataobject.permission.RoleDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.lang.Nullable;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 @Mapper
 public interface RoleMapper extends BaseMapperX<RoleDO> {
@@ -39,6 +36,9 @@ public interface RoleMapper extends BaseMapperX<RoleDO> {
         return selectList(RoleDO::getStatus, statuses);
     }
     default List<String> selectByRoleIds(Set<Long> roleIds){
+        if (roleIds.isEmpty()) {
+            return Collections.emptyList();
+        }
         List<RoleDO> roleDOS = selectList(new LambdaQueryWrapperX<RoleDO>()
                 .inIfPresent(RoleDO::getId, roleIds));
         List<String> strings = new ArrayList<>();