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/BllAsnServer/BllBoxInfoServer.cs    |   48 ++++++++++++++++++++----
 Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs |    8 ++--
 Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs         |   12 +++---
 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs         |    4 +-
 4 files changed, 52 insertions(+), 20 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index 585aeea..8ff0456 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -777,10 +777,10 @@
                     return "-1:鍏ュ簱鍗曠姸鎬佸凡鍙樻洿锛屼笉鍙垹闄�!";
 
                 }
-                if (asnModel.Origin != "褰曞叆" && asnModel.Origin != "閲囪喘鍗�")
-                {
-                    return "-1:涓婃父绯荤粺涓嬪彂鐨勫崟鎹紝涓嶅彲鍒犻櫎;";
-                }
+                //if (asnModel.Origin != "褰曞叆" && asnModel.Origin != "閲囪喘鍗�")
+                //{
+                //    return "-1:涓婃父绯荤粺涓嬪彂鐨勫崟鎹紝涓嶅彲鍒犻櫎;";
+                //}
 
                 // 鍒犻櫎鎬诲崟
                 var editDateTime = DateTime.Now;
diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
index a8f25c3..6296674 100644
--- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -534,8 +534,17 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅锛岃鏍稿疄");
                 }
+                var skuInfo = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == asnDetail.SkuNo);
+                if (skuInfo == null)
+                {
+                    throw new Exception("鏈煡璇㈠埌鐗╂枡淇℃伅锛岃鏍稿疄");
+                }
+                if (string.IsNullOrEmpty(skuInfo.PackagNo))
+                {
+                    throw new Exception("鏈煡璇㈠埌鐗╂枡鐨勫寘瑁呬俊鎭紝璇锋牳瀹�");
+                }
 
-                var packInfo = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnDetail.PackagNo);
+                var packInfo = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == skuInfo.PackagNo);
                 if (packInfo == null)
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏涓殑鐗╂枡鍖呰淇℃伅");
@@ -781,7 +790,6 @@
                             maxBoxCode = maxBoxCode.Substring(0, maxBoxCode.Length-6) + (int.Parse(maxBoxCode.Substring(maxBoxCode.Length - 6, 6)) + 1).ToString().PadLeft(6, '0');
                         }
 
-                        DateTime? storeTime2 = null;
                         // 灏嗘潯鐮佷繚瀛樺埌鍘熸枡鏉$爜琛�
                         var labelModel = new BllBoxInfo()
                         {
@@ -801,14 +809,26 @@
                             BitBoxMark = bNum > boxQty ? "1" : "0",
                             InspectStatus = "0",
 
-                            ProductionTime = DateTime.Parse(productionTime),
-                            StoreTime = string.IsNullOrWhiteSpace(storeTime) ? storeTime2 : DateTime.Parse(storeTime ),
-                            ExpirationTime = DateTime.Parse(expirationTime),
+                            ProductionTime = null,
+                            StoreTime = null,
+                            ExpirationTime = null,
 
                             Origin = "WMS鐢熸垚",
                             CreateUser = userId,
                             CreateTime = DateTime.Now,
                         };
+                        if (!string.IsNullOrEmpty(productionTime))
+                        {
+                            labelModel.ProductionTime = DateTime.Parse(productionTime);
+                        }
+                        if (!string.IsNullOrEmpty(storeTime))
+                        {
+                            labelModel.StoreTime = DateTime.Parse(storeTime);
+                        }
+                        if (!string.IsNullOrEmpty(expirationTime))
+                        {
+                            labelModel.ExpirationTime = DateTime.Parse(expirationTime);
+                        }
 
                         Db.Insertable(labelModel).ExecuteCommand();
                         modelList.Add(labelModel);
@@ -953,14 +973,26 @@
                                 BitBoxMark = bNum > boxQty ? "1" : "0",
                                 InspectStatus = "0",
 
-                                ProductionTime = DateTime.Parse(productionTime),
-                                StoreTime = DateTime.Parse(storeTime),
-                                ExpirationTime = DateTime.Parse(expirationTime),
+                                ProductionTime = null,
+                                StoreTime = null,
+                                ExpirationTime = null,
 
                                 Origin = "WMS鐢熸垚",
                                 CreateUser = userId,
                                 CreateTime = DateTime.Now,
                             };
