From 294c2febdad0d91aa246f793742e84219b0152c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 20 Jan 2025 20:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E6=8E=A5=E5=8F=A3(=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=9D=83=E9=99=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/TenantController.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java b/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java index 30fccb0..51d0dee 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java @@ -2,15 +2,14 @@ package com.gxwebsoft.common.system.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.config.ConfigProperties; import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.CommonUtil; import com.gxwebsoft.common.core.utils.JSONUtil; import com.gxwebsoft.common.core.utils.RedisUtil; import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.system.entity.*; -import com.gxwebsoft.common.system.service.CompanyService; -import com.gxwebsoft.common.system.service.MenuService; -import com.gxwebsoft.common.system.service.RoleMenuService; -import com.gxwebsoft.common.system.service.TenantService; +import com.gxwebsoft.common.system.service.*; import com.gxwebsoft.common.system.param.TenantParam; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.PageResult; @@ -194,6 +193,17 @@ public class TenantController extends BaseController { return fail("租户编号已存在"); } if (tenantService.save(tenant)) { + // 租户初始化 + final Company company = new Company(); + company.setDomain(tenant.getTenantId().toString().concat(".websoft.top")); + company.setEmail(""); + company.setPhone(tenant.getPhone()); + company.setPassword(""); + company.setTid(tenant.getTenantId()); + company.setCompanyName(tenant.getTenantName()); + company.setShortName(tenant.getTenantName()); + company.setTenantId(tenant.getTenantId()); + tenantService.initialization(company); return success("添加成功",tenant); } return fail("添加失败");