Commit 19f5f36e LN

西门子接口修改

1 个父辈 aa118821
...@@ -24,7 +24,7 @@ public class SiemensApi { ...@@ -24,7 +24,7 @@ public class SiemensApi {
String action=config.action_GetMaterialLot; String action=config.action_GetMaterialLot;
String msg="getMaterialLot ["+inoutType+"]["+storageId+"]["+storageName+"]["+materialLot+"] :"; String msg="getMaterialLot ["+inoutType+"]["+storageId+"]["+storageName+"]["+materialLot+"] :";
String soap=buildXml(action, inoutType,storageId,storageName,materialLot); String soap=buildGetLotXml(action, inoutType,storageId,storageName,materialLot);
// //XML测试 // //XML测试
...@@ -78,7 +78,7 @@ public class SiemensApi { ...@@ -78,7 +78,7 @@ public class SiemensApi {
} }
String action=config.action_ProcessMaterialLot; String action=config.action_ProcessMaterialLot;
String msg="processMaterialLot ["+inoutType+"]["+storageId+"]["+storageName+"]["+materialLot+"] :"; String msg="processMaterialLot ["+inoutType+"]["+storageId+"]["+storageName+"]["+materialLot+"] :";
String soap=buildXml(action, inoutType,storageId,storageName,materialLot); String soap=buildProcessXml(action, inoutType,storageId,storageName,materialLot);
String returnData= WSClientUtil.sendSoap(config.host,config.GetPort(), config.url,soap); String returnData= WSClientUtil.sendSoap(config.host,config.GetPort(), config.url,soap);
if(ObjectUtil.isEmpty(returnData)){ if(ObjectUtil.isEmpty(returnData)){
log.error(msg+"未收到结果"); log.error(msg+"未收到结果");
...@@ -124,8 +124,98 @@ public class SiemensApi { ...@@ -124,8 +124,98 @@ public class SiemensApi {
//    EquipmentID为Tower设备的编号(每台Tower不一样) //料仓名称 //    EquipmentID为Tower设备的编号(每台Tower不一样) //料仓名称
} }
private static String buildGetLotXml(String actionCode,int inoutType,String storageId,String storageName,String materialLot ){
private static String buildXml(String actionCode,int inoutType,String storageId,String storageName,String materialLot ){ //1=入库,2=出库
String inoutTypeStr="Charge";
if(inoutType==2){
inoutTypeStr="DisCharge";
}
// <?xml version="1.0"?>
// -<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
// -<s:Header>
//<a:Action s:mustUnderstand="1">http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot</a:Action>
//<a:MessageID>urn:uuid:b8c29254-908b-4de5-ba48-380b98e92917</a:MessageID>
// -<a:ReplyTo>
//<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
//</a:ReplyTo>
//<CallerId xmlns="http://siplace.com/facts">7edb7be7-61ba-4195-8dd7-d14272dca591</CallerId>
//<CallerName xmlns="http://siplace.com/facts">Rojonic</CallerName>
//<Signature xmlns="http://siplace.com/facts">62C28B8F3033423c9286658A67D67674</Signature>
//<a:To s:mustUnderstand="1">http://cnctu04053.cn104.local/FactsWebServices/MaterialLot.svc</a:To>
//</s:Header>
// -<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
// -<GetMaterialLotType xmlns="http://siplace.com/facts/materiallot/2010/01" versionID="2.0.0.1642" releaseID="2.0.0.1642">
// -<ApplicationArea xmlns="http://www.wbf.org/xml/b2mml-v0400">
// -<Sender>
// -<LogicalID>
//<Value>RoyoTech</Value>
//</LogicalID>
// -<ComponentID>
//<Value>d876c072-a937-410b-9d74-cb29a98e8cbe</Value>
// </ComponentID>
//<ConfirmationCode languageID="de-DE">Always</ConfirmationCode>
//</Sender>
//<CreationDateTime>2022-05-12T10:57:09.3614178+08:00</CreationDateTime>
//</ApplicationArea>
// -<DataArea xmlns="http://www.wbf.org/xml/b2mml-v0400">
// -<Get>
//<Expression>Get</Expression>
//</Get>
// -<MaterialLot>
// -<ID>
//<Value>M05720728</Value>
//</ID>
//</MaterialLot>
//</DataArea>
//</GetMaterialLotType>
//</s:Body>
//</s:Envelope>
String soap="<?xml version=\"1.0\"?>"
+ "<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">"
+ "<s:Header>"
+ "<a:Action s:mustUnderstand=\"1\">"+actionCode+"</a:Action>"
+ "<a:MessageID>urn:uuid:9a3a1214-eb2a-4e87-a5b8-94f71e540f59</a:MessageID><a:ReplyTo>"
+ "<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>"
+ "</a:ReplyTo>"
+ "<CallerId xmlns=\"http://siplace.com/facts\">8100449b-4b84-450b-aaab-48a419b13787</CallerId>"
+ "<CallerName xmlns=\"http://siplace.com/facts\">Rojonic</CallerName>"
+ "<Signature xmlns=\"http://siplace.com/facts\">62C28B8F3033423c9286658A67D67674</Signature>"
+ "<a:To s:mustUnderstand=\"1\">"+config.url+"</a:To>"
// + "<a:To s:mustUnderstand=\"1\">http://cnctu04053.cn104.local/FactsWebServices/MaterialLot.svc</a:To>"
+ "</s:Header>"
+ "<s:Body xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+ "<GetMaterialLotType xmlns=\"http://siplace.com/facts/materiallot/2010/01\" versionID=\"2.0.0.1642\" releaseID=\"2.0.0.1642\">"
+ "<ApplicationArea xmlns=\"http://www.wbf.org/xml/b2mml-v0400\">"
+"<Sender>"
+"<LogicalID>"
+"<Value>"+storageName+"</Value>"
+"</LogicalID>"
+"<ComponentID>"
+"<Value>"+storageId+"</Value>"
+"</ComponentID>"
+"<ConfirmationCode languageID=\"de-DE\">Always</ConfirmationCode>"
+"</Sender>"
+"<CreationDateTime>2022-01-27T17:13:30.2032951+08:00</CreationDateTime>"
+"</ApplicationArea>"
+"<DataArea xmlns=\"http://www.wbf.org/xml/b2mml-v0400\">"
+"<Get>"
+"<Expression>Get</Expression>"
+"</Get>"
+"<MaterialLot>"
+"<ID>"
+"<Value>"+materialLot+"</Value>"
+"</ID>"
+"</MaterialLot>"
+"</DataArea>"
+"</GetMaterialLotType>"
+"</s:Body>"
+"</s:Envelope>";
return soap;
}
private static String buildProcessXml(String actionCode,int inoutType,String storageId,String storageName,String materialLot ){
//1=入库,2=出库 //1=入库,2=出库
String inoutTypeStr="Charge"; String inoutTypeStr="Charge";
......
...@@ -41,11 +41,11 @@ public class SiemensConfig { ...@@ -41,11 +41,11 @@ public class SiemensConfig {
@PostConstruct @PostConstruct
public void init() { public void init() {
host = dataCache.GetConfigCache("siemens.host", "siemens.host", url); // host = dataCache.GetConfigCache("siemens.host", "siemens.host", url);
port = dataCache.GetConfigCache("siemens.port", "siemens.port", url); // port = dataCache.GetConfigCache("siemens.port", "siemens.port", url);
url = dataCache.GetConfigCache("siemens.url", "siemens.url", url); // url = dataCache.GetConfigCache("siemens.url", "siemens.url", url);
action_GetMaterialLot = dataCache.GetConfigCache("siemens.action.GetMaterialLot", "siemens.action.GetMaterialLot", action_GetMaterialLot); // action_GetMaterialLot = dataCache.GetConfigCache("siemens.action.GetMaterialLot", "siemens.action.GetMaterialLot", action_GetMaterialLot);
action_ProcessMaterialLot = dataCache.GetConfigCache("siemens.action.ProcessMaterialLot", "siemens.action.ProcessMaterialLot", action_ProcessMaterialLot); // action_ProcessMaterialLot = dataCache.GetConfigCache("siemens.action.ProcessMaterialLot", "siemens.action.ProcessMaterialLot", action_ProcessMaterialLot);
log.info("siemens服务器rul:" + url + ",GetMaterialLot=" + action_GetMaterialLot + ",ProcessMaterialLot=" + action_ProcessMaterialLot); log.info("siemens服务器rul:" + url + ",GetMaterialLot=" + action_GetMaterialLot + ",ProcessMaterialLot=" + action_ProcessMaterialLot);
......
...@@ -8,7 +8,7 @@ hella: ...@@ -8,7 +8,7 @@ hella:
siemens: siemens:
host: "127.0.0.1" host: "127.0.0.1"
port: 3333 port: 3333
# url: "http://cnctu041p059.cn104.local/Production/WebServices/MaterialLot.svc" # url: "http://cnctu041p059.cn104.local/Production/WebServices/MaterialLot.svc"
action: action:
GetMaterialLot: "http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot" GetMaterialLot: "http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot"
ProcessMaterialLot: "http://siplace.com/facts/materiallot/2010/01/MaterialLot/ProcessMaterialLot" ProcessMaterialLot: "http://siplace.com/facts/materiallot/2010/01/MaterialLot/ProcessMaterialLot"
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!