|
|
@@ -18,6 +18,7 @@ import com.usoftchina.saas.utils.BeanMapper;
|
|
|
import com.usoftchina.saas.utils.StringUtils;
|
|
|
import com.usoftchina.sso.api.SsoUserApi;
|
|
|
import com.usoftchina.sso.api.SsoUserSpaceApi;
|
|
|
+import com.usoftchina.sso.dto.SsoResult;
|
|
|
import com.usoftchina.sso.dto.SsoUserSpace;
|
|
|
import com.usoftchina.sso.dto.SsoUserSpaceList;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -78,7 +79,11 @@ public class AccountCenterServiceImpl implements AccountCenterService {
|
|
|
companyService.bindApp(company.getId(), "trade-app");
|
|
|
//b. 同步企业信息到优软云 ——> 创建企业
|
|
|
if ("0".equals(type)) {
|
|
|
- String result = ssoUserSpaceApi.registerLogin(company.getName(), company.getBusinessCode(), Long.parseLong(accountRegDTO.getUu()));
|
|
|
+ SsoResult<SsoUserSpace> result = ssoUserSpaceApi.registerLogin(company.getName(), company.getBusinessCode(), Long.parseLong(accountRegDTO.getUu()));
|
|
|
+ if (result.isSuccess()){
|
|
|
+ SsoUserSpace ssoUserSpace = result.getContent();
|
|
|
+ companyService.updateB2BMsgByPrimaryKey(company.getId(), ssoUserSpace.getSpaceUU(), ssoUserSpace.getAccessSecret());
|
|
|
+ }
|
|
|
}
|
|
|
//c.插入 账户公司 映射
|
|
|
accountCompanyMapper.insert(accountId, company.getId());
|
|
|
@@ -145,7 +150,7 @@ public class AccountCenterServiceImpl implements AccountCenterService {
|
|
|
if (companyRspDTO.getName().equals(ssoUserSpaces.get(i).getSpaceName())){
|
|
|
//更新公司UU号
|
|
|
if (StringUtils.isEmpty(companyRspDTO.getUu())){
|
|
|
- companyService.updateUUByPrimaryKey(companyRspDTO.getId(), ssoUserSpaces.get(i).getSpaceUU());
|
|
|
+ companyService.updateB2BMsgByPrimaryKey(companyRspDTO.getId(), ssoUserSpaces.get(i).getSpaceUU(), ssoUserSpaces.get(i).getAccessSecret());
|
|
|
}
|
|
|
ssoUserSpaces.remove(ssoUserSpaces.get(i));
|
|
|
}
|