From c9cd6646fdd1296a7feeb4384ebfe06ab90a52d7 Mon Sep 17 00:00:00 2001
From: IPC-610 <IPC-610@DESKTOP-6LEOOS3>
Date: 星期三, 27 十一月 2024 08:25:17 +0800
Subject: [PATCH] 修改批次长度判断 ,批次长度增加为11位和12位

---
 Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs    |   10 +++++-----
 Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs |    2 +-
 HTML/views/ASNSetting/ArrivalNotice.html        |    3 +++
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/HTML/views/ASNSetting/ArrivalNotice.html b/HTML/views/ASNSetting/ArrivalNotice.html
index 9bf5690..8fba9f5 100644
--- a/HTML/views/ASNSetting/ArrivalNotice.html
+++ b/HTML/views/ASNSetting/ArrivalNotice.html
@@ -909,6 +909,8 @@
 			//鏄庣粏琛ㄦ搷浣滄爮浜嬩欢
 			table.on('tool(LAY-app-content-list2)', function (obj) {
 				var data = obj.data;
+				var lotno = data.LotNo;
+				
 				var id = data.Id;
 				switch(obj.event)
 				{
@@ -955,6 +957,7 @@
 								iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
 									var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈�
 									console.log(field);
+									
 									//鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹�
 									//"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
 									var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty
diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index d7eeeee..dfa78f2 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -348,7 +348,7 @@
                     {
                         if (!TypeLot.Contains(model.Type))
                         {
-                            if (detailModel.LotNo.Length != 10)
+                            if (detailModel.LotNo.Length != 12 && detailModel.LotNo.Length != 11 && detailModel.LotNo.Length != 10)
                             {
                                 strMessage = "-1:杩涘巶缂栧彿浣嶆暟闀垮害鏈夎;";
                                 continue;
diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
index 9ccdc0a..4736f19 100644
--- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -572,7 +572,7 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅");
                 }
-                if (asnList.LotNo.Length != 10)
+                if (asnList.LotNo.Length != 10 && asnList.LotNo.Length != 11 && asnList.LotNo.Length != 12)
                 {
                     throw new Exception("鍗曟嵁杩涘巶缂栧彿浣嶆暟闀垮害閿欒");
                 }
@@ -739,7 +739,7 @@
                             var timeStr = toDayTime.Substring(2, 6);
                             if (lotStr == timeStr)
                             {
-                                maxLotNoStr = toDayTime.Substring(2, 6) + (int.Parse(maxCode.Substring(6, 4)) + 1).ToString().PadLeft(4, '0');
+                                maxLotNoStr = toDayTime.Substring(2, 6) + (int.Parse(maxCode.Substring(maxCode.Length - 4, 4)) + 1).ToString().PadLeft(4, '0');
                             }
                             else
                             {
@@ -783,7 +783,7 @@
                         }
                         else
                         {
-                            maxBoxCode = maxBoxCode.Substring(0, 11) + (int.Parse(maxBoxCode.Substring(11, 6)) + 1).ToString().PadLeft(6, '0'); 
+                            maxBoxCode = maxBoxCode.Substring(0, maxBoxCode.Length - 6) + (int.Parse(maxBoxCode.Substring(maxBoxCode.Length - 6, 6)) + 1).ToString().PadLeft(6, '0'); 
                         } 
                         
                         // 灏嗘潯鐮佷繚瀛樺埌鍘熸枡鏉$爜琛�
@@ -956,7 +956,7 @@
                         }
                         else
                         {
-                            maxboxcode2 = maxboxcode2.Substring(0, 11) + (int.Parse(maxboxcode2.Substring(11, 6)) + 1).ToString().PadLeft(6, '0'); 
+                            maxboxcode2 = maxboxcode2.Substring(0, maxboxcode2.Length - 6) + (int.Parse(maxboxcode2.Substring(maxboxcode2.Length-6, 6)) + 1).ToString().PadLeft(6, '0'); 
                         }
                         //鑾峰彇绠卞唴鏀爣绛炬暟閲�
                         if (i == labelNum2)
@@ -1000,7 +1000,7 @@
                             }
                             else
                             {
-                                maxboxcode3 = maxboxcode3.Substring(0, 11) + (int.Parse(maxboxcode3.Substring(11, 4)) + 1).ToString().PadLeft(4, '0'); 
+                                maxboxcode3 = maxboxcode3.Substring(0, maxboxcode3.Length - 4) + (int.Parse(maxboxcode3.Substring(maxboxcode3.Length - 4, 4)) + 1).ToString().PadLeft(4, '0'); 
                             }
 
                             //var ssss = d.ToString("0");

--
Gitblit v1.8.0