From 88430dbe00e46a856b918cef9372a3132aac5712 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期四, 27 十一月 2025 15:16:49 +0800
Subject: [PATCH] Merge branch 'master' of http://47.95.120.53:8083/r/JC34WMS
---
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 101 +++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 82 insertions(+), 19 deletions(-)
diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 835cba8..fda5988 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -450,8 +450,8 @@
WaveNo = "",
IsIssueLotNo = string.IsNullOrWhiteSpace(d.lotNo) ? "0" : "1",
IsMixBox = "0",
-
OrderDetailCode = d.lineNo,
+ Status = "0",//榛樿绛夊緟鎵ц
CreateUser = 0,
};
@@ -613,11 +613,11 @@
CreateUser = 0,
};
- if (houseNo == "1000" || houseNo == "1001" || houseNo == "2000" || houseNo == "2002" || houseNo == "2003" || houseNo == "2004")
+ if (houseNo == "1000" || houseNo == "1001" || houseNo == "1002" || houseNo == "1003" || houseNo == "1098" || houseNo == "2000" || houseNo == "2001" || houseNo == "2002" || houseNo == "2003" || houseNo == "2004" || houseNo == "3101" || houseNo == "3102" || houseNo == "3103" || houseNo == "3104")
{
notice.WareHouseNo = "W02";
}
- else if (houseNo == "4000")
+ else if (houseNo == "4000" | houseNo == "4001")
{
notice.WareHouseNo = "W01";
}
@@ -753,12 +753,12 @@
//绯荤粺瀵规帴鍚庢斁寮�
var jsonData = JsonConvert.SerializeObject(soInfo);
- var response = HttpHelper.DoPost(url, jsonData, "鍑哄簱鍗曞畬鎴愪笂浼�", "ERP");
+ var response = HttpHelper.DoPost(url, jsonData, "鍑哄簱鍗曞畬鎴愪笂浼�", "SAP");
- var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
- if (obj.Success != 0)
+ var obj = JsonConvert.DeserializeObject<SapResultModel>(response);//瑙f瀽杩斿洖鏁版嵁
+ if (obj.RESULT != true)
{
- throw new Exception("涓婁紶澶辫触" + obj.Message);
+ throw new Exception("涓婁紶澶辫触" + obj.MESSAGE);
}
#endregion
}
@@ -1231,7 +1231,7 @@
//娣诲姞鍑哄簱鍗�
foreach (var d in model.Detail)
{
- if (d.Qty < 0)
+ if (d.Qty <= 0)
{
throw new Exception("鍑哄簱鏁伴噺蹇呴』澶т簬0");
}
@@ -1452,7 +1452,8 @@
{
throw new Exception("鏈煡璇㈠埌鍑哄簱鍗曟嵁淇℃伅");
}
- if (notice.Origin != "WMS" || notice.Status != "0")
+ //if (notice.Origin != "WMS" || notice.Status != "0")
+ if (notice.Status != "0")
{
throw new Exception("鍙傛暟寮傚父,璇锋鏌ョ姸鎬佹槸鍚︽湭绛夊緟鎵ц鎴栨潵婧愭槸鍚︽槸WMS");
}
@@ -1509,7 +1510,7 @@
//鏇存柊鍑哄簱鍗�
foreach (var d in model.Detail)
{
- if (d.Qty < 1)
+ if (d.Qty <= 0)
{
throw new Exception("鍑哄簱鏁版嵁蹇呴』澶т簬0");
}
@@ -2013,6 +2014,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 +2030,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;
@@ -2732,7 +2793,7 @@
decimal needQty = detail.Qty - (detail.AllotQty == null ? 0 : decimal.Parse(detail.AllotQty.ToString()));
//搴撳瓨鏄庣粏 Status 0锛氬緟鍒嗛厤 1锛氶儴鍒嗗垎閰� 2锛氬凡鍒嗛厤
var stockDetail = Db.Queryable<DataStockDetail>().Where(m => m.SkuNo == detail.SkuNo && (m.Qty - m.FrozenQty - m.LockQty + m.InspectQty) > 0 && (m.Status == "0" || m.Status == "1") && m.IsDel == "0"
- && m.AreaNo != "B06" && m.AreaNo != "B07" && m.AreaNo != "B09" && m.AreaNo != "B24")//鎺掗櫎杞﹂棿搴撳瓨
+ && m.AreaNo != "B06" && m.AreaNo != "B07" && m.AreaNo != "B09" && m.AreaNo != "B24" && m.AreaNo != "B26" && m.AreaNo != "B27" && m.AreaNo != "B28")//鎺掗櫎杞﹂棿搴撳瓨
.ToList();
@@ -4703,7 +4764,9 @@
}
- var endLocateList = Db.Queryable<SysStorageLocat>().Where(m => m.IsDel == "0" && (m.AreaNo == "B02" || m.AreaNo == "B05")).Select(m => m.LocatNo).ToList();
+ //鎵�灞炲尯鍩熼泦鍚�
+ List<string> areNolist = new List<string>() { "B01", "B02", "B05" };
+ var endLocateList = Db.Queryable<SysStorageLocat>().Where(m => m.IsDel == "0" && areNolist.Contains(m.AreaNo)).Select(m => m.LocatNo).ToList();
//鍒ゆ柇鏄惁鏄師杈呮枡鍑哄簱浠诲姟 璐ф灦鍌ㄤ綅=銆嬪钩搴撳偍浣�
if (endLocateList.Contains(task.EndLocat) && PalletType == "0")
{
--
Gitblit v1.8.0