From 14afb43f684dbdc718b3d0a668967938f84aa899 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Wed, 23 Apr 2025 09:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E6=95=88=E5=A2=9E=E9=95=BF=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=92=8Capikey=E6=94=B9=E4=B8=BA=E4=BB=8Emc=E5=8F=96?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/java/shjh/jhzj7/fi/fi/utils/ApiUtils.java | 9 ++++++--- main/java/shjh/jhzj7/fi/fi/utils/SapUtils.java | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/utils/ApiUtils.java b/main/java/shjh/jhzj7/fi/fi/utils/ApiUtils.java index 207227f..9ffec53 100644 --- a/main/java/shjh/jhzj7/fi/fi/utils/ApiUtils.java +++ b/main/java/shjh/jhzj7/fi/fi/utils/ApiUtils.java @@ -10,7 +10,6 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import shjh.jhzj7.fi.fi.utils.domin.ResponseData; @@ -31,7 +30,10 @@ public class ApiUtils { static Log logger = LogFactory.getLog(ApiUtils.class); //接口地址-测试地址 - private static final String API_URL="https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send"; +// private static final String API_URL="https://hipint-stg.jahwa.com.cn:6443/gateway/HIP_ReceiveFromFM/1.0/fm/send"; + private static final String API_URL = System.getProperty("url_a");//sap相关接口地址 + + public static final String APIKey = System.getProperty("APIKey");//ESB提供的接口访问APIKey // 线程安全的HTTP客户端 private static final CloseableHttpClient HTTP_CLIENT = HttpClientBuilder.create() @@ -53,7 +55,8 @@ public class ApiUtils { public static HashMap buildHead(String interfaceId,String receiverId){ HashMap header = new HashMap<>(5); header.put("Content-Type","application/json;charset=UTF-8"); - header.put("x-Gateway-APIKey","207b5296-9866-4b4b-8146-1fea58b3c8c9"); +// header.put("x-Gateway-APIKey","207b5296-9866-4b4b-8146-1fea58b3c8c9"); + header.put("x-Gateway-APIKey",APIKey); header.put("interfaceID",interfaceId); header.put("receiverID",receiverId); return header; diff --git a/main/java/shjh/jhzj7/fi/fi/utils/SapUtils.java b/main/java/shjh/jhzj7/fi/fi/utils/SapUtils.java index 4ae7565..959d552 100644 --- a/main/java/shjh/jhzj7/fi/fi/utils/SapUtils.java +++ b/main/java/shjh/jhzj7/fi/fi/utils/SapUtils.java @@ -50,9 +50,9 @@ public class SapUtils { private static final String Apimenthod8 = "SAP应收已清收款"; private static final String interfaceID6 = "ReversalVoucher";//SAP反清账 识别被调接口并进行路由 - private static final String Apimenthod6 = "SAP反清账"; + private static final String Apimenthod6 = "SAP反清账或冲销"; private static final String interfaceID7 = "FinancialTransactionVoucher";//SAP清账 识别被调接口并进行路由 - private static final String Apimenthod7 = "SAP清账"; + private static final String Apimenthod7 = "SAP收付款或清账"; public static final String sapArUrl = url_a;//测试环境(SAP应收凭证清单) private static final String API_METHOD4 = "SAP收款凭证清账状态查询接口"; @@ -499,7 +499,7 @@ public class SapUtils { RequestConfig requestConfig = RequestConfig.custom() .setConnectTimeout(10000) // 连接超时时间,单位毫秒 .setConnectionRequestTimeout(10000) // 请求获取连接的超时时间,单位毫秒 - .setSocketTimeout(30000) // 读取超时时间,单位毫秒 + .setSocketTimeout(180000) // 读取超时时间,单位毫秒 由于获取sap数据量较大读取超时时间改为3分钟 .build(); // 创建 HttpClient 实例并应用配置