From 4c49b591b3833a2752634355cb37b0a74923e916 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 07 十一月 2025 09:41:17 +0800
Subject: [PATCH] 开发成品出库导出上传码上放心平台xm文件
---
Pda/View/SoSetting/productOut.html | 24 ++++
Wms/Utility/Tools/HttpHelper.cs | 26 ++--
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 74 +++++++++++++-
Wms/Utility/XML/ExInfoXml.xml | 130 ++++++-------------------
HTML/views/SOSetting/ExportNotice.html | 11 ++
5 files changed, 146 insertions(+), 119 deletions(-)
diff --git a/HTML/views/SOSetting/ExportNotice.html b/HTML/views/SOSetting/ExportNotice.html
index 48495f4..0d4bdc4 100644
--- a/HTML/views/SOSetting/ExportNotice.html
+++ b/HTML/views/SOSetting/ExportNotice.html
@@ -1127,6 +1127,7 @@
}
});
var isNeedUnpack = '0'//鏄惁闇�瑕佹媶绠憋紝0锛氬惁 1锛氭槸
+ var xmlFileName="";
//鐩戝惉鏁版嵁鎿嶄綔
table.on('tool(LAY-app-content-list)', function (obj) {
var data = obj.data;
@@ -1301,6 +1302,14 @@
};
sendData(IP + "/BllSo/AddExXmlStr", param, 'post', function (res) {
console.log(res);
+ if(data.Type=="0"){
+ xmlFileName="SalesWareHouseOut_"+data.OrderCode+"_linklink";
+ }else if(data.Type=="2"){
+ xmlFileName="CheckWareHouseOut_"+data.OrderCode+"_linklink";
+ }else{
+ xmlFileName=data.OrderCode+"_linklink";
+ }
+
if (res.code == 0) { //鎴愬姛
createFile(res.data);
layer.msg("鎿嶄綔鎴愬姛锛�", {
@@ -1598,7 +1607,7 @@
function createFile(val) {
var content = val; // 鏂囦欢鍐呭
var blob = new Blob([content], { type: "text/plain;charset=utf-8" });
- var fileName = "ExInfo.xml"; // 鏂囦欢鍚�
+ var fileName = xmlFileName+".xml"; // 鏂囦欢鍚�
saveAs(blob, fileName);
}
//涓嬭浇鏂囦欢鍑芥暟
diff --git a/Pda/View/SoSetting/productOut.html b/Pda/View/SoSetting/productOut.html
index 2b109a4..8833d2a 100644
--- a/Pda/View/SoSetting/productOut.html
+++ b/Pda/View/SoSetting/productOut.html
@@ -1320,6 +1320,28 @@
});
}
+ //涓嬫媺鐗╂枡鎵规閫変腑鍚庝簨浠�
+ form.on('select(getSkuLotNo2)', function (data) {
+ if ($('#palletNo2').val() == "") {
+ layer.msg("璇疯緭鍏ユ墭鐩樻潯鐮�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ clear21();
+ clear23();
+ });
+ return
+ }
+ if ($('#skuLotNo2').val() == "") {
+ clear21();
+ clear23();
+ return
+ }
+ updateQtyList2();
+ getBar2();
+ //GetBoxInfo();
+ });
+
//鍒濆鍖栨覆鍗曟嵁鐨勮鍒掓暟閲忓拰瀹屾垚鏁伴噺
function updateQtyList2() {
clear23();
@@ -1355,7 +1377,7 @@
$('#outModel2').val(res.data.OutModel);
$('#standard2').val(res.data.Standard);
- $('#pickQty2').val(res.data.PickQty - res.data.PickedQty);
+ $('#pickQty2').val(res.data.PickQty);
$('#pickedQty2').val(res.data.PickedQty);
} else { //涓嶆垚鍔�
if ($("#planQty").val() == $("#finishQty").val() || $('#pickQty').val() == $('#pickedQty').val()) {
diff --git a/Wms/Utility/Tools/HttpHelper.cs b/Wms/Utility/Tools/HttpHelper.cs
index 1614f8c..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,12 +212,20 @@
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/Events/Event/Relation/Batch";// + de.Key.ToString();
+ string subNode = "Document/Events/Event/DataField";// + de.Key.ToString();
XmlNode node = xml.SelectSingleNode(subNode, nsmgr);
if (de != null)
@@ -235,17 +243,11 @@
attr = xml.CreateAttribute("ActDate"); //鎿嶄綔鏃堕棿
attr.Value = de.Split(",")[3];
createNode.Attributes.Append(attr);
- attr = xml.CreateAttribute("DisCorpID"); //杩愯緭浼佷笟
- attr.Value = "";
- createNode.Attributes.Append(attr);
- attr = xml.CreateAttribute("AssCorpID"); //濮旀墭浼佷笟
- attr.Value = "";
+ attr = xml.CreateAttribute("WrongCode"); //鏄惁閿欒鐮�
+ attr.Value = "False";
createNode.Attributes.Append(attr);
attr = xml.CreateAttribute("ToCorpID"); // 涓嬫父鏀惰揣浼佷笟缂栧彿
attr.Value = "";
- createNode.Attributes.Append(attr);
- attr = xml.CreateAttribute("FromPerson");//鍙戣揣浜�
- attr.Value = ""; //de.Split(",")[2]
createNode.Attributes.Append(attr);
node.AppendChild(createNode);
}
diff --git a/Wms/Utility/XML/ExInfoXml.xml b/Wms/Utility/XML/ExInfoXml.xml
index 4a5b6b3..065b233 100644
--- a/Wms/Utility/XML/ExInfoXml.xml
+++ b/Wms/Utility/XML/ExInfoXml.xml
@@ -1,100 +1,34 @@
-锘�
-<DataList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="鍏宠仈鍏崇郴XML Schema-3.0.xsd" License="">
- <Events version="3.0">
- <Event name="RelationCreate">
- <Relation productCode="9227834" subTypeNo="9227834001" cascade="1:8:80" packageSpec="鐩�1鏀�" comment="">
- <Batch batchNo="4202506237" madeDate="2025-06-05" validateDate="2028-06-04" workshop="1002杞﹂棿" lineName="鑷姩绾�" lineManager="璧�">
- <!--<Code curCode="87069080001788999534" packLayer="3" parentCode="" flag="0"/>
- <Code curCode="87069090015932071630" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148372924155" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148372684374" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148372441040" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148370761719" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148371009170" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148371243667" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148371481519" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148371726602" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148371962746" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="83057920148372200959" packLayer="1" parentCode="87069090015932071630" flag="0"/>
- <Code curCode="87069090015932115065" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148368842018" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148369084666" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148369326241" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148369562000" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148369801304" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148370045482" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148370284324" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148370528448" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148368600956" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="83057920148368363066" packLayer="1" parentCode="87069090015932115065" flag="0"/>
- <Code curCode="87069090015932154162" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148368124892" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148367880401" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148365962203" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148366207259" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148366440713" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148366684405" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148366920612" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148367161006" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148367402706" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="83057920148367647629" packLayer="1" parentCode="87069090015932154162" flag="0"/>
- <Code curCode="87069090015932238090" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148363561861" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148363808974" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148364044168" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148364281458" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148364520482" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148364767590" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148365004077" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148365245110" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148365489268" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="83057920148365726586" packLayer="1" parentCode="87069090015932238090" flag="0"/>
- <Code curCode="87069090015932033782" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148373401736" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148373648671" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148373882492" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148374121088" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148374369286" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148374604933" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148373169131" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148374848657" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148375329523" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="83057920148375081870" packLayer="1" parentCode="87069090015932033782" flag="0"/>
- <Code curCode="87069090015931913483" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148382283339" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148382525896" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148382049580" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148381808684" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148381323782" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148380365101" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148380600446" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148380845965" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148381089410" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="83057920148381561273" packLayer="1" parentCode="87069090015931913483" flag="0"/>
- <Code curCode="87069090015931956131" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148377962860" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148378204570" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148378443550" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148378686893" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148378920964" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148379164311" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148379406311" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148379643309" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148379883846" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="83057920148380125281" packLayer="1" parentCode="87069090015931956131" flag="0"/>
- <Code curCode="87069090015931993545" packLayer="2" parentCode="87069080001788999534" flag="0"/>
- <Code curCode="83057920148375560130" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148375806129" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148376048063" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148376281992" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148376529495" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148376765510" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148377000472" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148377245836" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148377489066" packLayer="1" parentCode="87069090015931993545" flag="0"/>
- <Code curCode="83057920148377721035" packLayer="1" parentCode="87069090015931993545" flag="0"/>-->
- </Batch>
- </Relation>
+锘�<?xml version="1.0" encoding="utf-8"?>
+<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="缁堢鎺ュ彛XML Schema-3.0.xsd" Version="3.0">
+ <Events>
+ <Event Name="SalesWareHouseOut" MainAction="WareHouseOut">
+ <ActionMaping>
+ <Action Name="WareHouseOut">
+ <ActionData>CorpOrderID</ActionData>
+ <ActionData>Actor</ActionData>
+ <ActionData>ActDate</ActionData>
+ <ActionData>ToCorpID</ActionData>
+ <ActionData>Code</ActionData>
+ </Action>
+ </ActionMaping>
+ <DataMaping>
+ <MetaData Name="CorpOrderID" Type="String"/>
+ <MetaData Name="Actor" Type="String"/>
+ <MetaData Name="ActDate" Type="Date"/>
+ <MetaData Name="ToCorpID" Type="String"/>
+ <MetaData Name="Code" Type="String"/>
+ </DataMaping>
+ <DataDesc>
+ <MetaDataDesc MetaName="Actor" IsParent="true">
+ <MetaDataDesc MetaName="Code" IsParent="false"/>
+ </MetaDataDesc>
+ <MetaDataDesc MetaName="CorpOrderID" IsParent="true">
+ <MetaDataDesc MetaName="Code" IsParent="false"/>
+ </MetaDataDesc>
+ </DataDesc>
+ <DataField>
+
+ </DataField>
</Event>
</Events>
-</DataList>
\ No newline at end of file
+</Document>
\ No newline at end of file
diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 3cc97da..c9bc7b9 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -2013,6 +2013,13 @@
}
}
+ /// <summary>
+ /// 瀵煎嚭xml鏂囦欢
+ /// </summary>
+ /// <param name="id"></param>
+ /// <param name="userId"></param>
+ /// <returns></returns>
+ /// <exception cref="Exception"></exception>
public XmlNode AddExXmlStr(int id, int userId)
{
try
@@ -2022,27 +2029,80 @@
{
throw new Exception("鏈煡璇㈠埌鍑哄簱鍗曟嵁淇℃伅");
}
+ var noticeDetial = Db.Queryable<BllExportNoticeDetail>().Where(w => w.IsDel == "0" && w.SONo == notice.SONo).First();
+ if (noticeDetial == null)
+ {
+ throw new Exception("鏈煡璇㈠埌鍑哄簱鍗曟嵁鏄庣粏淇℃伅");
+ }
var statusLis = new List<string>() { "4", "5", "6" };
if (!statusLis.Contains(notice.Status))
{
throw new Exception("鍙傛暟寮傚父,璇锋鏌ョ姸鎬佹槸鍚︿负鎵ц瀹屾垚鎴栬鍗曞叧闂�/宸蹭笂浼�");
}
+ string xmlName = string.Empty;
+ switch (notice.Type)
+ {
+ case "0"://鎴愬搧鍑哄簱/閿�鍞嚭搴�
+ xmlName = "SalesWareHouseOut";
+ break;
+ case "2"://鎶芥鍑哄簱
+ xmlName = "CheckWareHouseOut";
+ break;
+ default:
+ throw new Exception("鍗曟嵁绫诲瀷寮傚父");
+ }
+
+ var materiDetial = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == noticeDetial.SkuNo);
+ var packType = Db.Queryable<SysPackag>().First(w => w.IsDel == "0" && w.PackagNo == materiDetial.PackagNo);
+ int level = 0;
+ if (!string.IsNullOrEmpty(packType.L2Name))
+ {
+ level = 1;
+ }
+ if (!string.IsNullOrEmpty(packType.L3Name))
+ {
+ level = 2;
+ }
+ if (!string.IsNullOrEmpty(packType.L4Name))
+ {
+ level = 3;
+ }
//鍑哄簱鍗曟槑缁�
- var comDetail = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.SONo == notice.SONo).Select(m => m.BoxNo3).ToList();
+ var comDetail = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.SONo == notice.SONo).ToList();
+ var userinfo = Db.Queryable<SysUserInfor>().Where(m => m.Id == comDetail.First().CreateUser).First().RealName;
+
Db.BeginTran();//寮�鍚簨鍔�
try
{
//Hashtable pars = new Hashtable(); //鐢ㄦ潵瀛樻斁鍙傛暟
var pars = new List<string>();
- //for (int i = 0; i < 10; i++)
- //{
- // pars.Add("202203240009000479940290");
- //}
+ string[] strr = new string[comDetail.Count];
- var dom = HttpHelper.EncodeParsToFuMa(comDetail, "ceshi", "ExInfoXml");
+ for (int i = 0; i < comDetail.Count(); i++)
+ {
+ switch (level)
+ {
+ case 1:
+ strr[i] = comDetail[i].BoxNo + "," + comDetail[i].SONo + "," + userinfo + "," + Convert.ToString(comDetail[i].CreateTime);
+ break;
+ case 2:
+ strr[i] = comDetail[i].BoxNo3 + "," + comDetail[i].SONo + "," + userinfo + "," + Convert.ToString(comDetail[i].CreateTime);
+ break;
+ case 3:
+ strr[i] = comDetail[i].BoxNo2 + "," + comDetail[i].SONo + "," + userinfo + "," + Convert.ToString(comDetail[i].CreateTime);
+ break;
+ default:
+ break;
+ }
+
+
+ pars.Add(strr[i]);
+ }
+ //string fileName = $"{xmlName}_{notice.OrderCode}_linklink";
+ var dom = HttpHelper.EncodeParsToFuMa(pars, "", xmlName, "ExInfoXml");
////娣诲姞鎿嶄綔鏃ュ織璁板綍
- //var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鍑哄簱鍗曟嵁", notice.SONo, "鍏冲崟", $"鍏抽棴浜嗗崟鎹彿涓簕notice.SONo}鐨勫崟鎹俊鎭�", userId);
+ var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鍑哄簱鍗曟嵁", notice.SONo, "涓婁紶", $"涓婁紶浜嗗崟鎹彿涓簕notice.SONo}鐨勫崟鎹俊鎭�", userId);
Db.CommitTran();
return dom;
--
Gitblit v1.8.0