From 115be938117d1b127627f5a4146c8a170939bcc2 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期二, 19 三月 2024 11:11:10 +0800
Subject: [PATCH] bug修复

---
 Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
index 6d8448d..3eaa00c 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -409,6 +409,7 @@
                     throw new Exception("鏈煡璇㈠埌璇ユ墭鐩樺垎閰嶇殑搴撳瓨淇℃伅锛�");
                 }
                 #endregion
+
                 if (string.IsNullOrWhiteSpace(boxNo))//鏁存墭鎷h揣
                 {
                     List<DataBoxInfo> boxInfos;
@@ -515,6 +516,8 @@
                         throw new Exception("鏈煡璇㈠埌璇ョ鐮佸強杩芥函鐮佺殑淇℃伅");
                     }
                     boxInfos = boxInfo.ToList();
+
+                    var comDetailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToList();
                     if (!string.IsNullOrWhiteSpace(boxNo3)) //鏁f敮鎷h揣
                     {
                         boxInfos = boxInfos.Where(m => m.BoxNo3 == boxNo3).ToList();
@@ -536,6 +539,14 @@
                         if (boxQty > needQty)
                         {
                             throw new Exception("鎷h揣鏁伴噺涓嶈兘澶т簬鍓╀綑寰呮嫞鏁伴噺");
+                        }
+
+                        foreach (var item in boxInfos)
+                        {
+                            if (biaoShi != "2" && comDetailList.Any(m => m.BoxNo3 == item.BoxNo3))
+                            {
+                                throw new Exception($"褰撳墠{item.BoxNo}涓瓄item.BoxNo3}宸叉嫞璐у畬鎴愶紝璇峰嬁閲嶅鎷h揣");
+                            }
                         }
 
                         biaoShi = "1";
@@ -573,16 +584,20 @@
                         {
                             throw new Exception("鎷h揣鏁伴噺涓嶈兘澶т簬绠卞唴鍓╀綑寰呮嫞鏁伴噺");
                         }
+
+                        foreach (var item in boxInfos)
+                        {
+                            if (biaoShi != "2" && comDetailList.Any(m => m.BoxNo == item.BoxNo))
+                            {
+                                throw new Exception($"褰撳墠{item.BoxNo}宸叉嫞璐у畬鎴愶紝璇峰嬁閲嶅鎷h揣");
+                            }
+                        }
                     }
                     var pickQty = 0;//鎷h揣鐨勬暟閲�
-                    var comDetailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToList();
+                    
                     var comList = new List<BllCompleteDetail>();
                     foreach (var item in boxInfos)
                     {
-                        if (biaoShi != "2" && comDetailList.Any(m => m.BoxNo3 == item.BoxNo3))
-                        {
-                            throw new Exception($"褰撳墠{item.BoxNo}涓瓄item.BoxNo3}宸叉嫞璐у畬鎴愶紝璇峰嬁閲嶅鎷h揣");
-                        }
                         //娣诲姞鎷h揣鏄庣粏
                         var completeDetail = new BllCompleteDetail()
                         {

--
Gitblit v1.8.0