From a566334050c1259e077fa00867361ee7b3b1c09c Mon Sep 17 00:00:00 2001 From: baoge <751575283@qq.com> Date: Mon, 22 Apr 2024 21:18:00 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E4=BF=AE=E6=94=B9=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=93=8D=E4=BD=9C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionProfiles/Project_Default.xml | 3 + .../service/impl/EasOutInBillServiceImpl.java | 2 +- .../org/nl/wms/ext/srm/WmsToSrmService.java | 107 +++++++++--------- .../src/main/resources/config/application.yml | 7 +- 4 files changed, 56 insertions(+), 63 deletions(-) diff --git a/lms/.idea/inspectionProfiles/Project_Default.xml b/lms/.idea/inspectionProfiles/Project_Default.xml index 03d9549..cc79501 100644 --- a/lms/.idea/inspectionProfiles/Project_Default.xml +++ b/lms/.idea/inspectionProfiles/Project_Default.xml @@ -1,6 +1,9 @@ \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java index 059e0bc..78106e9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java @@ -262,7 +262,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl().set("djzt", "提交").eq("djid", bill.getBillId())); } catch (Exception e) { log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/srm/WmsToSrmService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/srm/WmsToSrmService.java index 785fd21..d9ad39f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/srm/WmsToSrmService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/srm/WmsToSrmService.java @@ -1,6 +1,7 @@ package org.nl.wms.ext.srm; +import cn.hutool.http.HttpRequest; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import lombok.extern.slf4j.Slf4j; @@ -28,64 +29,58 @@ public class WmsToSrmService { @Value("${srmConfig.host}") private String host; - @Value("${srmConfig.user}") - private String user; - - @Value("${srmConfig.password}") - private String password; - - @Value("${srmConfig.datacenter}") - private String datacenter; - - @Value("${srmConfig.wsdlService}") - private String wsdlService; - - @Value("${srmConfig.operationName}") - private String operationName; + public void sendWebPostData(String json) throws ServiceException, RemoteException { + com.alibaba.fastjson.JSONObject result; + String resultMsg = HttpRequest.post(host) + .body(json) + .execute().body(); + result = com.alibaba.fastjson.JSONObject.parseObject(resultMsg); + log.error("sendWebPostData接口请求成功,输出参数为:-------------------" + result.toString()); + } public void sendWebService(String json) throws ServiceException, RemoteException { - Service s = new Service(); - Call call = (Call) s.createCall(); - call.setReturnType(new QName("urn:client", "WSContext")); - //本地根据wsdl文件建立的返回对象 - call.setReturnClass(WSContext.class); - // call.setOperationName("login"); - // //登录的webservice的wsdl的地址 - // call.setTargetEndpointAddress(host + "EASLogin?wsdl"); - // call.setReturnQName(new QName("", "loginReturn")); - // //超时时间 自由配置 - // call.setTimeout(1000 * 60); - // call.setMaintainSession(true); - // //解决方案:eas - // //语言:L2 简体中文 L3 繁体中文 - // //数据库类型:0 SQL Server 1 Oracle 2 DB2 - // result = (WSContext) call.invoke(new Object[]{user, password, "eas", datacenter, "L2", 1, "BaseDB"}); - // //关键点,获取登录时返回的sessionid - // String sessionId = result.getSessionId(); - // System.out.println(sessionId); - // //登录失败抛出异常 - // if (sessionId == null) { - // log.error("sendWebService调用结果" + "login Eas Fail"); - // throw new Exception("login Eas Fail"); - // } - // call.clearOperation(); - //超时时间 自由配置 - call.setTimeout(1000 * 60); - call.setMaintainSession(true); - call.setTargetEndpointAddress(host + wsdlService + "?wsdl"); - call.setReturnQName(new QName("", "dealTaskReturn")); - //具体某个方法 - call.setOperationName(operationName); - //关键点 传sessionid - //call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com", "SessionId")); - //接口报文 - Object invoke = call.invoke(new Object[]{json}); - JSONObject jsonObject = JSON.parseObject((String) invoke); - int results = jsonObject.getIntValue("result"); - log.error("sendWebService调用:" + "调用成功!"); - log.error("sendWebService调用结果:" + invoke.toString()); - log.error("sendWebService调用结果:" + results); - System.out.println(invoke); +// Service s = new Service(); +// Call call = (Call) s.createCall(); +// call.setReturnType(new QName("urn:client", "WSContext")); +// //本地根据wsdl文件建立的返回对象 +// call.setReturnClass(WSContext.class); +// // call.setOperationName("login"); +// // //登录的webservice的wsdl的地址 +// // call.setTargetEndpointAddress(host + "EASLogin?wsdl"); +// // call.setReturnQName(new QName("", "loginReturn")); +// // //超时时间 自由配置 +// // call.setTimeout(1000 * 60); +// // call.setMaintainSession(true); +// // //解决方案:eas +// // //语言:L2 简体中文 L3 繁体中文 +// // //数据库类型:0 SQL Server 1 Oracle 2 DB2 +// // result = (WSContext) call.invoke(new Object[]{user, password, "eas", datacenter, "L2", 1, "BaseDB"}); +// // //关键点,获取登录时返回的sessionid +// // String sessionId = result.getSessionId(); +// // System.out.println(sessionId); +// // //登录失败抛出异常 +// // if (sessionId == null) { +// // log.error("sendWebService调用结果" + "login Eas Fail"); +// // throw new Exception("login Eas Fail"); +// // } +// // call.clearOperation(); +// //超时时间 自由配置 +// call.setTimeout(1000 * 60); +// call.setMaintainSession(true); +// call.setTargetEndpointAddress(host + wsdlService + "?wsdl"); +// call.setReturnQName(new QName("", "dealTaskReturn")); +// //具体某个方法 +// call.setOperationName(operationName); +// //关键点 传sessionid +// //call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com", "SessionId")); +// //接口报文 +// Object invoke = call.invoke(new Object[]{json}); +// JSONObject jsonObject = JSON.parseObject((String) invoke); +// int results = jsonObject.getIntValue("result"); +// log.error("sendWebService调用:" + "调用成功!"); +// log.error("sendWebService调用结果:" + invoke.toString()); +// log.error("sendWebService调用结果:" + results); +// System.out.println(invoke); } } \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml index e8a5e01..9b3bb0c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -199,9 +199,4 @@ easConfig: wsdlService: WSNLMESFacade operationName: dealTask srmConfig: - host: http://192.168.100.100:8080/ormrpc/services/ - user: user - password: Noble123!9 - datacenter: test - wsdlService: WSNLMESFacade - operationName: dealTask + host: http://10.10.188.30:8080/nuoli-srm/wmsBaseApi/receiveWmsInWhOrderAck