From 4f7b007a9e0de9dac35c8c81e6e32f9ab6fee5c8 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期四, 26 九月 2024 08:47:29 +0800
Subject: [PATCH] Merge branch 'wxw'

---
 Wms/WMS.BLL/SysServer/StorageLocatServer.cs |   95 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
index c8826e5..e87f209 100644
--- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
+++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -110,6 +110,7 @@
             try
             {
                 var data = LocatRst.GetOneById(id);
+                //var data = Db.Queryable<SysStorageLocat>().First(m=>m.Id == id);
                 return data;
             }
             catch (Exception e)
@@ -118,7 +119,24 @@
                 throw;
             }
         }
-
+        public List<SysStorageLocat> GetStorageLocat(List<int> id)
+        {
+            try
+            {
+                var SysStorageLocats = new List<SysStorageLocat>();
+                foreach (var item in id)
+                {
+                    var storage = LocatRst.GetOneById(item);
+                    SysStorageLocats.Add(storage);
+                }
+                return SysStorageLocats;
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e);
+                throw;
+            }
+        }
 
         public bool EditStorageLocat(EditLocateVm model, int userId)
         {
@@ -473,8 +491,8 @@
                 int b = 0; //1锛氭湁鐗╁搧 
                 int c = 0; //2锛氬叆搴撲腑 
                 int d = 0; //3锛氬嚭搴撲腑 
-                //int e = 0; //4锛氱Щ鍏ヤ腑 
-                //int f = 0; //5锛氱Щ鍑轰腑 
+                int e = 0; //4锛氱Щ鍏ヤ腑 
+                int f = 0; //5锛氱Щ鍑轰腑 
                 int g = 0; //6锛氭崯鍧廫灞忚斀 
 
                 foreach (var item in getLocateVms)
@@ -503,18 +521,18 @@
                         d = 1; //3锛氬嚭搴撲腑 
                         continue;
                     }
-                    ////4锛氱Щ鍏ヤ腑 
-                    //if (item.Status == "4")
-                    //{
-                    //    e = 1; //4锛氱Щ鍏ヤ腑 
-                    //    continue;
-                    //}
-                    ////5锛氱Щ鍑轰腑 
-                    //if (item.Status == "5")
-                    //{
-                    //    f = 1; //5锛氱Щ鍑轰腑 
-                    //    continue;
-                    //}
+                    //4锛氱Щ鍏ヤ腑 
+                    if (item.Status == "4")
+                    {
+                        e = 1; //4锛氱Щ鍏ヤ腑 
+                        continue;
+                    }
+                    //5锛氱Щ鍑轰腑 
+                    if (item.Status == "5")
+                    {
+                        f = 1; //5锛氱Щ鍑轰腑 
+                        continue;
+                    }
                     //6锛氭崯鍧廫灞忚斀 
                     if (item.Status == "6")
                     {
@@ -559,24 +577,24 @@
                     getLocateVm.Status = "3";
                     getLocateVms.Add(getLocateVm);
                 }
-                ////4锛氱Щ鍏ヤ腑 
-                //if (e == 0)
-                //{
-                //    getLocateVm = new GetLocateVm();
-                //    getLocateVm.WareHouseNo = wareHouseNo; //浠撳簱鍙�
-                //    getLocateVm.StatusNum = "0";
-                //    getLocateVm.Status = "4";
-                //    getLocateVms.Add(getLocateVm);
-                //}
-                ////5锛氱Щ鍑轰腑 
-                //if (f == 0)
-                //{
-                //    getLocateVm = new GetLocateVm();
-                //    getLocateVm.WareHouseNo = wareHouseNo; //浠撳簱鍙�
-                //    getLocateVm.StatusNum = "0";
-                //    getLocateVm.Status = "5";
-                //    getLocateVms.Add(getLocateVm);
-                //}
+                //4锛氱Щ鍏ヤ腑 
+                if (e == 0)
+                {
+                    getLocateVm = new GetLocateVm();
+                    getLocateVm.WareHouseNo = wareHouseNo; //浠撳簱鍙�
+                    getLocateVm.StatusNum = "0";
+                    getLocateVm.Status = "4";
+                    getLocateVms.Add(getLocateVm);
+                }
+                //5锛氱Щ鍑轰腑 
+                if (f == 0)
+                {
+                    getLocateVm = new GetLocateVm();
+                    getLocateVm.WareHouseNo = wareHouseNo; //浠撳簱鍙�
+                    getLocateVm.StatusNum = "0";
+                    getLocateVm.Status = "5";
+                    getLocateVms.Add(getLocateVm);
+                }
                 //6锛氭崯鍧廫灞忚斀 
                 if (g == 0)
                 {
@@ -672,7 +690,7 @@
                     throw new Exception("鏈壘鍒板搴斿偍浣�");
                 }
                 //鏈夌墿鍝併�佸嚭搴撲腑鏁版嵁婧愶紙搴撳瓨鏄庣粏琛級
-                if (storageLocat.Status == "1" || storageLocat.Status == "3")
+                if (storageLocat.Status == "1" || storageLocat.Status == "3" || storageLocat.Status == "5")
                 {
                     //搴撳瓨鏄庣粏
                     List<DataStockDetail> stockDetailList = Db.Queryable<DataStockDetail>().Where(w => w.LocatNo == locatNo && w.IsDel == "0").ToList();
@@ -701,7 +719,8 @@
                 else if (storageLocat.Status == "2")
                 {
                     //鎵樼洏缁戝畾淇℃伅
-                    List<BllPalletBind> palletBindList = Db.Queryable<BllPalletBind>().Where(w => w.LocatNo == locatNo && w.IsDel == "0").ToList();
+                    List<BllPalletBind> palletBindList = Db.Queryable<BllPalletBind>()
+                        .Where(w => w.LocatNo == locatNo && w.IsDel == "0" && w.Status == "1").ToList();
                     if (palletBindList == null || palletBindList.Count <= 0)
                     {
                         throw new Exception("鏈壘鍒板搴旂殑鎵樼洏缁戝畾淇℃伅");
@@ -749,6 +768,12 @@
                     case "3":
                         model.Status = "鍑哄簱涓�";
                         break;
+                    case "4":
+                        model.Status = "绉诲叆涓�";
+                        break;
+                    case "5":
+                        model.Status = "绉诲嚭涓�";
+                        break;
                     default:
                         model.Status = "";
                         break;

--
Gitblit v1.8.0