|
@@ -212,9 +212,11 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
|
|
|
if (StringUtils.isNotEmpty(phone)){
|
|
|
List<TenantInfo> list = tenantInfoService.lambdaQuery().eq(TenantInfo::getPhone, phone).list();
|
|
|
if (CollectionUtils.isNotEmpty(list)){
|
|
|
- oldInfo = list.get(0);
|
|
|
+ throw new BizException("手机号已经注册机构账号");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
SysUser sysUser = getOrCreateAccount(tenantInfo, oldInfo);
|
|
|
tenantInfo.setEnableFlag(true);
|
|
|
if (StringUtils.isEmpty(tenantInfo.getLogo())) {
|
|
@@ -247,11 +249,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
|
|
|
sysUser = sysUsers.get(0);
|
|
|
TenantStaff tenantStaff = tenantStaffMapper.selectByUserId(sysUser.getId());
|
|
|
if ( !ObjectUtil.isEmpty(tenantStaff) && !ObjectUtil.isEmpty(oldTenantInfo) &&
|
|
|
- !tenantStaff.getUserId().equals(oldTenantInfo.getUserId())) {
|
|
|
+ !tenantInfo.getPhone().equals(oldTenantInfo.getPhone())) {
|
|
|
throw new BizException("手机号已经注册机构账号");
|
|
|
}
|
|
|
//获取当前账户的用户类型
|
|
|
String userType = sysUser.getUserType();
|
|
|
+
|
|
|
+ if (userType.contains(SysUserType.SYSTEM.getCode())){
|
|
|
+ throw new BizException("该手机号已注册机构");
|
|
|
+ }
|
|
|
//设置默认机构类型
|
|
|
String tenantUserType = SysUserType.ORGANIZATION.getCode();
|
|
|
if (StringUtils.isEmpty(userType)) {
|