|
|
@@ -241,13 +241,14 @@ public class SERESServiceImpl implements SERESService {
|
|
|
String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3ODQwMTIzOTAsImlhdCI6MTc4NDAxMjM5MSwiaXNzIjoiMDAwMDAwMjQ0Ni1KVFRLSE9ONCIsImV4cCI6MTc4NDAxNTk4OS45NjN9.7hYCWCM22BJU6aNQfE2klllaTRwVnanBX-Tozt49WVg";
|
|
|
String apiPath="/aito/DIS/INV_STOCK_STS/1.0.0";
|
|
|
String fullUrl = seresConfig.getUrl() + apiPath;
|
|
|
- System.out.println(fullUrl);
|
|
|
+ logger.info("fullUrl {}",fullUrl);
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
HttpPost httpPost = new HttpPost(fullUrl);
|
|
|
// 鉴权头
|
|
|
httpPost.setHeader("Authorization", "Bearer " + token);
|
|
|
httpPost.setHeader("Content-Type", "application/json");
|
|
|
httpPost.setHeader("SupplierCode", seresConfig.getClientCode());
|
|
|
+ logger.info("SupplierCode {}", seresConfig.getClientCode());
|
|
|
JSONObject reqBody = new JSONObject();
|
|
|
//供应商编码
|
|
|
reqBody.put("SupplierCode", seresConfig.getClientCode());
|
|
|
@@ -262,12 +263,16 @@ public class SERESServiceImpl implements SERESService {
|
|
|
if (reqBody != null) {
|
|
|
StringEntity entity = new StringEntity(JSON.toJSONString(reqBody), "UTF-8");
|
|
|
httpPost.setEntity(entity);
|
|
|
+
|
|
|
+ logger.info("reqBody {}", JSON.toJSONString(reqBody));
|
|
|
}
|
|
|
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
|
|
+ logger.info("resp {}", response.getEntity());
|
|
|
String respStr = EntityUtils.toString(response.getEntity(), "UTF-8");
|
|
|
logger.info("respStr {}", respStr);
|
|
|
return JSON.parseObject(respStr);
|
|
|
}catch (Exception e){
|
|
|
+ logger.info("Exception {}",e.getMessage());
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
httpClient.close();
|