Java Code Examples for com.ruoyi.common.constant.UserConstants#NOT_UNIQUE

The following examples show how to use com.ruoyi.common.constant.UserConstants#NOT_UNIQUE . 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 RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验用户名称是否唯一
 * 
 * @param userName 用户名称
 * @return 结果
 */
@Override
public String checkUserNameUnique(String userName)
{
    int count = userMapper.checkUserNameUnique(userName);
    if (count > 0)
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 2
Source File: SysUserServiceImpl.java    From RuoYi-Vue 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.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 3
Source File: SysUserServiceImpl.java    From RuoYi-Vue 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.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 4
Source File: SysDeptServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验部门名称是否唯一
 * 
 * @param dept 部门信息
 * @return 结果
 */
@Override
public String checkDeptNameUnique(SysDept dept)
{
    Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
    SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
    if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 5
Source File: SysConfigServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验参数键名是否唯一
 * 
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public String checkConfigKeyUnique(SysConfig config)
{
    Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
    SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
    if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 6
Source File: SysRoleServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验角色名称是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleNameUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 7
Source File: SysRoleServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验角色权限是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleKeyUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 8
Source File: SysDictTypeServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验字典类型称是否唯一
 * 
 * @param dict 字典类型
 * @return 结果
 */
@Override
public String checkDictTypeUnique(SysDictType dict)
{
    Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
    SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
    if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 9
Source File: SysMenuServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验菜单名称是否唯一
 * 
 * @param menu 菜单信息
 * @return 结果
 */
@Override
public String checkMenuNameUnique(SysMenu menu)
{
    Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
    SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
    if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 10
Source File: SysPostServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验岗位名称是否唯一
 * 
 * @param post 岗位信息
 * @return 结果
 */
@Override
public String checkPostNameUnique(SysPost post)
{
    Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
    SysPost info = postMapper.checkPostNameUnique(post.getPostName());
    if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
 
Example 11
Source File: SysPostServiceImpl.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 校验岗位编码是否唯一
 * 
 * @param post 岗位信息
 * @return 结果
 */
@Override
public String checkPostCodeUnique(SysPost post)
{
    Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
    SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
    if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
    {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}