update 优化 去除创建租户没必要的校验

feature/model
疯狂的狮子Li 2 years ago
parent 662df23d4d
commit 876145dcec

@ -17,7 +17,6 @@ import com.ruoyi.common.mybatis.core.page.TableDataInfo;
import com.ruoyi.common.tenant.helper.TenantHelper; import com.ruoyi.common.tenant.helper.TenantHelper;
import com.ruoyi.common.web.core.BaseController; import com.ruoyi.common.web.core.BaseController;
import com.ruoyi.system.domain.bo.SysTenantBo; import com.ruoyi.system.domain.bo.SysTenantBo;
import com.ruoyi.system.domain.bo.SysUserBo;
import com.ruoyi.system.domain.vo.SysTenantVo; import com.ruoyi.system.domain.vo.SysTenantVo;
import com.ruoyi.system.service.ISysTenantService; import com.ruoyi.system.service.ISysTenantService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
@ -93,12 +92,6 @@ public class SysTenantController extends BaseController {
if (!sysTenantService.checkCompanyNameUnique(bo)) { if (!sysTenantService.checkCompanyNameUnique(bo)) {
throw new ServiceException("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在"); throw new ServiceException("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在");
} }
SysUserBo userBo = new SysUserBo();
userBo.setUserName(bo.getUsername());
// 判断用户名是否重复
if (!sysUserService.checkUserNameUnique(userBo)) {
throw new ServiceException("新增用户'" + bo.getUsername() + "'失败,登录账号已存在");
}
return toAjax(sysTenantService.insertByBo(bo)); return toAjax(sysTenantService.insertByBo(bo));
} }

Loading…
Cancel
Save