| | |
| | | String records = httpClientResult.getContent(); |
| | | records = records.replaceAll("\\p{Z}", ""); |
| | | JSONObject jsonObj = JSON.parseObject(records); |
| | | |
| | | records = jsonObj.getString("records"); |
| | | records = records.replaceAll("attri2","unitName"); |
| | | records = records.replaceAll("brand","supplierName"); |
| | |
| | | String uuid = UUID.randomUUID().toString(); |
| | | try { |
| | | //数据分发 |
| | | httpClientResult = MdmApiUtils.doPostJson(address, jsonParam); |
| | | if("MES系统".equals(sysName)){ |
| | | //处理json为MES系统想要的格式 |
| | | jsonParam=MdmApiUtils.getMesJson(jsonParam); |
| | | //拼接webservice |
| | | String xmlStr=MdmApiUtils.getMesSoapBody(jsonParam); |
| | | //请求webservice |
| | | httpClientResult = MdmApiUtils.doPostXmlJson(address, xmlStr); |
| | | }else{ |
| | | httpClientResult = MdmApiUtils.doPostJson(address, jsonParam); |
| | | } |
| | | |
| | | //响应结果 |
| | | String content = httpClientResult.getContent(); |
| | | if("MES系统".equals(sysName)){ |
| | | content = MdmApiUtils.getMesResponseJson(content); |
| | | } |
| | | int code = httpClientResult.getCode(); |
| | | if(200 == code){ |
| | | //成功 |
| | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | this.saveInterfaceLog(uuid,interfaceName,address,jsonParam,"{\"batchId\":\""+uuid+"\",\"msg\":\" 接口调用网络异常!!! \"}"); |
| | | this.saveInterfaceLog(uuid,interfaceName,address,jsonParam,"{\"batchId\":\""+uuid+"\",\"msg\":\" 接口调用网络异常!!!/"+e.getMessage()+"/ \"}"); |
| | | } |
| | | |
| | | } |