From fb40b7634d8a199169d1c7e6d43e1e5e02278158 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 20 三月 2024 17:07:28 +0800
Subject: [PATCH] 合并
---
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 46 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 0afc859..e802b7c 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();
@@ -941,6 +958,7 @@
StartLocat = stockDetail.LocatNo,//璧峰浣嶇疆
EndLocat = EndLocat,//鐩爣浣嶇疆
PalletNo = palletNo,//鎵樼洏鐮�
+ Msg = string.Format("杞繍浠诲姟锛歿0}=>>{1}", stockDetail.LocatNo, EndLocat),
IsSend = 1,//鏄惁鍙啀娆′笅鍙�
IsCancel = 1,//鏄惁鍙彇娑�
IsFinish = 1,//鏄惁鍙畬鎴�
@@ -960,10 +978,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 +1026,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 +1072,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();
@@ -1053,7 +1089,7 @@
Sender = "WMS",
Receiver = "AGV",
IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛
-
+ Msg= string.Format("杞繍浠诲姟锛歿0}=>>{1}", stockDetail.LocatNo, EndLocat),
StartLocat = stockDetail.LocatNo,//璧峰浣嶇疆
EndLocat = EndLocat,//鐩爣浣嶇疆
PalletNo = palletNo,//鎵樼洏鐮�
@@ -1079,6 +1115,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 +1166,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