浏览代码

Merge remote-tracking branch 'origin/feature/0721-tenant' into feature/0721-tenant

yuanliang 1 年之前
父节点
当前提交
06510d9fe5

+ 4 - 8
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantInfoServiceImpl.java

@@ -385,7 +385,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
         // todo  机构冻结状态是否允许修改
         //更新或创建sysUser
         TenantInfo oldTenantInfo = this.getById(info.getId());
-        SysUser sysUser = getAccount(info, oldTenantInfo);
+        SysUser sysUser = getOrCreateAccount(info, oldTenantInfo);
 
         if (sysUser.getId() != null){
             tenantStaffMapper.update(null, Wrappers.<TenantStaff>lambdaUpdate()
@@ -400,12 +400,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
             info.setLogo(sysConfigService.findConfigValue(SysConfigConstant.TENANT_DEFAULT_HEAD));
         }
 
-        Long id;
-        if(sysUser.getId() == null){
-            id = info.getUserId();
-        } else {
-            id = sysUser.getId();
-        }
+        //判断修改手机号后所属
+
         tenantInfoMapper.update(null, Wrappers.<TenantInfo>lambdaUpdate()
                 .set(TenantInfo::getName, info.getName())
                 .set(TenantInfo::getLogo, info.getLogo())
@@ -415,7 +411,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
                 .set(TenantInfo::getRegionCode, info.getRegionCode())
                 .set(TenantInfo::getPhone, info.getPhone())
                 .set(TenantInfo::getUsername, info.getUsername())
-                .set(TenantInfo::getUserId, id)
+                .set(TenantInfo::getUserId,sysUser.getId())
                 .eq(TenantInfo::getId, info.getId())
         );
         return true;