|
@@ -283,6 +283,7 @@ public class TenantService extends ServiceImpl<TenantEntityMapper, Tenant> {
|
|
}
|
|
}
|
|
return tenantVOs;
|
|
return tenantVOs;
|
|
}
|
|
}
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void addByInvitation(TenantVO tenantVo) {
|
|
public void addByInvitation(TenantVO tenantVo) {
|
|
//根据邀请码查询是否存在
|
|
//根据邀请码查询是否存在
|
|
@@ -296,6 +297,7 @@ public class TenantService extends ServiceImpl<TenantEntityMapper, Tenant> {
|
|
if (invitation.getIsInvalid().equals(1)) {
|
|
if (invitation.getIsInvalid().equals(1)) {
|
|
ThrowException.throwXiaoShiException("邀请码已被使用");
|
|
ThrowException.throwXiaoShiException("邀请码已被使用");
|
|
}
|
|
}
|
|
|
|
+
|
|
tenantVo.setTenantVipType(invitation.getVipType());
|
|
tenantVo.setTenantVipType(invitation.getVipType());
|
|
tenantVo.setNumber(1);
|
|
tenantVo.setNumber(1);
|
|
tenantVo.setType(0 + "");
|
|
tenantVo.setType(0 + "");
|
|
@@ -312,7 +314,7 @@ public class TenantService extends ServiceImpl<TenantEntityMapper, Tenant> {
|
|
tenantVo.setAddress(invitation.getAddress());
|
|
tenantVo.setAddress(invitation.getAddress());
|
|
}
|
|
}
|
|
//租户id
|
|
//租户id
|
|
- Integer tenantId =invitation.getTenant();
|
|
|
|
|
|
+ Integer tenantId = invitation.getTenant();
|
|
if (tenantId != null) {
|
|
if (tenantId != null) {
|
|
//根据租户id获得租户管理员id
|
|
//根据租户id获得租户管理员id
|
|
LambdaQueryWrapper<Role> wrapper1 = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Role> wrapper1 = new LambdaQueryWrapper<>();
|
|
@@ -332,15 +334,14 @@ public class TenantService extends ServiceImpl<TenantEntityMapper, Tenant> {
|
|
.setPassword(tenantVo.getPassword())
|
|
.setPassword(tenantVo.getPassword())
|
|
.setTenant(tenantVo.getId())
|
|
.setTenant(tenantVo.getId())
|
|
.setAddType(1);
|
|
.setAddType(1);
|
|
- Personnel personnel = personnelService.addPersonnel(personnelVO1);
|
|
|
|
|
|
+ Personnel personnel = personnelService.addPersonnel(personnelVO1);
|
|
Role role = roles.get(0);
|
|
Role role = roles.get(0);
|
|
List<Integer> temrole = new ArrayList<>();
|
|
List<Integer> temrole = new ArrayList<>();
|
|
temrole.add(role.getId());
|
|
temrole.add(role.getId());
|
|
personRoleService.addAssociatePerRole(temrole, personnel.getId());
|
|
personRoleService.addAssociatePerRole(temrole, personnel.getId());
|
|
- }
|
|
|
|
- else {
|
|
|
|
- tenantId = this.addTenant(tenantVo);
|
|
|
|
- if(tenantId<0){
|
|
|
|
|
|
+ } else {
|
|
|
|
+ tenantId = this.addTenant(tenantVo);
|
|
|
|
+ if (tenantId < 0) {
|
|
ThrowException.throwXiaoShiException("人员的账号已存在");
|
|
ThrowException.throwXiaoShiException("人员的账号已存在");
|
|
}
|
|
}
|
|
//查找同公司的激活码
|
|
//查找同公司的激活码
|
|
@@ -355,7 +356,7 @@ public class TenantService extends ServiceImpl<TenantEntityMapper, Tenant> {
|
|
invitation.updateById();
|
|
invitation.updateById();
|
|
//更新所有该公司的激活码的租户id
|
|
//更新所有该公司的激活码的租户id
|
|
UpdateWrapper<Invitation> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<Invitation> updateWrapper = new UpdateWrapper<>();
|
|
- updateWrapper.eq("COMPANY_NAME",invitation.getCompanyName()).set("TENANT", tenantId);
|
|
|
|
|
|
+ updateWrapper.eq("COMPANY_NAME", invitation.getCompanyName()).set("TENANT", tenantId);
|
|
invitationService.update(null, updateWrapper);
|
|
invitationService.update(null, updateWrapper);
|
|
}
|
|
}
|
|
|
|
|