Commit 4585745a authored by zhangyingbin's avatar zhangyingbin

修改许可同步,修改许可对接企业接口

parent 365d1154
...@@ -97,7 +97,7 @@ public class BusinessController { ...@@ -97,7 +97,7 @@ public class BusinessController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = true) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getData", method = RequestMethod.GET) @RequestMapping(value = "/getData", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map") @ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
......
...@@ -12,6 +12,7 @@ import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse; ...@@ -12,6 +12,7 @@ import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse;
import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper; import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -57,7 +58,10 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc ...@@ -57,7 +58,10 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
System.out.println(response.getResult()); System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData()); JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
//如果不存在该企业 则直接返回null
if(ValidationUtil.isEmpty(data)){
return null;
}
//分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址 //分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址
String address = data.getString("dom"); String address = data.getString("dom");
String area = address.substring(0,address.indexOf("区")+1); String area = address.substring(0,address.indexOf("区")+1);
......
...@@ -169,7 +169,7 @@ public class TzBaseEnterpriseInfoController { ...@@ -169,7 +169,7 @@ public class TzBaseEnterpriseInfoController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getInfo", method = RequestMethod.GET) @RequestMapping(value = "/getInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据企业名称查询", notes = "根据企业名称查询")
public ResponseModel<TzBaseEnterpriseInfoDto> selectByUseUnit(HttpServletRequest request, String useUnit) { public ResponseModel<TzBaseEnterpriseInfoDto> selectByUseUnit(HttpServletRequest request, String useUnit) {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.selectByUseUnit(useUnit)); return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.selectByUseUnit(useUnit));
} }
......
...@@ -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.biz.utils.RedisUtil;
import com.yeejoin.amos.boot.module.tzs.flc.api.feign.AccessFeignService; 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;
...@@ -20,7 +21,9 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -20,7 +21,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -89,6 +92,14 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -89,6 +92,14 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232 * 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/ */
private static String USE_UNIT_TYPE_CODE = "1232"; private static String USE_UNIT_TYPE_CODE = "1232";
/**
* 生产单位的类型,数据来源:cb_data_dictionary code = 1230
*/
private static String PRODUCT_UNIT_TYPE_CODE = "1230";
/**
* 充装单位的类型,数据来源:cb_data_dictionary code = 1231
*/
private static String FILLING_UNIT_TYPE_CODE = "1231";
/** /**
* 单位类型,数据来源:cb_data_dictionary type = UNIT_TYPE * 单位类型,数据来源:cb_data_dictionary type = UNIT_TYPE
...@@ -216,7 +227,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -216,7 +227,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
} }
// 2.组织返回数据 // 2.组织返回数据
RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto(); RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto();
if (USE_UNIT_TYPE_CODE.equals(unitType)) { if (USE_UNIT_TYPE_CODE.equals(unitType) || PRODUCT_UNIT_TYPE_CODE.equals(unitType) || FILLING_UNIT_TYPE_CODE.equals(unitType)) {
// 本地库有的化 就不去其他系统查询 // 本地库有的化 就不去其他系统查询
RegUnitIc regUnitIc = regUnitIcService RegUnitIc regUnitIc = regUnitIcService
.getOne(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode)); .getOne(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode));
...@@ -238,20 +249,22 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -238,20 +249,22 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// URI.create("/accessapi/business/getData")); // 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 工商信息组装
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")));
}
if(!ValidationUtil.isEmpty(resultMap)){
// 2.2 工商信息组装
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 {
RegUnitIc regUnitIc = regUnitIcService RegUnitIc regUnitIc = regUnitIcService
.getOne(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode)); .getOne(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode));
......
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