|
|
@@ -49,7 +49,7 @@ public class SystemUserInitService { |
|
|
|
*/ |
|
|
|
public JsonResult init(UserInitRequest request) { |
|
|
|
log.info("进入初始化系统租户用户业务接口"); |
|
|
|
JsonResult result = this.check(request, null); |
|
|
|
JsonResult result = this.check(request); |
|
|
|
if (0 != result.getCode()) { |
|
|
|
log.info("初始化系统租户用户业务接口:校验失败:{}", result.getMsg()); |
|
|
|
return result; |
|
|
@@ -133,7 +133,7 @@ public class SystemUserInitService { |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private JsonResult check(UserInitRequest request, String tenantId) { |
|
|
|
private JsonResult check(UserInitRequest request) { |
|
|
|
if (StringUtils.isEmpty(request.getName())) { |
|
|
|
return JsonResult.error(400, "用户名为空"); |
|
|
|
} |
|
|
@@ -144,14 +144,12 @@ public class SystemUserInitService { |
|
|
|
return JsonResult.error(400, "租户编号"); |
|
|
|
} |
|
|
|
Integer count = userMapper.selectCount(new LambdaQueryWrapper<User>() |
|
|
|
.eq(User::getTenantId, tenantId) |
|
|
|
.eq(User::getUsername, request.getName()) |
|
|
|
.eq(User::getMark, 1)); |
|
|
|
if (count > 0) { |
|
|
|
return JsonResult.error(400, "系统中已经存在该用户名"); |
|
|
|
} |
|
|
|
count = roleMapper.selectCount(new LambdaQueryWrapper<Role>() |
|
|
|
.eq(Role::getTenantId, tenantId) |
|
|
|
.eq(Role::getId, 1) |
|
|
|
.eq(Role::getMark, 1)); |
|
|
|
if (count <= 0) { |