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

pull/123/head
RuoYi 3 years ago
parent 05ce7d92a9
commit 9f21dbbc5c

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

@ -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
* @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

@ -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
/**
* ID
*
* @param username ID
* @param userId ID
* @return
*/
public List<SysMenu> selectMenuTreeByUserId(Long userId);
@ -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,7 +1,6 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysNotice;
/**

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

@ -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
* @param userId ID
* @return ID
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
*

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

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

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

@ -18,6 +18,7 @@ public interface SysUserMapper
* @return
*/
public List<SysUser> selectUserList(SysUser sysUser);
/**
*
*

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

@ -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,7 +1,6 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysConfig;
/**

@ -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
* @param roleId ID
* @return
*/
public List<Integer> selectDeptListByRoleId(Long roleId);
public List<Long> selectDeptListByRoleId(Long roleId);
/**
* ID

@ -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
* @param roleId ID
* @return
*/
public List<Integer> selectMenuListByRoleId(Long roleId);
public List<Long> selectMenuListByRoleId(Long roleId);
/**
*

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

@ -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
* @param userId ID
* @return ID
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
*

@ -144,6 +144,7 @@ public interface ISysRoleService
* @return
*/
public int deleteRoleByIds(Long[] roleIds);
/**
*
*

@ -127,7 +127,7 @@ public interface ISysUserService
* @return
*/
public int updateUser(SysUser user);
/**
*
*

@ -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());

@ -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
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
// 内链打开外网方式
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
{
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[] { "", "" });
}
}

@ -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;

@ -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;

@ -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
* @return ID
*/
@Override
public List<Integer> selectPostListByUserId(Long userId)
public List<Long> selectPostListByUserId(Long userId)
{
return postMapper.selectPostListByUserId(userId);
}

@ -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
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
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
}
/**
*
*
*
* @param user
* @return

Loading…
Cancel
Save