From 260c6e54c4f100ca49376a6afd70f73843868171 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期三, 28 八月 2024 08:49:35 +0800
Subject: [PATCH] 组托收货测试
---
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 108 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 86 insertions(+), 22 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 3b1572c..118e2bc 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -892,7 +892,7 @@
#endregion
#region 鍦扮爜淇℃伅(鍌ㄤ綅淇℃伅)
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
+ var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
if (storageLocat == null)
{
strMsg = "-1:鍌ㄤ綅淇℃伅涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!";
@@ -3530,7 +3530,7 @@
//缁戝畾绠辨�绘暟閲�
//model.SkuQty = boxInfoList.Sum(s => s.Qty);
//鍜岄�夋嫨鐨勬壒娆″悓鎵规鐨勭鐮佷俊鎭�
- var sameBoxInfoList = boxInfoList.Where(w => w.LotNo == model.LotNo).ToList();
+ var sameBoxInfoList = boxInfoList.Where(w => w.LotNo == model.LotNo && w.Status == "0").ToList();
//鍜岄�夋嫨鐨勬壒娆′笉鍚屾壒娆$殑绠辩爜淇℃伅锛堟嫾绠辨壒娆★級
var notBoxInfoList = boxInfoList.Where(w => w.LotNo != model.LotNo).ToList();
#endregion
@@ -4582,6 +4582,18 @@
var bindId = 0;
if (bind == null)
{
+ DateTime? pTime = null;
+ DateTime? eTime = null;
+ if (!string.IsNullOrWhiteSpace(detail.Lot1))
+ {
+ pTime = DateTime.Parse(detail.Lot1);
+ }
+ if (!string.IsNullOrWhiteSpace(detail.Lot2))
+ {
+ eTime = DateTime.Parse(detail.Lot2);
+ }
+
+
bind = new BllPalletBind
{
ASNNo = model.AsnNo,
@@ -4597,6 +4609,8 @@
SupplierLot = detail.SupplierLot,
//InspectMark = model.IsSample, //鏄惁鍙栨牱鎵樼洏 鍚庢湡涓氬姟寮�鍙戞椂 鎺ュ彛浼犲�奸渶娣诲姞瀵瑰簲瀛楁鍒ゆ柇
//SamplingQty = 0, //鍙栨牱鏁伴噺 鍚庢湡涓氬姟寮�鍙戞椂 鎺ュ彛浼犲�奸渶娣诲姞瀵瑰簲瀛楁鍒ゆ柇
+ ProductionTime = pTime,
+ ExpirationTime = eTime,
BitPalletMark = "1",
IsBale = "0",
IsBelt = "0",
@@ -4652,6 +4666,12 @@
}
else
{
+ string inspectStatusStr = "0";
+ if (sku.IsInspect == "1")
+ {
+ inspectStatusStr = "1";
+ }
+
// 搴撳瓨涓嶅瓨鍦� 鎻掑叆鏁版嵁
sd1 = new DataStockDetail()
{
@@ -4680,7 +4700,7 @@
ExpirationTime = bind.ExpirationTime,
Status = "0",
InspectMark = bind.InspectMark,
- InspectStatus = sku.IsInspect,
+ InspectStatus = inspectStatusStr,
BitPalletMark = bind.BitPalletMark,
PackagNo = detail.PackagNo, //liudl 鐢眘ku鐨勫寘瑁呯紪鍙峰彉涓哄叆搴撳崟鏄庣粏鐨勫寘瑁呯紪鐮�
IsBale = bind.IsBale,
@@ -4870,9 +4890,6 @@
sqlStr += $"insert into LogPalletTrack values('{model.PalletNo}','{model.AsnNo}','缁勭洏','0',getDate(),{userId},NULL,NULL);";
Db.Ado.ExecuteCommand(sqlStr);
new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "鎵樼洏缁戝畾", model.AsnNo, "娣诲姞", $"娣诲姞浜嗘墭鐩樼爜涓猴細{model.PalletNo}鐨勭粍鐩樹俊鎭�", userId);
-
-
-
}
#endregion
@@ -4922,7 +4939,7 @@
#endregion
#region 鍦扮爜淇℃伅(鍌ㄤ綅淇℃伅)
- var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0" && w.WareHouseNo == "W02");
+ var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == model.LocatNo && w.Status == "0");
if (storageLocat == null)
{
throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!");
@@ -5153,7 +5170,7 @@
SendDate = serverTime, //鍙戦�佹椂闂�
BackDate = serverTime, //杩斿洖鏃堕棿
StartLocat = "",//璧峰浣嶇疆
- EndLocat = "鍔涜骞冲簱",//鐩爣浣嶇疆
+ EndLocat = "骞冲簱",//鐩爣浣嶇疆
PalletNo = bindInfo.PalletNo,//鎵樼洏鐮�
IsSend = 0,//鏄惁鍙啀娆′笅鍙�
IsCancel = 0,//鏄惁鍙彇娑�
@@ -5161,7 +5178,7 @@
Type = "0",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
Status = "2",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
OrderType = "0",//0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗�
- Msg = "鍔涜骞冲簱鐨勫叆搴撲换鍔�",
+ Msg = "骞冲簱鐨勫叆搴撲换鍔�",
};
Db.Insertable(exTask).ExecuteCommand();
@@ -5175,6 +5192,27 @@
bindInfo.TaskNo = taskNo; //浠诲姟鍙�
Db.Updateable(bindInfo).ExecuteCommand();
#endregion
+
+ /* #region 娣诲姞鎵樼洏涓婃灦璁板綍
+ var upShelf = new BllPalletUpShelf()
+ {
+ TaskNo = exTask.TaskNo,
+ TraceNo = bindInfo.ASNNo,
+ PalletNo = bindInfo.PalletNo,
+ SkuNo = stockModel.SkuNo,
+ SkuName = stockModel.SkuName,
+ LotNo = stockModel.LotNo,
+ Status = "1",
+
+ WareHouseNo = bindInfo.WareHouseNo,
+ RoadwayNo = bindInfo.RoadwayNo,
+ AreaNo = "",
+ LocatNo = "",
+
+ CreateUser = 0,
+ };
+ Db.Insertable(upShelf).ExecuteCommand();
+ #endregion*/
#region 搴撳瓨绠辨敮鏄庣粏琛�
// 鎻掑叆鏂扮粍鐨勭鏀俊鎭�
@@ -5241,11 +5279,13 @@
//淇敼搴撳瓨鏄庣粏淇℃伅
foreach (var item in stockDetail)
{
- item.Status = "0"; //鐘舵�佹洿鏀逛负寰呭垎閰�
- item.WareHouseNo = "W02"; //鎵�灞炰粨搴�
- item.LocatNo = model.LocatNo;//鍌ㄤ綅鍦板潃
- item.UpdateTime = serverTime; //淇敼鏃堕棿
- item.UpdateUser = model.CreateUser; //淇敼浜�
+ item.Status = "0"; // 鐘舵�佹洿鏀逛负寰呭垎閰�
+ item.WareHouseNo = storageLocat.WareHouseNo; // 鎵�灞炰粨搴�
+ item.RoadwayNo = storageLocat.RoadwayNo; // 鎵�灞炲贩閬�
+ item.AreaNo = storageLocat.AreaNo; // 鎵�灞炲尯鍩�
+ item.LocatNo = model.LocatNo; // 鍌ㄤ綅鍦板潃
+ item.UpdateTime = serverTime; // 淇敼鏃堕棿
+ item.UpdateUser = model.CreateUser; // 淇敼浜�
//淇敼搴撳瓨鏄庣粏淇℃伅
Db.Updateable(item).ExecuteCommand();
}
@@ -5271,7 +5311,7 @@
SendDate = DateTime.Now, //鍙戦�佹椂闂�
BackDate = DateTime.Now, //杩斿洖鏃堕棿
StartLocat = "",//璧峰浣嶇疆
- EndLocat = "鐗у師骞冲簱",//鐩爣浣嶇疆
+ EndLocat = "骞冲簱",//鐩爣浣嶇疆
PalletNo = model.PalletNo,//鎵樼洏鐮�
IsSend = 0,//鏄惁鍙啀娆′笅鍙�
IsCancel = 0,//鏄惁鍙彇娑�
@@ -5279,21 +5319,44 @@
Type = "0",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
Status = "2",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
OrderType = "3",//0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗�
- Msg = "鐗у師骞冲簱鐨勫叆搴撲换鍔�",
+ Msg = "骞冲簱鐨勫叆搴撲换鍔�",
};
Db.Insertable(exTask).ExecuteCommand();
//鎵樼洏缁戝畾淇℃伅
- var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
+ var bindInfo = Db.Queryable<BllPalletBind>().First(w => w.IsDel == "0" && w.PalletNo == model.PalletNo
+ && w.Status == "2" && string.IsNullOrEmpty(w.LocatNo));
if (bindInfo != null)
{
- bindInfo.WareHouseNo = "W02";//鎵�灞炰粨搴�
- bindInfo.LocatNo = model.LocatNo;//鍌ㄤ綅鍦板潃
+ bindInfo.WareHouseNo = storageLocat.WareHouseNo; // 鎵�灞炰粨搴�
+ bindInfo.RoadwayNo = storageLocat.RoadwayNo; // 鎵�灞炲贩閬�
+ bindInfo.LocatNo = model.LocatNo; // 鍌ㄤ綅鍦板潃
bindInfo.UpdateTime = serverTime;
bindInfo.UpdateUser = model.CreateUser;
- bindInfo.CompleteTime = serverTime; //瀹屾垚鏃堕棿
- bindInfo.TaskNo = taskNo; //浠诲姟鍙�
+ bindInfo.CompleteTime = serverTime; // 瀹屾垚鏃堕棿
+ bindInfo.TaskNo = taskNo; // 浠诲姟鍙�
Db.Updateable(bindInfo).ExecuteCommand();
}
+ #endregion
+
+ #region 娣诲姞鎵樼洏涓婃灦璁板綍
+ var palletupinfo = stockDetail.First();
+ var upShelf = new BllPalletUpShelf()
+ {
+ TaskNo = exTask.TaskNo,
+ TraceNo = bindInfo.ASNNo,
+ PalletNo = bindInfo.PalletNo,
+ SkuNo = palletupinfo.SkuNo,
+ SkuName = palletupinfo.SkuName,
+ LotNo = palletupinfo.LotNo,
+ Status = "2",
+ LocatNo = model.LocatNo,
+ WareHouseNo = bindInfo.WareHouseNo,
+ RoadwayNo = bindInfo.RoadwayNo,
+ AreaNo = storageLocat.AreaNo,
+
+ CreateUser = 0,
+ };
+ Db.Insertable(upShelf).ExecuteCommand();
#endregion
}
storageLocat.Status = "1";//鐘舵�佸凡浣跨敤
@@ -5302,7 +5365,8 @@
//淇敼鍌ㄤ綅淇℃伅
Db.Updateable(storageLocat).ExecuteCommand();
- new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "骞冲簱鍏ュ簱", model.PalletNo, "瀹屾垚", $"鍦≒DA涓婂畬鎴愬崟鎹彿涓猴細{model.ASNNo}鐨勬墭鐩樼爜涓猴細{model.PalletNo}鐨勫钩搴撳叆搴撴搷浣�", (int)model.CreateUser);
+ new OperationASNServer().AddLogOperationAsn("PDA妯″潡", "骞冲簱鍏ュ簱", model.PalletNo, "瀹屾垚",
+ $"鍦≒DA涓婂畬鎴愬崟鎹彿涓猴細{model.ASNNo}鐨勬墭鐩樼爜涓猴細{model.PalletNo}鐨勫钩搴撳叆搴撴搷浣�", (int)model.CreateUser);
Db.CommitTran();
}
catch (Exception ex)
--
Gitblit v1.8.0