From 2ac2b88a966e7e53a3e64471565266e5dd9e6770 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, 3 Mar 2025 09:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9AtemplateId=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E7=99=BB=E5=BD=95=E5=8C=BA=E5=88=86=E6=98=AF?= =?UTF-8?q?=E5=93=AA=E4=B8=AA=E4=BA=A7=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gxwebsoft/common/core/config/MybatisPlusConfig.java | 1 - .../gxwebsoft/common/system/controller/MainController.java | 6 ++++++ .../com/gxwebsoft/common/system/mapper/xml/UserMapper.xml | 6 ++++++ .../java/com/gxwebsoft/common/system/param/LoginParam.java | 6 ++++++ .../java/com/gxwebsoft/common/system/param/UserParam.java | 4 ++++ .../common/system/service/impl/TenantServiceImpl.java | 3 +++ .../common/system/service/impl/UserServiceImpl.java | 3 +++ 7 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java index 7cb45eb..4434ab9 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java @@ -44,7 +44,6 @@ public class MybatisPlusConfig { // 从请求头拿ID tenantId = request.getHeader("tenantId"); if(tenantId != null){ - System.out.println("从请求头拿ID = " + tenantId); return new LongValue(tenantId); } // 从域名拿ID diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java index d473cbb..5a81986 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java @@ -715,6 +715,9 @@ public class MainController extends BaseController { if(user.getAddress() != null){ userParam.setAddress(user.getAddress()); } + if(user.getTemplateId() != null){ + userParam.setTemplateId(user.getTemplateId()); + } if (!isAdmin) { // 短信验证 @@ -773,6 +776,9 @@ public class MainController extends BaseController { company.setIndustryParent(user.getIndustryParent()); company.setIndustryChild(user.getIndustryChild()); } + if(user.getTemplateId() != null){ + company.setTemplateId(user.getTemplateId()); + } final Company addCompany = tenantService.initialization(company); if (ObjectUtil.isNotEmpty(addCompany)) { final User adminByPhone = userService.getAdminByPhone(phone); diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml index 1dafe20..819882b 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml @@ -95,6 +95,12 @@ AND a.organization_id > 0 + + AND a.installed = #{param.installed} + + + AND a.template_id = #{param.templateId} + AND a.merchant_id = #{param.merchantId} diff --git a/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java b/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java index 2435835..ec2f366 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java @@ -40,6 +40,12 @@ public class LoginParam implements Serializable { @ApiModelProperty("是否超级管理员") private Boolean isSuperAdmin; + @ApiModelProperty("应用安装状态") + private Boolean installed; + + @ApiModelProperty("模板id") + private Integer templateId; + @ApiModelProperty(value = "租户id") private Integer tenantId; diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserParam.java index 28c2fce..3b7dd03 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/UserParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/UserParam.java @@ -284,4 +284,8 @@ public class UserParam extends BaseParam { @ApiModelProperty(value = "工业园区") @TableField(exist = false) private String park; + + @ApiModelProperty(value = "是否已安装") + @TableField(exist = false) + private Boolean installed; } diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java index 6416bcb..f07b08d 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java @@ -113,6 +113,9 @@ public class TenantServiceImpl extends ServiceImpl impleme superAdmin.setRealName(company.getBusinessEntity()); superAdmin.setPassword(userService.encodePassword(company.getPassword())); superAdmin.setTenantId(company.getTid()); + if(company.getTemplateId() != null){ + superAdmin.setTemplateId(company.getTemplateId()); + } boolean result = userService.save(superAdmin); Integer superAdminUserId = superAdmin.getUserId(); diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java index 7732f87..c9782c3 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java @@ -304,6 +304,9 @@ public class UserServiceImpl extends ServiceImpl implements Us userParam.setIsAdmin(true); userParam.setTenantId(param.getTenantId()); userParam.setLimit(50L); + if(param.getTemplateId() != null){ + userParam.setTemplateId(param.getTemplateId()); + } return baseMapper.selectListAllRel(userParam); }