From d24fd92f40757374cf60f1148a91acb0cfb06287 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 21 三月 2024 16:58:52 +0800
Subject: [PATCH] 将托盘绑定限制条件修改为标签页,增加托盘绑定页单据下是否有贴标物料及方法。
---
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 43 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 0afc859..7b98079 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -890,6 +890,11 @@
{
string EndLocat = string.Empty;//鐩爣浣嶇疆
+ var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
+ if (log != null)
+ {
+ throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+ }
var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
if (stockDetail == null)
{
@@ -921,11 +926,23 @@
{
throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
}
+ //璧峰鍌ㄤ綅淇℃伅
var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo);
if (storageLocat == null)
{
throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
+ //鐩爣鍌ㄤ綅淇℃伅
+ var storageLocatEnd = new SysStorageLocat();
+ if (!string.IsNullOrEmpty(areaNo))
+ {
+ storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
+ if (storageLocatEnd == null)
+ {
+ throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
+ }
+
//寮�鍚簨鍔�
Db.BeginTran();
@@ -960,10 +977,16 @@
stock.LockQty += (decimal)stockDetail.Qty;
Db.Updateable(stock).ExecuteCommand();
- //淇敼鍌ㄤ綅鍦板潃鐘舵��
+ //淇敼璧峰鍌ㄤ綅鍦板潃鐘舵��
storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
Db.Updateable(storageLocat).ExecuteCommand();
+ //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵��
+ if (storageLocatEnd != null)
+ {
+ storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ Db.Updateable(storageLocatEnd).ExecuteCommand();
+ }
//娣诲姞鎿嶄綔鏃ュ織璁板綍
var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId);
//鎻愪氦浜嬪姟
@@ -1002,6 +1025,12 @@
}
try
{
+ var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
+ if (log != null)
+ {
+ throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+ }
+
var notice = Db.Queryable<BllExportNotice>().First(w => w.IsDel == "0" && w.SONo == soNo);
if (notice == null)
{
@@ -1042,6 +1071,12 @@
}
string EndLocat = string.Empty;//鐩爣浣嶇疆
EndLocat= GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo,palletNo);
+ //鐩爣鍌ㄤ綅淇℃伅
+ var storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0");
+ if (storageLocatEnd == null)
+ {
+ throw new Exception("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
+ }
//寮�鍚簨鍔�
Db.BeginTran();
@@ -1079,6 +1114,10 @@
//淇敼鍌ㄤ綅鍦板潃鐘舵��
storageLocat.Status = "5";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
Db.Updateable(storageLocat).ExecuteCommand();
+
+ //淇敼鐩爣鍌ㄤ綅鍦板潃鐘舵��
+ storageLocatEnd.Status = "4";//0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑
+ Db.Updateable(storageLocatEnd).ExecuteCommand();
//娣诲姞鎿嶄綔鏃ュ織璁板綍
var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId);
@@ -1126,7 +1165,7 @@
if (string.IsNullOrEmpty(endLocat))
{
var locatInfo3 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0")
- .OrderByDescending(m => new { m.Layer, m.Column, m.Row }).First();
+ .OrderByDescending(m => m.Layer).OrderByDescending(m=>m.Column).OrderByDescending(m=> m.Row).First();
if (locatInfo3 != null)
{
--
Gitblit v1.8.0