+                            if (!string.IsNullOrEmpty(productionTime))
+                            {
+                                labelModel.ProductionTime = DateTime.Parse(productionTime);
+                            }
+                            if (!string.IsNullOrEmpty(storeTime))
+                            {
+                                labelModel.StoreTime = DateTime.Parse(storeTime);
+                            }
+                            if (!string.IsNullOrEmpty(expirationTime))
+                            {
+                                labelModel.ExpirationTime = DateTime.Parse(expirationTime);
+                            }
 
                             Db.Insertable(labelModel).ExecuteCommand();
                             modelList.Add(labelModel);
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 581136c..a0d0221 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -1406,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("璇ョ鐮佷俊鎭敊璇紝瀛樺湪澶氫釜姝ょ鐮佷俊鎭�");
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
index 9cfa5f7..b53143b 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -92,7 +92,7 @@
                 }
                 //鍑哄簱鍒嗛厤淇℃伅
                 var allot = await Db.Queryable<BllExportAllot>().FirstAsync(m =>
-                    m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.SONo == soNo &&
+                    m.IsDel == "0" && (m.Status == "2" || m.Status == "3" || m.Status == "5") && m.SONo == soNo &&
                     m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo);
                 if (allot == null)
                 {
@@ -322,7 +322,7 @@
                 else
                 {
                     List<DataBoxInfo> boxInfos;
-                    var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
+                    var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo && m.Status == "2");
                     if (await boxInfo.CountAsync() == 0)
                     {
                         throw Oops.Bah("鏈煡璇㈠埌璇ョ鐮佺殑淇℃伅");
@@ -1852,7 +1852,7 @@
                 return allotList;
             }
             //鑾峰彇鐘舵�佷负寰呮嫞璐ф垨鑰呴儴鍒嗘嫞璐х殑鍑哄簱鍗�
-            var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
+            var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3" || m.Status == "5") && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
 
             //var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList();
             //鑾峰彇鍑哄簱鍗曟嵁涓嶄负寰呮嫞璐� 鎵ц瀹屾瘯 璁㈠崟鍏抽棴 绛夊緟鎵ц鐨勫崟鎹�
@@ -1927,7 +1927,7 @@
                 throw Oops.Bah("鎵樼洏鐮佷负绌猴紝璇疯緭鍏ユ墭鐩樼爜");
             }
             //鑾峰彇鐘舵�佷负寰呮嫞璐ф垨鑰呴儴鍒嗘嫞璐х殑鍑哄簱鍗�
-            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.PalletNo == palletNo);
+            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3" || m.Status == "5") && m.PalletNo == palletNo);
             //var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && m.Status != "4" && m.Status != "5");
             if (!string.IsNullOrWhiteSpace(soNo))
             {
@@ -1949,7 +1949,7 @@
         //鑾峰彇鍑哄簱鍙c�佽鏍笺�佸緟鎷e強宸叉嫞鏁伴噺锛堟牴鎹嚭搴撳崟鏄庣粏ID銆佹墭鐩樺彿锛�
         public async Task<OutPdaInfo> GetOutlets(string soDetailId, string palletNo)
         {
-            var allotInfo = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToListAsync();
+            var allotInfo = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3" || m.Status == "5")).ToListAsync();
             if (allotInfo.Count == 0)
             {
                 throw Oops.Bah($"{palletNo}鎵樼洏涓婃湭鏌ヨ鍒板垎閰嶄俊鎭紝璇锋牳瀹�");
@@ -2033,7 +2033,7 @@
             }
             if (!string.IsNullOrWhiteSpace(soDetailId))
             {
-                var allotInfos = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToListAsync();
+                var allotInfos = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3" || m.Status == "5")).ToListAsync();
                 if (allotInfos.Count == 0)
                 {
                     throw Oops.Bah($"{palletNo}鎵樼洏涓婃湭鏌ヨ鍒板垎閰嶄俊鎭紝璇锋牳瀹�");

--
Gitblit v1.8.0