Java Code Examples for com.ruoyi.system.domain.SysUser#getUserId()

The following examples show how to use com.ruoyi.system.domain.SysUser#getUserId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysUserServiceImpl.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 修改保存用户信息
 * 
 * @param user 用户信息
 * @return 结果
 */
@Override
@Transactional
public int updateUser(SysUser user)
{
    Long userId = user.getUserId();
    // 删除用户与角色关联
    userRoleMapper.deleteUserRoleByUserId(userId);
    // 新增用户与角色管理
    insertUserRole(user);
    // 删除用户与岗位关联
    userPostMapper.deleteUserPostByUserId(userId);
    // 新增用户与岗位管理
    insertUserPost(user);
    return userMapper.updateUser(user);
}
 
Example 2
Source File: SysUserController.java    From supplierShop with MIT License 6 votes vote down vote up
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@PostMapping("/resetPwd")
@ResponseBody
public AjaxResult resetPwdSave(SysUser user)
{
    user.setSalt(ShiroUtils.randomSalt());
    user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
    if (userService.resetUserPwd(user) > 0)
    {
        if (ShiroUtils.getUserId() == user.getUserId())
        {
            ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
        }
        return success();
    }
    return error();
}
 
Example 3
Source File: SysUserServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验用户名称是否唯一
 *
 * @param user 用户信息
 * @return
 */
@Override
public String checkPhoneUnique(SysUser user)
{
    Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
    SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
    if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
    {
        return UserConstants.USER_PHONE_NOT_UNIQUE;
    }
    return UserConstants.USER_PHONE_UNIQUE;
}
 
Example 4
Source File: SysUserServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验email是否唯一
 *
 * @param user 用户信息
 * @return
 */
@Override
public String checkEmailUnique(SysUser user)
{
    Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
    SysUser info = userMapper.checkEmailUnique(user.getEmail());
    if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
    {
        return UserConstants.USER_EMAIL_NOT_UNIQUE;
    }
    return UserConstants.USER_EMAIL_UNIQUE;
}
 
Example 5
Source File: SysUserServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 修改保存用户信息
 * 
 * @param user 用户信息
 * @return 结果
 */
@Override
public int updateUser(SysUser user)
{
    Long userId = user.getUserId();
    // 删除用户与角色关联
    userRoleMapper.deleteUserRoleByUserId(userId);
    // 新增用户与角色管理
    insertUserRole(user);
    // 删除用户与岗位关联
    userPostMapper.deleteUserPostByUserId(userId);
    // 新增用户与岗位管理
    insertUserPost(user);
    return userMapper.updateUser(user);
}
 
Example 6
Source File: SysUserServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验用户名称是否唯一
 *
 * @param user 用户信息
 * @return
 */
@Override
public String checkPhoneUnique(SysUser user)
{
    Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
    SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
    if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
    {
        return UserConstants.USER_PHONE_NOT_UNIQUE;
    }
    return UserConstants.USER_PHONE_UNIQUE;
}
 
Example 7
Source File: SysUserServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验email是否唯一
 *
 * @param user 用户信息
 * @return
 */
@Override
public String checkEmailUnique(SysUser user)
{
    Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
    SysUser info = userMapper.checkEmailUnique(user.getEmail());
    if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
    {
        return UserConstants.USER_EMAIL_NOT_UNIQUE;
    }
    return UserConstants.USER_EMAIL_UNIQUE;
}