update 优化 用户注册 创建人使用无意义值

2.X
疯狂的狮子Li 9 months ago
parent 3ef88a8860
commit 7a7404d11a

@ -139,8 +139,7 @@ public class RemoteUserServiceImpl implements RemoteUserService {
throw new ServiceException("当前系统没有开启注册功能");
}
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getUserName, sysUserBo.getUserName())
.ne(ObjectUtil.isNotNull(sysUserBo.getUserId()), SysUser::getUserId, sysUserBo.getUserId()));
.eq(SysUser::getUserName, sysUserBo.getUserName()));
});
if (exist) {
throw new UserException("user.register.save.error", username);

@ -315,8 +315,8 @@ public class SysUserServiceImpl implements ISysUserService {
*/
@Override
public boolean registerUser(SysUserBo user, String tenantId) {
user.setCreateBy(user.getUserId());
user.setUpdateBy(user.getUserId());
user.setCreateBy(0L);
user.setUpdateBy(0L);
SysUser sysUser = MapstructUtils.convert(user, SysUser.class);
sysUser.setTenantId(tenantId);
return baseMapper.insert(sysUser) > 0;

Loading…
Cancel
Save