From d815631fcd784ad92feca35bc9f0357c3ee65dde Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期一, 10 十一月 2025 13:15:42 +0800
Subject: [PATCH] Merge branch 'master' of http://47.95.120.53:8083/r/JC34WMS
---
Wms/Utility/Tools/HttpHelper.cs | 35 +++++++++++++++++++++++++++++------
1 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/Wms/Utility/Tools/HttpHelper.cs b/Wms/Utility/Tools/HttpHelper.cs
index 050dc00..16c9d2d 100644
--- a/Wms/Utility/Tools/HttpHelper.cs
+++ b/Wms/Utility/Tools/HttpHelper.cs
@@ -195,12 +195,12 @@
/// <param name="method"></param>
/// <param name="xmlName"></param>
/// <returns></returns>
- public static XmlDocument EncodeParsToFuMa(List<string> Pars, string method, string xmlName)
+ public static XmlDocument EncodeParsToFuMa(List<string> Pars, string method, string xmlName,string fileName)
{
try
{
XmlDocument xml = null;
- var str = $"Utility.XML.{xmlName}.xml";
+ var str = $"Utility.XML.{fileName}.xml";
//浠庤祫婧愭枃浠跺緱鍒版枃浠舵祦
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(str);
if (stream == null)
@@ -212,19 +212,42 @@
xml.Load(stream);
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xml.NameTable);
- nsmgr.AddNamespace("xsi", @"http://www.w3.org/2001/XMLSchema-instance");
+ nsmgr.AddNamespace("xsi", @"http://www.w3.org/2001/XMLSchema-instance");
+
+ // 淇敼Event鑺傜偣鐨凬ame灞炴�у��
+ string eventNodePath = "Document/Events/Event";
+ XmlNode eventNode = xml.SelectSingleNode(eventNodePath, nsmgr);
+ if (eventNode != null && eventNode.Attributes["Name"] != null)
+ {
+ eventNode.Attributes["Name"].Value = xmlName; // 淇敼涓轰紶鍏ョ殑xmlName鍙傛暟
+ }
//淇敼鍙傛暟鐨勫��
foreach (var de in Pars)
{
- string subNode = "DataList/Product/Batch";// + de.Key.ToString();
+ string subNode = "Document/Events/Event/DataField";// + de.Key.ToString();
XmlNode node = xml.SelectSingleNode(subNode, nsmgr);
if (de != null)
{
XmlNode createNode = xml.CreateNode(XmlNodeType.Element, "Data", "");
- XmlAttribute attr = xml.CreateAttribute("code");
- attr.Value = de;
+ XmlAttribute attr = xml.CreateAttribute("Code"); //绠辩爜
+ attr.Value = de.Split(",")[0];
+ createNode.Attributes.Append(attr);
+ attr = xml.CreateAttribute("CorpOrderID"); //鍗曟嵁鍙�
+ attr.Value = de.Split(",")[1];
+ createNode.Attributes.Append(attr);
+ attr = xml.CreateAttribute("Actor"); //鎿嶄綔浜�
+ attr.Value = de.Split(",")[2];
+ createNode.Attributes.Append(attr);
+ attr = xml.CreateAttribute("ActDate"); //鎿嶄綔鏃堕棿
+ attr.Value = de.Split(",")[3];
+ createNode.Attributes.Append(attr);
+ attr = xml.CreateAttribute("WrongCode"); //鏄惁閿欒鐮�
+ attr.Value = "False";
+ createNode.Attributes.Append(attr);
+ attr = xml.CreateAttribute("ToCorpID"); // 涓嬫父鏀惰揣浼佷笟缂栧彿
+ attr.Value = "";
createNode.Attributes.Append(attr);
node.AppendChild(createNode);
}
--
Gitblit v1.8.0