优化:templateId字段,登录区分是哪个产品

This commit is contained in:
2025-03-03 09:35:20 +08:00
parent 855ed7a20e
commit 2ac2b88a96
7 changed files with 28 additions and 1 deletions

View File

@@ -44,7 +44,6 @@ public class MybatisPlusConfig {
// 从请求头拿ID // 从请求头拿ID
tenantId = request.getHeader("tenantId"); tenantId = request.getHeader("tenantId");
if(tenantId != null){ if(tenantId != null){
System.out.println("从请求头拿ID = " + tenantId);
return new LongValue(tenantId); return new LongValue(tenantId);
} }
// 从域名拿ID // 从域名拿ID

View File

@@ -715,6 +715,9 @@ public class MainController extends BaseController {
if(user.getAddress() != null){ if(user.getAddress() != null){
userParam.setAddress(user.getAddress()); userParam.setAddress(user.getAddress());
} }
if(user.getTemplateId() != null){
userParam.setTemplateId(user.getTemplateId());
}
if (!isAdmin) { if (!isAdmin) {
// 短信验证 // 短信验证
@@ -773,6 +776,9 @@ public class MainController extends BaseController {
company.setIndustryParent(user.getIndustryParent()); company.setIndustryParent(user.getIndustryParent());
company.setIndustryChild(user.getIndustryChild()); company.setIndustryChild(user.getIndustryChild());
} }
if(user.getTemplateId() != null){
company.setTemplateId(user.getTemplateId());
}
final Company addCompany = tenantService.initialization(company); final Company addCompany = tenantService.initialization(company);
if (ObjectUtil.isNotEmpty(addCompany)) { if (ObjectUtil.isNotEmpty(addCompany)) {
final User adminByPhone = userService.getAdminByPhone(phone); final User adminByPhone = userService.getAdminByPhone(phone);

View File

@@ -95,6 +95,12 @@
<if test="param.isStaff != null"> <if test="param.isStaff != null">
AND a.organization_id > 0 AND a.organization_id > 0
</if> </if>
<if test="param.installed != null">
AND a.installed = #{param.installed}
</if>
<if test="param.templateId != null">
AND a.template_id = #{param.templateId}
</if>
<if test="param.merchantId != null"> <if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId} AND a.merchant_id = #{param.merchantId}
</if> </if>

View File

@@ -40,6 +40,12 @@ public class LoginParam implements Serializable {
@ApiModelProperty("是否超级管理员") @ApiModelProperty("是否超级管理员")
private Boolean isSuperAdmin; private Boolean isSuperAdmin;
@ApiModelProperty("应用安装状态")
private Boolean installed;
@ApiModelProperty("模板id")
private Integer templateId;
@ApiModelProperty(value = "租户id") @ApiModelProperty(value = "租户id")
private Integer tenantId; private Integer tenantId;

View File

@@ -284,4 +284,8 @@ public class UserParam extends BaseParam {
@ApiModelProperty(value = "工业园区") @ApiModelProperty(value = "工业园区")
@TableField(exist = false) @TableField(exist = false)
private String park; private String park;
@ApiModelProperty(value = "是否已安装")
@TableField(exist = false)
private Boolean installed;
} }

View File

@@ -113,6 +113,9 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> impleme
superAdmin.setRealName(company.getBusinessEntity()); superAdmin.setRealName(company.getBusinessEntity());
superAdmin.setPassword(userService.encodePassword(company.getPassword())); superAdmin.setPassword(userService.encodePassword(company.getPassword()));
superAdmin.setTenantId(company.getTid()); superAdmin.setTenantId(company.getTid());
if(company.getTemplateId() != null){
superAdmin.setTemplateId(company.getTemplateId());
}
boolean result = userService.save(superAdmin); boolean result = userService.save(superAdmin);
Integer superAdminUserId = superAdmin.getUserId(); Integer superAdminUserId = superAdmin.getUserId();

View File

@@ -304,6 +304,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
userParam.setIsAdmin(true); userParam.setIsAdmin(true);
userParam.setTenantId(param.getTenantId()); userParam.setTenantId(param.getTenantId());
userParam.setLimit(50L); userParam.setLimit(50L);
if(param.getTemplateId() != null){
userParam.setTemplateId(param.getTemplateId());
}
return baseMapper.selectListAllRel(userParam); return baseMapper.selectListAllRel(userParam);
} }