自增id问题
This commit is contained in:
@@ -119,7 +119,6 @@ public class SysConfigServiceImpl implements ISysConfigService
|
||||
@Override
|
||||
public int insertConfig(SysConfig config)
|
||||
{
|
||||
config.setConfigId(IdUtil.getSnowflakeNextId());
|
||||
int row = configMapper.insertConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
dept.setDeptId(IdUtil.getSnowflakeNextId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
@Override
|
||||
public int insertDictData(SysDictData data)
|
||||
{
|
||||
data.setDictCode(IdUtil.getSnowflakeNextId());
|
||||
int row = dictDataMapper.insertDictData(data);
|
||||
if (row > 0)
|
||||
{
|
||||
|
||||
@@ -176,7 +176,6 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
@Override
|
||||
public int insertDictType(SysDictType dict)
|
||||
{
|
||||
dict.setDictId(IdUtil.getSnowflakeNextId());
|
||||
int row = dictTypeMapper.insertDictType(dict);
|
||||
if (row > 0)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
||||
@Override
|
||||
public void insertLogininfor(SysLogininfor logininfor)
|
||||
{
|
||||
logininfor.setInfoId(IdUtil.getSnowflakeNextId());
|
||||
logininforMapper.insertLogininfor(logininfor);
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,6 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
@Override
|
||||
public int insertMenu(SysMenu menu)
|
||||
{
|
||||
menu.setMenuId(IdUtil.getSnowflakeNextId());
|
||||
return menuMapper.insertMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||
@Override
|
||||
public int insertNotice(SysNotice notice)
|
||||
{
|
||||
notice.setNoticeId(IdUtil.getSnowflakeNextId());
|
||||
return noticeMapper.insertNotice(notice);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
||||
@Override
|
||||
public void insertOperlog(SysOperLog operLog)
|
||||
{
|
||||
operLog.setOperId(IdUtil.getSnowflakeNextId());
|
||||
operLogMapper.insertOperlog(operLog);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,6 @@ public class SysPostServiceImpl implements ISysPostService
|
||||
@Override
|
||||
public int insertPost(SysPost post)
|
||||
{
|
||||
post.setPostId(IdUtil.getSnowflake().nextId());
|
||||
return postMapper.insertPost(post);
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,6 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
@Transactional
|
||||
public int insertRole(SysRole role)
|
||||
{
|
||||
role.setRoleId(IdUtil.getSnowflakeNextId());
|
||||
// 新增角色信息
|
||||
roleMapper.insertRole(role);
|
||||
return insertRoleMenu(role);
|
||||
|
||||
@@ -262,7 +262,6 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
@Transactional
|
||||
public int insertUser(SysUser user)
|
||||
{
|
||||
user.setUserId(IdUtil.getSnowflakeNextId());
|
||||
// 新增用户信息
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户岗位关联
|
||||
@@ -281,7 +280,6 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
@Override
|
||||
public boolean registerUser(SysUser user)
|
||||
{
|
||||
user.setUserId(IdUtil.getSnowflakeNextId());
|
||||
return userMapper.insertUser(user) > 0;
|
||||
}
|
||||
|
||||
@@ -510,7 +508,6 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
||||
user.setPassword(SecurityUtils.encryptPassword(password));
|
||||
user.setCreateBy(operName);
|
||||
user.setUserId(IdUtil.getSnowflakeNextId());
|
||||
userMapper.insertUser(user);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
|
||||
|
||||
@@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" >
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
|
||||
@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" >
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId" >
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
|
||||
@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" >
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId" >
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
|
||||
Reference in New Issue
Block a user