Browse Source

修复长主键溢出问题 将查询返回类型改为 Long

tags/v3.3.0
RuoYi 3 years ago
parent
commit
9f21dbbc5c
  1. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
  2. 4
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
  3. 6
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
  4. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
  5. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
  6. 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
  7. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
  8. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
  9. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
  10. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  11. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
  12. 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
  13. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
  14. 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
  15. 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
  16. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
  17. 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
  18. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
  19. 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  20. 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  21. 17
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
  22. 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
  23. 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java
  24. 4
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
  25. 26
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysConfig;
/**

4
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.api.domain.SysDept;
/**
@ -28,7 +26,7 @@ public interface SysDeptMapper @@ -28,7 +26,7 @@ public interface SysDeptMapper
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
*/
public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
/**
* 根据部门ID查询信息

6
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysMenu;
/**
@ -54,7 +52,7 @@ public interface SysMenuMapper @@ -54,7 +52,7 @@ public interface SysMenuMapper
/**
* 根据用户ID查询菜单
*
* @param username 用户ID
* @param userId 用户ID
* @return 菜单列表
*/
public List<SysMenu> selectMenuTreeByUserId(Long userId);
@ -66,7 +64,7 @@ public interface SysMenuMapper @@ -66,7 +64,7 @@ public interface SysMenuMapper
* @param menuCheckStrictly 菜单树选择项是否关联显示
* @return 选中菜单列表
*/
public List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
/**
* 根据菜单ID查询信息

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysNotice;
/**

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.api.domain.SysOperLog;
/**

3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysPost;
/**
@ -40,7 +39,7 @@ public interface SysPostMapper @@ -40,7 +39,7 @@ public interface SysPostMapper
* @param userId 用户ID
* @return 选中岗位ID列表
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
* 查询用户所属岗位组

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysRoleDept;
/**

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.api.domain.SysRole;
/**

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysRoleMenu;
/**

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java

@ -18,6 +18,7 @@ public interface SysUserMapper @@ -18,6 +18,7 @@ public interface SysUserMapper
* @return 用户信息集合信息
*/
public List<SysUser> selectUserList(SysUser sysUser);
/**
* 根据条件分页查询未已配用户角色列表
*

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysUserPost;
/**

2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysUserRole;
/**

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysConfig;
/**

3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.domain.vo.TreeSelect;
@ -42,7 +41,7 @@ public interface ISysDeptService @@ -42,7 +41,7 @@ public interface ISysDeptService
* @param roleId 角色ID
* @return 选中部门列表
*/
public List<Integer> selectDeptListByRoleId(Long roleId);
public List<Long> selectDeptListByRoleId(Long roleId);
/**
* 根据部门ID查询信息

3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java

@ -2,7 +2,6 @@ package com.ruoyi.system.service; @@ -2,7 +2,6 @@ package com.ruoyi.system.service;
import java.util.List;
import java.util.Set;
import com.ruoyi.system.domain.SysMenu;
import com.ruoyi.system.domain.vo.RouterVo;
import com.ruoyi.system.domain.vo.TreeSelect;
@ -53,7 +52,7 @@ public interface ISysMenuService @@ -53,7 +52,7 @@ public interface ISysMenuService
* @param roleId 角色ID
* @return 选中菜单列表
*/
public List<Integer> selectMenuListByRoleId(Long roleId);
public List<Long> selectMenuListByRoleId(Long roleId);
/**
* 构建前端路由所需要的菜单

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysNotice;
/**

3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysPost;
/**
@ -40,7 +39,7 @@ public interface ISysPostService @@ -40,7 +39,7 @@ public interface ISysPostService
* @param userId 用户ID
* @return 选中岗位ID列表
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
* 校验岗位名称

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java

@ -144,6 +144,7 @@ public interface ISysRoleService @@ -144,6 +144,7 @@ public interface ISysRoleService
* @return 结果
*/
public int deleteRoleByIds(Long[] roleIds);
/**
* 取消授权用户角色
*

2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@ -127,7 +127,7 @@ public interface ISysUserService @@ -127,7 +127,7 @@ public interface ISysUserService
* @return 结果
*/
public int updateUser(SysUser user);
/**
* 用户授权角色
*

2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@ -100,7 +100,7 @@ public class SysDeptServiceImpl implements ISysDeptService @@ -100,7 +100,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 选中部门列表
*/
@Override
public List<Integer> selectDeptListByRoleId(Long roleId)
public List<Long> selectDeptListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());

