rev:修改出入库操作逻辑
This commit is contained in:
3
lms/.idea/inspectionProfiles/Project_Default.xml
generated
3
lms/.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,6 +1,9 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,cn.hutool.http.HttpRequest,execute" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -262,7 +262,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
for (EasOutInBillDto bill : bills) {
|
||||
try {
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
wmsToSrmService.sendWebService(billJson);
|
||||
wmsToSrmService.sendWebPostData(billJson);
|
||||
easOutInBillMapper.update(null, new UpdateWrapper<EasOutInBill>().set("djzt", "提交").eq("djid", bill.getBillId()));
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user