| | |
| | | import com.fzzy.api.dto.GbCodingData; |
| | | import com.fzzy.api.dto.ReqGbCoding; |
| | | import com.fzzy.api.dto.RespGbCoding; |
| | | import com.fzzy.api.entity.ApiConfs; |
| | | import com.fzzy.api.entity.GbUnifiedCoding; |
| | | import com.fzzy.api.service.ApiCommonService; |
| | | import com.fzzy.api.view.repository.GbUnifiedCodingRep; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | @Component |
| | | public class GbUnifiedCodingPR { |
| | | |
| | | private static final String GB_CODING_URL = "http://121.36.17.6:28088/admin-api/coding/fmxx/queryDataInfo"; |
| | | private static final String GB_CODING_URL = "http://101.36.160.117:28088/admin-api/coding/fmxx/queryDataInfo"; |
| | | @Autowired |
| | | private GbUnifiedCodingRep codingRep; |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Autowired |
| | | private ApiCommonService apiCommonService; |
| | | |
| | | /** |
| | | * gbUnifiedCodingPR#pageList |
| | |
| | | return "执行失败:单位编码为空,请核查!"; |
| | | } |
| | | |
| | | String url = GB_CODING_URL; |
| | | List<ApiConfs> apiConfs = apiCommonService.listCacheConf(); |
| | | if(null != apiConfs || apiConfs.size() > 0){ |
| | | ApiConfs apiConf = apiConfs.get(0); |
| | | if(null != apiConf && StringUtils.isNotEmpty(apiConf.getGbCodingUrl())){ |
| | | url = apiConf.getGbCodingUrl(); |
| | | } |
| | | } |
| | | |
| | | //设置参数 |
| | | ReqGbCoding reqGbCoding = new ReqGbCoding(dwdm); |
| | | RespGbCoding respGbCoding = restTemplate.postForObject(GB_CODING_URL, reqGbCoding, RespGbCoding.class); |
| | | RespGbCoding respGbCoding = restTemplate.postForObject(url, reqGbCoding, RespGbCoding.class); |
| | | if(null == respGbCoding){ |
| | | return "拉取数据失败,请重试!"; |
| | | } |