From 3165ddb369bca273ffb0d185fa293841ca99c3d7 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期一, 10 十一月 2025 15:32:21 +0800
Subject: [PATCH] EditExportNotice更新出库单Qty<0
---
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 90 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 75 insertions(+), 15 deletions(-)
diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 3cc97da..69d3905 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -1231,7 +1231,7 @@
//娣诲姞鍑哄簱鍗�
foreach (var d in model.Detail)
{
- if (d.Qty < 1)
+ if (d.Qty <= 0)
{
throw new Exception("鍑哄簱鏁伴噺蹇呴』澶т簬0");
}
@@ -1509,7 +1509,7 @@
//鏇存柊鍑哄簱鍗�
foreach (var d in model.Detail)
{
- if (d.Qty < 1)
+ if (d.Qty < 0)
{
throw new Exception("鍑哄簱鏁版嵁蹇呴』澶т簬0");
}
@@ -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;
@@ -2395,7 +2455,7 @@
var allot = new AllotLocation();
#region 闆嗗悎
-
+
Db.BeginTran();
try
{
@@ -2836,7 +2896,7 @@
{
s.Status = "1";
}
-
+
var sd = Db.Updateable(s).UpdateColumns(it => new { it.LockQty, it.Status }).ExecuteCommand();
}
@@ -2913,7 +2973,7 @@
notice.Status = "3";//姝e湪鎵ц
}
}
-
+
notice.UpdateUser = userId;
notice.UpdateTime = DateTime.Now;
var zd = Db.Updateable(notice).ExecuteCommand();
@@ -4370,7 +4430,7 @@
}
}
}
- if(string.IsNullOrEmpty(newAddress))
+ if (string.IsNullOrEmpty(newAddress))
{
//宸叉湁鐗╁搧鐨勫贩閬�
var roadwayHave = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.WareHouseNo == "W01").GroupBy(g => g.RoadwayNo).Select(s => s.RoadwayNo).ToList();
@@ -4401,7 +4461,7 @@
}
}
}
-
+
}
}
@@ -4582,7 +4642,7 @@
else
{
// 鍙栨渶涓婇潰涓�鎺�
- location = slotModel[0].LocatNo;
+ location = slotModel[0].LocatNo;
}
bl = true;
--
Gitblit v1.8.0