From d24fd92f40757374cf60f1148a91acb0cfb06287 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 21 三月 2024 16:58:52 +0800
Subject: [PATCH] 将托盘绑定限制条件修改为标签页,增加托盘绑定页单据下是否有贴标物料及方法。

---
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 52 insertions(+), 8 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index c3031a1..afd992f 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -69,7 +69,17 @@
                 sqlString = $"select * from BllArrivalNoticeDetail where ASNNo = '{model.ASNNo}' and isdel='0' order by CreateTime;";
                 var modelList = Db.Ado.SqlQuery<ArrivalNoticeDetailDto>(sqlString);
 
-                return modelList;
+                List<ArrivalNoticeDetailDto> list = new List<ArrivalNoticeDetailDto>();
+                foreach (var item in modelList)
+                {
+                    string str = BySkuNoGetPackInfo(item.SkuNo);
+                    if (str == "涓嶅瓨鍦�")
+                    {
+                        list.Add(item);
+                    }
+                }
+
+                return list;
             }
             catch (Exception ex)
             {
@@ -1752,11 +1762,44 @@
                         }
                     }
                 }
-                return noticeList;
+                List<ArrivalNoticeDetailDto> list = new List<ArrivalNoticeDetailDto>();
+                foreach (var item in noticeList)
+                {
+                    string str = BySkuNoGetPackInfo(item.SkuNo);
+                    if (str == "瀛樺湪")
+                    {
+                        list.Add(item);
+                    }
+                }
+
+                return list;
             }
             catch (Exception ex)
             {
                 throw ex;
+            }
+        }
+
+        //鏍规嵁鐗╂枡鑾峰彇鏄惁瀛樺湪鍖呰淇℃伅
+        public string BySkuNoGetPackInfo(string skuNo)
+        {
+            try
+            {
+                //鑾峰彇鐗╂枡淇℃伅
+                var sku = Db.Queryable<SysMaterials>().First(a => a.IsDel == "0" && a.SkuNo == skuNo);
+                //鍒ゆ柇鐗╂枡淇℃伅鏄惁涓虹┖
+                if (!string.IsNullOrWhiteSpace(sku.PackagNo))
+                {
+                    return "瀛樺湪";
+                }
+                else
+                {
+                    return "涓嶅瓨鍦�";
+                }
+            }
+            catch (Exception ex)
+            {
+                return ex.Message;
             }
         }
 
@@ -1816,7 +1859,7 @@
                     }
                 }
                 //鍒ゆ柇鐗╂枡鏁伴噺鏄惁涓�0 涓�0鍒ゆ柇绠辩爜淇℃伅 涓嶄负0缁х画
-                if (model.SkuQty == 0)
+                if (model.TableType == 0)
                 {
                     if (string.IsNullOrEmpty(model.BoxNo))
                     {
@@ -1832,6 +1875,7 @@
 
                     }
                 }
+                int isTextTable = model.TableType;
                 int isDeposit = 0;
                 //鍒ゆ柇鎬诲崟鍗曟嵁鏄惁涓哄瘎瀛樺崟鎹�
                 if (notice.Type == "7")
@@ -1909,7 +1953,7 @@
                 var bNum = 0;//绠辩爜鐗╁搧鏁伴噺 
 
                 //鍒ゆ柇鏄惁涓哄瘎瀛樼墿鏂�
-                if (isDeposit == 0)
+                if (isDeposit == 0 && isTextTable == 0)
                 {
                     if (pack == null)
                     {
@@ -1988,7 +2032,7 @@
                         Demo = model.Demo,
 
                     };
-                    if (model.SkuQty > pNum && isDeposit == 0)
+                    if (model.TableType == 0 && isDeposit == 0 && isTextTable == 0)
                     {
                         throw new Exception($"缁戝畾澶辫触锛寋model.PalletNo}鎵樼洏缁戝畾鏁伴噺澶т簬璇ョ墿鍝佹墭鐩樺寘瑁呮暟閲忥紒");
                     }
@@ -2038,7 +2082,7 @@
                 // 鏇存敼绠辨敮鍏崇郴琛�
                 decimal factQty = 0.00m;//鎵樼洏鎬绘暟閲�
                 //鎴愬搧缁勬墭
-                if (model.SkuQty == 0)
+                if (isTextTable == 0)
                 {
                     var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList();
                     foreach (var g in boxGroup)
@@ -2078,7 +2122,7 @@
                     // 鏇存柊鎵樼洏缁戝畾琛�
                     bind.Qty += factQty;
                 }
-                if (bind.FullQty < bind.Qty && isDeposit == 0)
+                if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0)
                 {
                     throw new Exception("鎵樼洏缁戝畾鏁伴噺宸茶秴鍑鸿鐗╂枡鍖呰鏁伴噺");
                 }
@@ -2087,7 +2131,7 @@
                 {
                     bind.BitPalletMark = "0";
                 }
-                if (bind.Qty > pNum && isDeposit == 0)
+                if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0)
                 {
                     throw new Exception($"缁戝畾澶辫触锛寋bind.PalletNo}鎵樼洏缁戝畾鏁伴噺澶т簬璇ョ墿鍝佹墭鐩樺寘瑁呮暟閲忥紒");
                 }

--
Gitblit v1.8.0