Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 19f5f36e
由
LN
编写于
2022-05-13 11:56:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
西门子接口修改
1 个父辈
aa118821
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
99 行增加
和
9 行删除
src/main/java/com/neotel/smfcore/siemens/SiemensApi.java
src/main/java/com/neotel/smfcore/siemens/SiemensConfig.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/siemens/SiemensApi.java
查看文件 @
19f5f36
...
...
@@ -24,7 +24,7 @@ public class SiemensApi {
String
action
=
config
.
action_GetMaterialLot
;
String
msg
=
"getMaterialLot ["
+
inoutType
+
"]["
+
storageId
+
"]["
+
storageName
+
"]["
+
materialLot
+
"] :"
;
String
soap
=
buildXml
(
action
,
inoutType
,
storageId
,
storageName
,
materialLot
);
String
soap
=
build
GetLot
Xml
(
action
,
inoutType
,
storageId
,
storageName
,
materialLot
);
// //XML测试
...
...
@@ -78,7 +78,7 @@ public class SiemensApi {
}
String
action
=
config
.
action_ProcessMaterialLot
;
String
msg
=
"processMaterialLot ["
+
inoutType
+
"]["
+
storageId
+
"]["
+
storageName
+
"]["
+
materialLot
+
"] :"
;
String
soap
=
buildXml
(
action
,
inoutType
,
storageId
,
storageName
,
materialLot
);
String
soap
=
build
Process
Xml
(
action
,
inoutType
,
storageId
,
storageName
,
materialLot
);
String
returnData
=
WSClientUtil
.
sendSoap
(
config
.
host
,
config
.
GetPort
(),
config
.
url
,
soap
);
if
(
ObjectUtil
.
isEmpty
(
returnData
)){
log
.
error
(
msg
+
"未收到结果"
);
...
...
@@ -124,8 +124,98 @@ public class SiemensApi {
// 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=出库
String
inoutTypeStr
=
"Charge"
;
...
...
src/main/java/com/neotel/smfcore/siemens/SiemensConfig.java
查看文件 @
19f5f36
...
...
@@ -41,11 +41,11 @@ public class SiemensConfig {
@PostConstruct
public
void
init
()
{
host
=
dataCache
.
GetConfigCache
(
"siemens.host"
,
"siemens.host"
,
url
);
port
=
dataCache
.
GetConfigCache
(
"siemens.port"
,
"siemens.port"
,
url
);
url
=
dataCache
.
GetConfigCache
(
"siemens.url"
,
"siemens.url"
,
url
);
action_GetMaterialLot
=
dataCache
.
GetConfigCache
(
"siemens.action.GetMaterialLot"
,
"siemens.action.GetMaterialLot"
,
action_GetMaterialLot
);
action_ProcessMaterialLot
=
dataCache
.
GetConfigCache
(
"siemens.action.ProcessMaterialLot"
,
"siemens.action.ProcessMaterialLot"
,
action_ProcessMaterialLot
);
//
host = dataCache.GetConfigCache("siemens.host", "siemens.host", url);
//
port = dataCache.GetConfigCache("siemens.port", "siemens.port", url);
//
url = dataCache.GetConfigCache("siemens.url", "siemens.url", url);
//
action_GetMaterialLot = dataCache.GetConfigCache("siemens.action.GetMaterialLot", "siemens.action.GetMaterialLot", action_GetMaterialLot);
//
action_ProcessMaterialLot = dataCache.GetConfigCache("siemens.action.ProcessMaterialLot", "siemens.action.ProcessMaterialLot", action_ProcessMaterialLot);
log
.
info
(
"siemens服务器rul:"
+
url
+
",GetMaterialLot="
+
action_GetMaterialLot
+
",ProcessMaterialLot="
+
action_ProcessMaterialLot
);
...
...
src/main/resources/config/application.yml
查看文件 @
19f5f36
...
...
@@ -8,7 +8,7 @@ hella:
siemens
:
host
:
"
127.0.0.1"
port
:
3333
#
url: "http://cnctu041p059.cn104.local/Production/WebServices/MaterialLot.svc"
#
url: "http://cnctu041p059.cn104.local/Production/WebServices/MaterialLot.svc"
action
:
GetMaterialLot
:
"
http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot"
ProcessMaterialLot
:
"
http://siplace.com/facts/materiallot/2010/01/MaterialLot/ProcessMaterialLot"
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论