Commit cdf92d2c LN

1

1 个父辈 14a0f64e
...@@ -181,20 +181,6 @@ public class HttpHelper { ...@@ -181,20 +181,6 @@ public class HttpHelper {
throw new ApiException("smfcore.api.error","Request params to [" + url + "] json exception:" + e.getMessage()); throw new ApiException("smfcore.api.error","Request params to [" + url + "] json exception:" + e.getMessage());
} }
} }
// try {
// CloseableHttpClient httpClient = HttpClients.createDefault();
// CloseableHttpResponse response = httpClient.execute(httpPost);
// HttpEntity entity = response.getEntity();
// String responseContent = EntityUtils.toString(entity, CONTENT_CHARSET);
// response.close();
// httpClient.close();
//
// log.info("postJsonWithAuth url=["+url+"] return= ["+responseContent+"]");
// return responseContent;
// } catch (Exception e) {
// log.error("Request to [" + url + "] failed:" + e.getMessage());
// throw new ApiException("Request to [" + url + "] failed:" + e.getMessage());
// }
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
try (CloseableHttpClient httpClient = httpClientBuilder.setSSLSocketFactory(getSslConnectionSocketFactory()).build()) { try (CloseableHttpClient httpClient = httpClientBuilder.setSSLSocketFactory(getSslConnectionSocketFactory()).build()) {
......
...@@ -724,14 +724,14 @@ public class Micron20031Api { ...@@ -724,14 +724,14 @@ public class Micron20031Api {
dataMap.put("SystemID","SPMMS"); dataMap.put("SystemID","SPMMS");
dataMap.put("MaterialType",MATERIAL_TYPE); dataMap.put("MaterialType",MATERIAL_TYPE);
log.info("调用MES接口 ReturnMaterial,参数:"+JsonUtil.toJsonStr(dataMap)); log.info("调用MES接口 ReturnMaterial type="+typeOfReturn+",参数:"+JsonUtil.toJsonStr(dataMap));
String resultStr = HttpHelper.postJsonWithAuth(checkStockAvailableUrl, dataMap, auth); String resultStr = HttpHelper.postJsonWithAuth(checkStockAvailableUrl, dataMap, auth);
log.info("调用MES接口 ReturnMaterial 返回:" + resultStr); log.info("调用MES接口 ReturnMaterial type="+typeOfReturn+", 返回:" + resultStr);
if(ObjectUtil.isEmpty(resultStr)) { if(ObjectUtil.isEmpty(resultStr)) {
log.info("调用MES接口 ReturnMaterial 返回:" + resultStr + " ,返回数据为空,return null "); log.info("调用MES接口 ReturnMaterial type="+typeOfReturn+", 返回:" + resultStr + " ,返回数据为空,return null ");
throw new ApiException("smfcore.api.returnNoData", "ReturnMaterial Failed to get data", new String[]{"ReturnMaterial"}); throw new ApiException("smfcore.api.returnNoData", "ReturnMaterial Failed to get data", new String[]{"ReturnMaterial"});
} }
log.info("调用MES接口 ReturnMaterial 返回:" + resultStr); log.info("调用MES接口 ReturnMaterial type="+typeOfReturn+", 返回:" + resultStr);
String expiredDateStr = getResult(resultStr,"ExpiredDate"); String expiredDateStr = getResult(resultStr,"ExpiredDate");
if(ObjectUtil.isNotEmpty(expiredDateStr)) { if(ObjectUtil.isNotEmpty(expiredDateStr)) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!