Browse Source

删除BUG修复

anderx 2 years ago
parent
commit
9512202f41

+ 4 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -538,13 +538,13 @@ public class SysUserServiceImpl implements ISysUserService
                 if (StringUtils.isEmpty(user.getFullJob())){
                     throw  new ServiceException("全职/兼职数据异常");
                 }
-                SysUser sysUser1 = userMapper.selectUserByUserName(user.getUserName());
-                if (sysUser1 != null){
-                    throw  new ServiceException("用户名(账号)已存在");
-                }
                 // 验证是否存在这个用户
                 SysUser u = userMapper.checkJobNumber(user.getJobNumber(),company);
                 if (StringUtils.isNull(u)){
+                    SysUser sysUser1 = userMapper.selectUserByUserName(user.getUserName());
+                    if (sysUser1 != null){
+                        throw  new ServiceException("用户名(账号)已存在");
+                    }
                     user.setPassword(SecurityUtils.encryptPassword(password));
                     user.setCreateBy(operName);
                     user.setUserId(null);