From 7584c97271e35d824d592f29c943715e0e2a0d34 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期五, 12 十二月 2025 11:07:43 +0800
Subject: [PATCH] 自动分配AutoAllot增加车间库存条件限制

---
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 66196cd..16cbe17 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -280,7 +280,7 @@
                         sd1 = new DataStockDetail()
                         {
                             LotNo = bind.LotNo,
-                            LotText = bind.LotText,
+                            //LotText = bind.LotText,
                             SupplierLot = bind.SupplierLot,
                             SkuNo = sku.SkuNo,
                             SkuName = sku.SkuName,
@@ -304,7 +304,7 @@
                             ExpirationTime = bind.ExpirationTime,
                             Status = "0",
                             InspectMark = bind.InspectMark,
-                            InspectStatus = sku.IsInspect,
+                            //InspectStatus = sku.IsInspect,
                             BitPalletMark = bind.BitPalletMark,
                             PackagNo = sku.PackagNo,
                             IsBale = bind.IsBale,
@@ -314,13 +314,28 @@
                             CreateUser = 0,
                             CreateTime = comTime
                         };
+
+                        //2025骞�12鏈�04鏃ョ敳鏂硅姹傗�滅敓浜ч��鏂欏叆搴撯�濋粯璁よ川妫�鍚堟牸
+                        if (notice.Type == "8")
+                        {
+                            sd1.InspectStatus = "1";
+                            sd1.LotText = "";
+                        }
+                        else
+                        {
+                            sd1.InspectStatus = sku.IsInspect;
+                            sd1.LotText = bind.LotText;
+                        }
+
+                        //鐢熶骇鏃ユ湡
                         if (!string.IsNullOrEmpty(detail.Lot1))
                         {
-                            sd1.ProductionTime = Convert.ToDateTime(detail.Lot1);//鐢熶骇鏃ユ湡
+                            sd1.ProductionTime = Convert.ToDateTime(detail.Lot1);
                         }
+                        //鍒版湡鏃ユ湡
                         if (!string.IsNullOrEmpty(detail.Lot2))
                         {
-                            sd1.ExpirationTime = Convert.ToDateTime(detail.Lot2);//鍒版湡鏃ユ湡
+                            sd1.ExpirationTime = Convert.ToDateTime(detail.Lot2);
                         }
                         var palletData = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == sd1.PalletNo && !string.IsNullOrEmpty(w.LocatNo));
                         if (palletData != null)
@@ -428,7 +443,7 @@
                                 Standard = sku.Standard,
                                 ProductionTime = box.ProductionTime,
                                 SupplierLot = box.SupplierLot,
-                                InspectStatus = sku.IsInspect,
+                                //InspectStatus = sku.IsInspect,
                                 InspectMark = box.InspectMark,
                                 BitBoxMark = box.BitBoxMark,
                                 ExpirationTime = box.ExpirationTime,
@@ -436,6 +451,9 @@
                                 CreateUser = 0,
                                 CreateTime = comTime
                             };
+                            //2025骞�12鏈�04鏃ョ敳鏂硅姹傗�滅敓浜ч��鏂欏叆搴撯�濋粯璁よ川妫�鍚堟牸
+                            box2.InspectStatus = (notice.Type == "8") ? "1" : sku.IsInspect;
+
                             //娣诲姞搴撳瓨绠辩爜鏄庣粏
                             Db.Insertable(box2).ExecuteCommand();
                             #endregion
@@ -3023,6 +3041,11 @@
                         CreateTime = comTime
                     };
 
+                    //鐪嬭缁戝畾鐨勬墭鐩樺湪搴撳瓨鏄庣粏鏄惁鏈夊偍浣嶄俊鎭�
+                    string locatNoSql = $@"select LocatNo from DataStockDetail where PalletNo='{palletNo}' and isnull(LocatNo,'')!='' group by LocatNo";
+                    string locatNoStr = Db.Ado.GetString(locatNoSql);
+                    sd1.LocatNo = string.IsNullOrWhiteSpace(locatNoStr) ? "" : locatNoStr;
+
                     //娣诲姞搴撳瓨鏄庣粏
                     sdId1 = Db.Insertable(sd1).ExecuteReturnIdentity();
                 }

--
Gitblit v1.8.0