17
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

@ -128,7 +128,7 @@ public class SysMenuServiceImpl implements ISysMenuService @@ -128,7 +128,7 @@ public class SysMenuServiceImpl implements ISysMenuService
* @return 选中菜单列表
*/
@Override
public List<Integer> selectMenuListByRoleId(Long roleId)
public List<Long> selectMenuListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
@ -179,7 +179,7 @@ public class SysMenuServiceImpl implements ISysMenuService @@ -179,7 +179,7 @@ public class SysMenuServiceImpl implements ISysMenuService
router.setPath("/inner");
List<RouterVo> childrenList = new ArrayList<RouterVo>();
RouterVo children = new RouterVo();
String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
String routerPath = innerLinkReplaceEach(menu.getPath());
children.setPath(routerPath);
children.setComponent(UserConstants.INNER_LINK);
children.setName(StringUtils.capitalize(routerPath));
@ -358,7 +358,7 @@ public class SysMenuServiceImpl implements ISysMenuService @@ -358,7 +358,7 @@ public class SysMenuServiceImpl implements ISysMenuService
// 内链打开外网方式
if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
{
routerPath = StringUtils.replaceEach(routerPath, new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
routerPath = innerLinkReplaceEach(routerPath);
}
// 非外链并且是一级目录(类型为目录)
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
@ -500,4 +500,15 @@ public class SysMenuServiceImpl implements ISysMenuService @@ -500,4 +500,15 @@ public class SysMenuServiceImpl implements ISysMenuService
{
return getChildList(list, t).size() > 0 ? true : false;
}
/**
* 内链域名特殊字符替换
*
* @return
*/
public String innerLinkReplaceEach(String path)
{
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS },
new String[] { "", "" });
}
}

2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java

@ -1,10 +1,8 @@ @@ -1,10 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.mapper.SysNoticeMapper;
import com.ruoyi.system.service.ISysNoticeService;

1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java

@ -4,7 +4,6 @@ import java.util.HashSet; @@ -4,7 +4,6 @@ import java.util.HashSet;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.system.service.ISysPermissionService;

4
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java

@ -1,10 +1,8 @@ @@ -1,10 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils;
@ -69,7 +67,7 @@ public class SysPostServiceImpl implements ISysPostService @@ -69,7 +67,7 @@ public class SysPostServiceImpl implements ISysPostService
* @return 选中岗位ID列表
*/
@Override
public List<Integer> selectPostListByUserId(Long userId)
public List<Long> selectPostListByUserId(Long userId)
{
return postMapper.selectPostListByUserId(userId);
}

26
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@ -2,11 +2,13 @@ package com.ruoyi.system.service.impl; @@ -2,11 +2,13 @@ package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.SpringUtils;
@ -127,16 +129,11 @@ public class SysUserServiceImpl implements ISysUserService @@ -127,16 +129,11 @@ public class SysUserServiceImpl implements ISysUserService
public String selectUserRoleGroup(String userName)
{
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
StringBuffer idsStr = new StringBuffer();
for (SysRole role : list)
if (CollectionUtils.isEmpty(list))
{
idsStr.append(role.getRoleName()).append(",");
return StringUtils.EMPTY;
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
}
/**
@ -149,16 +146,11 @@ public class SysUserServiceImpl implements ISysUserService @@ -149,16 +146,11 @@ public class SysUserServiceImpl implements ISysUserService
public String selectUserPostGroup(String userName)
{
List<SysPost> list = postMapper.selectPostsByUserName(userName);
StringBuffer idsStr = new StringBuffer();
for (SysPost post : list)
if (CollectionUtils.isEmpty(list))
{
idsStr.append(post.getPostName()).append(",");
return StringUtils.EMPTY;
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
}
/**
@ -179,7 +171,7 @@ public class SysUserServiceImpl implements ISysUserService @@ -179,7 +171,7 @@ public class SysUserServiceImpl implements ISysUserService
}
/**
* 校验用户名称是否唯一
* 校验手机号码是否唯一
*
* @param user 用户信息
* @return

Loading…
Cancel
Save