Bläddra i källkod

用户\项目模块修改

anderx 2 år sedan
förälder
incheckning
be3bc5258f

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -446,7 +446,7 @@ public class SysUser extends BaseEntity
         this.roleIds = roleIds;
     }
 
-    @Size(min = 1,message = "角色必须存在")
+    @Size(min = 1,message = "职位必须存在")
     public Long[] getPostIds()
     {
         return postIds;

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -554,6 +554,9 @@ public class SysUserServiceImpl implements ISysUserService
         if (type==null)type=0;
         if (type==0)roleId= UserRolesType.COMMON.getCode();
         else if (type==1)roleId=UserRolesType.MANAGE.getCode();
+        if (SecurityUtils.isSuperAdmin()){
+            roleId=UserRolesType.ADMIN.getCode();;
+        }
         if (name==null||name.length()<2)return new ArrayList<>();
         Long companyId = deptService.selectCompanyByDeptId();
         return userMapper.selectName(name,roleId,companyId);

+ 5 - 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -304,7 +304,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<select id="selectName" resultType="com.ruoyi.common.core.domain.entity.SysUser">
 		select a.user_id userId, a.user_name userName,a.nick_name nickName
 		from sys_user a
-		where a.user_id >1 and a.nick_name like concat('%',#{name},'%')
+		where 1=1
+		and a.nick_name like concat('%',#{name},'%')
+		 <if test="roleId !=1">
+			and  a.user_id >1
+		 </if>
 		<if test="roleId!=null">
 		and a.user_id in (select user_id from sys_user_role where role_id = #{roleId})
 		</if>