接口超时时效增长,接口地址和apikey改为从mc取数
This commit is contained in:
		
							parent
							
								
									5cc1516ac8
								
							
						
					
					
						commit
						14afb43f68
					
				|  | @ -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<String,String> buildHead(String interfaceId,String receiverId){ | ||||
|         HashMap<String,String> 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; | ||||
|  |  | |||
|  | @ -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 实例并应用配置 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue