Commit 2e2992fe authored by zhangyingbin's avatar zhangyingbin

修改工商信息接口

parent 46bd5f09
...@@ -82,6 +82,26 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc ...@@ -82,6 +82,26 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
result.put("approval_time", data.get("hzrq")); result.put("approval_time", data.get("hzrq"));
//经营状态 //经营状态
result.put("operating_status", data.get("opstate")); result.put("operating_status", data.get("opstate"));
//统一社会信用代码
result.put("creditCode",data.get("uniscid"));
//企业名称
result.put("unitName",data.get("entname"));
//经营范围
result.put("businessScope",data.get("opscope"));
//注册资金(数字,万元)
result.put("regcap",data.get("regcap"));
//成立日期
result.put("estdate",data.get("estdate"));
//营业期限(yyyy-mm-dd)
result.put("operatingPeriod",data.get("yyqx"));
//生产经营地址
result.put("oploc",data.get("oploc"));
//登记注册类型中文描述
result.put("enttype",data.get("enttype"));
//法定代表人姓名
result.put("legalPeople",data.get("lerep"));
//行业小类编码
result.put("",data.get("hydm"));
} else { } else {
System.out.println("失败:" + response.getErrorMsg()); System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode()); System.out.println("失败:" + response.getErrorCode());
......
...@@ -37,6 +37,8 @@ eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet ...@@ -37,6 +37,8 @@ eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address=localhost
eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
##emqx ##emqx
emqx.clean-session=true emqx.clean-session=true
......
package com.yeejoin.amos.boot.module.tzs.flc.api.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
//@FeignClient(url="http://172.16.3.34:11005",name = "AMOS-API-ACCESSAPI-ZYB", path = "/accessapi" )
@FeignClient(name = "AMOS-API-ACCESSAPI-ZYB", path = "/accessapi" )
public interface AccessFeignService {
/**
* 调用accessApi的接口
* @param code
* @return
*/
@RequestMapping("/business/getData")
ResponseModel<Map<String, Object>> getData(@RequestParam String code);
}
...@@ -13,6 +13,7 @@ import java.util.Map; ...@@ -13,6 +13,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.tzs.flc.api.feign.AccessFeignService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -81,6 +82,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -81,6 +82,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired @Autowired
RestTemplate restTemplate; RestTemplate restTemplate;
@Autowired
AccessFeignService accessFeignService;
/** /**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232 * 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/ */
...@@ -220,17 +224,32 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -220,17 +224,32 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
if (regUnitIc == null) { if (regUnitIc == null) {
// 2.1 使用单位调用行政许可系统接口进行查询工商信息 // 2.1 使用单位调用行政许可系统接口进行查询工商信息
// MultiValueMap<String, String> headers = new HttpHeaders(); // MultiValueMap<String, String> headers = new HttpHeaders();
// headers.add("header-1","v1"); // headers.add("product","AMOS_STUDIO_WEB");
// headers.add("header-2","v2"); // headers.add("appKey","AMOS_STUDIO");
// headers.add("token",token);
// RequestContext.setToken();
// RequestContext.setAppKey();
// RequestContext.setProduct();
Map<String, Object> resultMap = accessFeignService.getData(unitCode).getResult();
// RequestEntity requestEntity = new RequestEntity( // RequestEntity requestEntity = new RequestEntity(
// null, //body部分数据 // null, //body部分数据
// headers, //头 // headers, //头
// HttpMethod.GET,//请求方法 // HttpMethod.GET,//请求方法
// URI.create("url")); // URI.create("/accessapi/business/getData"));
// ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(requestEntity,JSONObject.class); // ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(requestEntity,JSONObject.class);
// JSONObject result = responseEntity.getBody(); // JSONObject result = responseEntity.getBody();
// 2.2 工商信息组装 // 2.2 工商信息组装
// regUnitInfoDto.setRegUnitIc(); String area = String.valueOf(resultMap.get("area"));
String city = area.substring(0,area.indexOf("市")+1);
String district = area.substring(city.length());
regUnitInfoDto.setCity(city);
regUnitInfoDto.setDistrict(district);
regUnitInfoDto.setStree(String.valueOf(resultMap.get("street")));
regUnitInfoDto.setCommunity(String.valueOf(resultMap.get("community")));
regUnitInfoDto.setAddress(String.valueOf(resultMap.get("address")));
regUnitInfoDto.setUnitCode(String.valueOf(resultMap.get("creditCode")));
regUnitInfoDto.setName(String.valueOf(resultMap.get("unitName")));
regUnitInfoDto.setLegalPerson(String.valueOf(resultMap.get("legalPeople")));
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment