ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
@@ -70,10 +70,10 @@ /** * 校验角色权限是否唯一 * * @param roleKey 角色权限 * @param role 角色权限 * @return 角色信息 */ public SysRole checkRoleKeyUnique(String roleKey); public SysRole checkRoleKeyUnique(SysRole role); /** * 修改角色信息 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -168,7 +168,7 @@ public String checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); SysRole info = roleMapper.checkRoleKeyUnique(role); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -104,9 +104,14 @@ where r.role_name=#{roleName} and r.del_flag = '0' limit 1 </select> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="com.ruoyi.common.core.domain.entity.SysRole" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 where r.role_key=#{roleKey} and r.del_flag = '0' <if test="orgid != null and orgid != ''"> and r.orgid = #{orgid} </if> limit 1 </select> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">