| | |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.persistence.criteria.CriteriaBuilder; |
| | | import javax.persistence.criteria.CriteriaQuery; |
| | | import javax.persistence.criteria.Predicate; |
| | |
| | | @Component |
| | | public class GbUnifiedCodingPR { |
| | | |
| | | private static final String GB_CODING_URL = "http://101.36.160.117:28088/admin-api/coding/fmxx/queryDataInfo"; |
| | | private static final String GB_CODING_URL = "http://121.36.17.6:28088/admin-api/coding/fmxx/queryDataInfo"; |
| | | @Autowired |
| | | private GbUnifiedCodingRep codingRep; |
| | | @Autowired |
| | |
| | | } |
| | | str = (String) param.get("cfmc"); |
| | | if (StringUtils.isNotBlank(str)) { |
| | | Predicate predicate2 = cb.equal(root.get("cfmc"),str); |
| | | Predicate predicate2 = cb.equal(root.get("cfmc"), str); |
| | | predicates.add(predicate2); |
| | | } |
| | | str = (String) param.get("kqmc"); |
| | | if (StringUtils.isNotBlank(str)) { |
| | | Predicate predicate3 = cb.equal(root.get("kqmc"),str); |
| | | Predicate predicate3 = cb.equal(root.get("kqmc"), str); |
| | | predicates.add(predicate3); |
| | | } |
| | | return cb.and(predicates.toArray(new Predicate[0])); |
| | |
| | | |
| | | String url = GB_CODING_URL; |
| | | List<ApiConfs> apiConfs = apiCommonService.listCacheConf(); |
| | | if(null != apiConfs || apiConfs.size() > 0){ |
| | | if (null != apiConfs || apiConfs.size() > 0) { |
| | | ApiConfs apiConf = apiConfs.get(0); |
| | | if(null != apiConf && StringUtils.isNotEmpty(apiConf.getGbCodingUrl())){ |
| | | if (null != apiConf && StringUtils.isNotEmpty(apiConf.getGbCodingUrl())) { |
| | | url = apiConf.getGbCodingUrl(); |
| | | } |
| | | } |
| | |
| | | //设置参数 |
| | | ReqGbCoding reqGbCoding = new ReqGbCoding(dwdm); |
| | | RespGbCoding respGbCoding = restTemplate.postForObject(url, reqGbCoding, RespGbCoding.class); |
| | | if(null == respGbCoding){ |
| | | if (null == respGbCoding) { |
| | | return "拉取数据失败,请重试!"; |
| | | } |
| | | if(!"0".equals(respGbCoding.getCode())){ |
| | | if (!"0".equals(respGbCoding.getCode())) { |
| | | return respGbCoding.getMsg(); |
| | | } |
| | | GbCodingData data = JSONObject.parseObject(JSONObject.toJSONString(respGbCoding.getData()), GbCodingData.class); |
| | | if(null == data || data.getList().isEmpty()){ |
| | | if (null == data || data.getList().isEmpty()) { |
| | | return "拉取数据为空,请重试!"; |
| | | } |
| | | for (GbUnifiedCoding gbUnifiedCoding : data.getList()) { |