From 3f5f0c666d20a58998a7a7cc4fc3047d86a0f5b3 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 16 九月 2025 18:42:03 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 0c2ac49..a0d0221 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -691,9 +691,9 @@
             {
                 throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
             }
-            if (models.WareHouseNo != "W04")
+            if (models.WareHouseNo != "W04" && models.WareHouseNo != "W02")
             {
-                throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
+                throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴鎴栬揣鏋跺簱鍐�,璇锋鏌�!");
             }
             return models.LocatNo;
         }
@@ -721,7 +721,7 @@
                 {
                     throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
                 }
-                if (models.WareHouseNo != "W04")
+                if (models.WareHouseNo != "W04" && models.WareHouseNo != "W02")
                 {
                     throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
                 }
@@ -731,8 +731,14 @@
                     throw Oops.Bah("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
                 }
 
-                
-                storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04").OrderBy(o => o.AreaNo).ToListAsync();
+                if (models.WareHouseNo == "W02")
+                {
+                    storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02")).OrderBy(o => o.AreaNo).ToListAsync();
+                }
+                else
+                {
+                    storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04").OrderBy(o => o.AreaNo).ToListAsync();
+                }
                 
             }
             return storageArea;
@@ -829,7 +835,7 @@
                 {
                     throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
                 }
-                if (stockDetail.WareHouseNo != "W04")
+                if (stockDetail.WareHouseNo != "W04" && stockDetail.WareHouseNo != "W02")
                 {
                     throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
                 }
@@ -1001,6 +1007,10 @@
                 }
                 //鏍规嵁鐩爣鍖哄煙鑾峰彇鐩爣鍌ㄤ綅鍦板潃
                 EndLocat = await GetLocat(areaNo);
+                if (string.IsNullOrEmpty(EndLocat))
+                {
+                    throw Oops.Bah("鑾峰彇鐩爣鍌ㄤ綅澶辫触!");
+                }
                 
                 //璧峰鍌ㄤ綅淇℃伅
                 var storageLocat = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == locatNo);
@@ -1265,9 +1275,18 @@
             string endLocat = string.Empty;//鐩爣鍌ㄤ綅
             //褰撳墠鍖哄煙鎵�鏈夊偍浣嶄俊鎭�
             var storageLocatList = await Db.Queryable<SysStorageLocat>().Where(w => w.WareHouseNo == "W04" && w.AreaNo == areaNo).ToListAsync();
-           
-            var locatInfo2 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0")
+
+            var locatInfo2 = new SysStorageLocat();
+            if (areaNo == "B10")
+            {
+                locatInfo2 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0")
                            .OrderByDescending(m => m.Layer).OrderByDescending(m => m.Column).OrderByDescending(m => m.Row).First();
+            }
+            else
+            {
+                locatInfo2 = storageLocatList.Where(w => w.IsDel == "0" && w.Flag == "0" && w.Status == "0")
+                               .OrderByDescending(m => m.Layer).OrderByDescending(m => m.Column).OrderByDescending(m => m.Row).First();
+            }            
 
             if (locatInfo2 != null)
             {
@@ -1387,9 +1406,9 @@
                 }
                 //寮�鍚簨鍔�
                 Db.BeginTran();
-                
+
                 //搴撳瓨绠辨敮鏄庣粏淇℃伅
-                var boxList = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo == boxNo).ToList();
+                var boxList = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo == boxNo && w.Status == "2").ToList();
                 if (boxList.Count != 1)
                 {
                     throw new Exception("璇ョ鐮佷俊鎭敊璇紝瀛樺湪澶氫釜姝ょ鐮佷俊鎭�");

--
Gitblit v1.8.0