From 30c1d93a38d018b3e97bc7264815a8c2c0f58069 Mon Sep 17 00:00:00 2001 From: fang <123456> Date: Tue, 12 Nov 2024 10:14:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BE=85=E5=8A=9E=5F1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/sys/sys/midservice/utils/RequestClient.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java index 446b0a5..7d1b954 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java @@ -29,9 +29,9 @@ public class RequestClient { private String port;// 端口 private RequestClient() { - this.protocal = System.getProperty("efms.midservice.protocal"); - this.ip = System.getProperty("efms.midservice.ip"); - this.port = System.getProperty("efms.midservice.port"); + this.protocal = System.getProperty("backlog-protocal"); + this.ip = System.getProperty("backlog-ip"); + this.port = System.getProperty("backlog-port"); } /** * 获取中台服务客户端实例 @@ -59,6 +59,7 @@ public class RequestClient { if (!StringUtils.isEmpty(this.port)) { urlStr.append(":").append(this.port); } + logger.info("环境参数,protocal:"+this.protocal+",ip:"+this.ip+",this.port:"+this.port); urlStr.append(url); String responseText = null; try { @@ -87,7 +88,9 @@ public class RequestClient { urlStr.append(":").append(this.port); } urlStr.append(url);; + logger.info("保存时,环境参数,protocal:"+this.protocal+",ip:"+this.ip+",this.port:"+this.port); DynamicObject dynamicObject = BusinessDataServiceHelper.newDynamicObject("shkd_backlog"); + logger.info("保存日志表id"+dynamicObject.getPkValue()); dynamicObject.set("shkd_url",urlStr); dynamicObject.set("shkd_request",title); dynamicObject.set("shkd_request_tag",jsonMessage); From c78998b2d5eb708b824c2bd83b2be748dfe91a17 Mon Sep 17 00:00:00 2001 From: fang <123456> Date: Tue, 12 Nov 2024 13:42:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=85=E5=8A=9E=5F1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/sys/midservice/utils/RequestClient.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java index 7d1b954..2453c63 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java @@ -1,11 +1,13 @@ package shkd.sys.sys.midservice.utils; import com.alibaba.fastjson.JSON; +import com.bes.mq.org.apache.commons.codec.digest.DigestUtils; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.util.HttpClientUtils; import kd.bos.util.StringUtils; +import kd.ebg.aqap.banks.srcb.dc.services.utils.SmUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,11 +29,15 @@ public class RequestClient { private String protocal;//http private String ip;// 域名 private String port;// 端口 + private String clientKey;// clientKey + private String clientSecret_scict;// clientSecret-scict private RequestClient() { this.protocal = System.getProperty("backlog-protocal"); this.ip = System.getProperty("backlog-ip"); this.port = System.getProperty("backlog-port"); + this.clientKey= System.getProperty("clientKey-scict"); + this.clientSecret_scict= System.getProperty("clientSecret-scict"); } /** * 获取中台服务客户端实例 @@ -53,7 +59,10 @@ public class RequestClient { */ public String callService(String url, String body) { Map header = new HashMap<>(); + header.put("clientKey", this.clientKey); + header.put("sign",this.clientSecret_scict); header.put("Content-Type", "application/x-www-form-urlencoded"); + // header.put("Content-Type", "application/json; charset=utf-8"); StringBuffer urlStr = new StringBuffer(); urlStr.append(this.protocal).append("://").append(this.ip); if (!StringUtils.isEmpty(this.port)) { @@ -65,9 +74,9 @@ public class RequestClient { try { //直接POST请求 responseText = HttpClientUtils.postjson(urlStr.toString(), header, body); - logger.info(String.format("###调用接口成功,请求URL:%s,请求Header:%s,请求Body:%s,响应报文:%s", url, JSON.toJSONString(header), body, responseText)); + logger.info(String.format("###调用接口成功,请求URL:%s,请求Header:%s,请求Body:%s,响应报文:%s", urlStr, JSON.toJSONString(header), body, responseText)); } catch (IOException e) { - logger.error(String.format("###调用接口异常:%s,请求URL:%s,请求Header:%s,请求Body:%s", e.getMessage(), url, JSON.toJSONString(header), body), e); + logger.error(String.format("###调用接口异常:%s,请求URL:%s,请求Header:%s,请求Body:%s", e.getMessage(), urlStr, JSON.toJSONString(header), body), e); } return responseText; } @@ -98,6 +107,7 @@ public class RequestClient { dynamicObject.set("shkd_response",result); dynamicObject.set("shkd_status","0"); SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + logger.info("保存日志表id"+dynamicObject.getPkValue()); logger.info("###结束调用待办保存日志方法"); } /*** From e22dd6356a8f4caf840a769887bcaea7e3b30849 Mon Sep 17 00:00:00 2001 From: fang <123456> Date: Tue, 12 Nov 2024 13:49:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BE=85=E5=8A=9E=5F1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/shkd/sys/sys/midservice/utils/RequestClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java index 2453c63..414c1a8 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils/RequestClient.java @@ -59,7 +59,7 @@ public class RequestClient { */ public String callService(String url, String body) { Map header = new HashMap<>(); - header.put("clientKey", this.clientKey); + header.put("systemid", this.clientKey); header.put("sign",this.clientSecret_scict); header.put("Content-Type", "application/x-www-form-urlencoded"); // header.put("Content-Type", "application/json; charset=utf-8");