From 4c49b591b3833a2752634355cb37b0a74923e916 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 07 十一月 2025 09:41:17 +0800
Subject: [PATCH] 开发成品出库导出上传码上放心平台xm文件
---
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 74 +++++++++++++++++++++++++++++++++---
1 files changed, 67 insertions(+), 7 deletions(-)
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