|
|
@ -15,9 +15,11 @@ import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.convert.Convert; |
|
|
import cn.hutool.core.convert.Convert; |
|
|
import cn.hutool.core.util.IdUtil; |
|
|
import cn.hutool.core.util.IdUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.zdxt.auth.dto.UserBean; |
|
|
import com.zdxt.auth.dto.UserBean; |
|
|
import com.zdxt.auth.feign.FileUploadApi; |
|
|
import com.zdxt.auth.feign.FileUploadApi; |
|
|
import com.zdxt.auth.feign.UserApi; |
|
|
import com.zdxt.auth.feign.UserApi; |
|
|
@ -424,8 +426,30 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS |
|
|
//获取路由中的cid
|
|
|
//获取路由中的cid
|
|
|
//解析路由获取企业统一信用代码
|
|
|
//解析路由获取企业统一信用代码
|
|
|
String cid = getUrlParams(url, "cid"); |
|
|
String cid = getUrlParams(url, "cid"); |
|
|
|
|
|
log.info("企业信息表中查询企业信息,统一信用代码:{}", cid); |
|
|
if(StringUtils.isNotEmpty(cid)){ |
|
|
if(StringUtils.isNotEmpty(cid)){ |
|
|
EnterpriseInformation enterpriseInformation = ssztJbxx110497Service.selectSsztJbxx110497ByCode(cid); |
|
|
//初始化对象
|
|
|
|
|
|
EnterpriseInformation enterpriseInformation = null; |
|
|
|
|
|
//查询企业表中是否存在企业信息
|
|
|
|
|
|
enterpriseInformation = enterpriseInformationMapper.selectEnterpriseInformationByNum(cid); |
|
|
|
|
|
log.info("企业信息表中查询企业信息,企业:{}", JSONObject.toJSONString(enterpriseInformation)); |
|
|
|
|
|
|
|
|
|
|
|
if(BeanUtil.isEmpty(enterpriseInformation) && |
|
|
|
|
|
StringUtils.isEmpty(enterpriseInformation.getEnterpriseNumber())){ |
|
|
|
|
|
enterpriseInformation = ssztJbxx110497Service.selectSsztJbxx110497ByCode(cid); |
|
|
|
|
|
if(BeanUtil.isNotEmpty(enterpriseInformation) && |
|
|
|
|
|
StringUtils.isNotEmpty(enterpriseInformation.getEnterpriseNumber())){ |
|
|
|
|
|
//默认ID
|
|
|
|
|
|
enterpriseInformation.setId(IdUtil.simpleUUID()); |
|
|
|
|
|
//企业表中新增
|
|
|
|
|
|
int i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation); |
|
|
|
|
|
if(i > 0){ |
|
|
|
|
|
log.info("企业信息表中新增成功,新增企业:{}", JSONObject.toJSONString(enterpriseInformation)); |
|
|
|
|
|
}else{ |
|
|
|
|
|
log.info("企业信息表中新增失败,失败企业:{}", JSONObject.toJSONString(enterpriseInformation)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
return enterpriseInformation; |
|
|
return enterpriseInformation; |
|
|
}else { |
|
|
}else { |
|
|
//爬取页面统一信用代码
|
|
|
//爬取页面统一信用代码
|
|
|
@ -532,7 +556,7 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS |
|
|
// 将查询字符串拆分为键值对
|
|
|
// 将查询字符串拆分为键值对
|
|
|
Map<String, String> queryParams = new HashMap<>(); |
|
|
Map<String, String> queryParams = new HashMap<>(); |
|
|
if (query != null) { |
|
|
if (query != null) { |
|
|
String[] pairs = query.split("&"); |
|
|
String[] pairs = query.split("&"); |
|
|
for (String pair : pairs) { |
|
|
for (String pair : pairs) { |
|
|
int idx = pair.indexOf("="); |
|
|
int idx = pair.indexOf("="); |
|
|
String key = pair.substring(0, idx); |
|
|
String key = pair.substring(0, idx); |
|
|
|