mirror of https://gitee.com/y_project/RuoYi.git
优化代码
parent
6408525634
commit
0ea688b04b
|
@ -101,6 +101,25 @@ public interface SysUserMapper
|
|||
*/
|
||||
public int updateUserAvatar(@Param("userId") Long userId, @Param("avatar") String avatar);
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param status 状态
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserStatus(@Param("userId") Long userId, @Param("status") String status);
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param password 密码
|
||||
* @param salt 盐
|
||||
* @return 结果
|
||||
*/
|
||||
public int resetUserPwd(@Param("userId") Long userId, @Param("password") String password, @Param("salt") String salt);
|
||||
|
||||
/**
|
||||
* 更新用户登录信息(IP和登录时间)
|
||||
*
|
||||
|
|
|
@ -324,7 +324,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Override
|
||||
public int resetUserPwd(SysUser user)
|
||||
{
|
||||
return updateUserInfo(user);
|
||||
return userMapper.resetUserPwd(user.getUserId(), user.getPassword(), user.getSalt());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -544,6 +544,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
checkUserDataScope(u.getUserId());
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
user.setUserId(u.getUserId());
|
||||
user.setDeptId(u.getDeptId());
|
||||
user.setUpdateBy(operName);
|
||||
userMapper.updateUser(user);
|
||||
successNum++;
|
||||
|
@ -589,6 +590,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Override
|
||||
public int changeStatus(SysUser user)
|
||||
{
|
||||
return userMapper.updateUser(user);
|
||||
return userMapper.updateUserStatus(user.getUserId(), user.getStatus());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,6 +170,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_user set avatar = #{avatar} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update sys_user SET password = #{password}, salt = #{salt}, update_time = sysdate() where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user SET status = #{status}, update_time = sysdate() where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateLoginInfo" parameterType="SysUser">
|
||||
update sys_user set login_ip = #{loginIp}, login_date = #{loginDate} where user_id = #{userId}
|
||||
</update>
|
||||
|
|
Loading…
Reference in New Issue