|
|
@@ -2,6 +2,8 @@ package com.usoftchina.saas.commons.service.impl;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.usoftchina.saas.account.api.CompanyApi;
|
|
|
+import com.usoftchina.saas.account.dto.CompanyDTO;
|
|
|
import com.usoftchina.saas.commons.cache.ConfigsCache;
|
|
|
import com.usoftchina.saas.commons.dto.DocBaseDTO;
|
|
|
import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
@@ -13,8 +15,11 @@ import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
import com.usoftchina.saas.document.api.CurrencyApi;
|
|
|
import com.usoftchina.saas.document.dto.CurrencyDTO;
|
|
|
import com.usoftchina.saas.exception.BizException;
|
|
|
+import com.usoftchina.saas.inquiry.api.EnConfigApi;
|
|
|
+import com.usoftchina.saas.inquiry.po.enConfig.AddOrUpdateEnterpriseRequest;
|
|
|
import com.usoftchina.saas.page.PageDefault;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
+import com.usoftchina.saas.utils.http.HttpUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -35,7 +40,10 @@ public class ConfigsServiceImpl implements ConfigsService{
|
|
|
private MessageLogService messageLogService;
|
|
|
@Autowired
|
|
|
private CurrencyApi currencyApi;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private EnConfigApi enConfigApi;
|
|
|
+ @Autowired
|
|
|
+ private CompanyApi companyApi;
|
|
|
|
|
|
@Override
|
|
|
public PageInfo getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
|
|
|
@@ -113,6 +121,17 @@ public class ConfigsServiceImpl implements ConfigsService{
|
|
|
currencyApi.setStandard(currencyDTO);
|
|
|
} else if("enableB2B".equals(con.getCode())){
|
|
|
int count = configsMapper.selectByCodeAndCompanyId(con.getCode(), BaseContextHolder.getCompanyId());
|
|
|
+ //将企业信息同步给B2B,用于平台开启数据传输
|
|
|
+ if ("1".equals(con.getData())){
|
|
|
+ CompanyDTO companyDTO = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData();
|
|
|
+ enConfigApi.addOrUpdateEnterprise(new AddOrUpdateEnterpriseRequest(
|
|
|
+ companyDTO.getUu(),
|
|
|
+ companyDTO.getName(),
|
|
|
+ true,
|
|
|
+ true,
|
|
|
+ companyDTO.getAccessKey()
|
|
|
+ ));
|
|
|
+ }
|
|
|
if (count == 0){
|
|
|
//不存在,则插入
|
|
|
Configs configs = new Configs();
|