From 9ff4a447bc9b8a7ff1f09dfee1ce2f1263dccca2 Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期三, 11 六月 2025 14:38:50 +0800
Subject: [PATCH] 添加叠托机申请接口

---
 Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
index f6d72cd..ace488b 100644
--- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -657,7 +657,7 @@
                 {
                     if (pack.L2Name != "鎵�")
                     {
-                        packLevel = 2;
+                        packLevel = 1;//JC34椤圭洰鍙湁涓�绾ф爣绛�
                         bNum = Convert.ToInt32(pack.L2Num);
                     }
                 }
@@ -710,14 +710,14 @@
                     #endregion
 
                     int labelNum = 1; //鐢熶骇鏉$爜鏁伴噺
-                    if (zNum > 0)
-                    {
-                        labelNum = int.Parse(Math.Ceiling(qty / zNum).ToString());//鏍囩鏁伴噺
-                    }
-                    else
-                    {
-                        throw new Exception("褰撳墠鍗曟嵁鐗╂枡鏄竴绾у寘瑁咃紝鏈煡璇㈠埌涓�绾у寘瑁呬俊鎭�");
-                    }
+                    //if (zNum > 0)
+                    //{
+                        labelNum = int.Parse(Math.Ceiling(qty / bNum).ToString());//鏍囩鏁伴噺
+                    //}
+                    //else
+                    //{
+                    //    throw new Exception("褰撳墠鍗曟嵁鐗╂枡鏄竴绾у寘瑁咃紝鏈煡璇㈠埌涓�绾у寘瑁呬俊鎭�");
+                    //}
 
                     #region 鑾峰彇/鐢熸垚鎵规鍙�
 
@@ -734,32 +734,33 @@
                         if (i == labelNum)
                         {
                             // 鏈�鍚庝竴涓潯鐮�
-                            var s = zNum * (i - 1);
-                            if (zNum > qty - s)
+                            var s = bNum * (i - 1);
+                            if (bNum > qty - s)
                             {
                                 boxQty = qty - s;// 鏁伴噺
                             }
                             else
                             {
-                                boxQty = zNum;// 鏁伴噺
+                                boxQty = bNum;// 鏁伴噺
                             }
                         }
                         else
                         {
-                            boxQty = zNum;         // 鏁伴噺
+                            boxQty = bNum;         // 鏁伴噺
                         }
 
                         //鑾峰彇绠辩爜
                         if (string.IsNullOrWhiteSpace(maxBoxCode))
                         {
-                            var str = "B" + maxLotNoStr + "000001"; //鎵瑰彿+ 娴佹按  2302010001000001
+                            var str = "B" + maxLotNoStr + "000001"; //鎵瑰彿+ 娴佹按  B 230201 0001  000001
                             maxBoxCode = str;
                         }
                         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');
                         }
 
+                        DateTime? storeTime2 = null;
                         // 灏嗘潯鐮佷繚瀛樺埌鍘熸枡鏉$爜琛�
                         var labelModel = new BllBoxInfo()
                         {
@@ -780,7 +781,7 @@
                             InspectStatus = "0",
 
                             ProductionTime = DateTime.Parse(productionTime),
-                            StoreTime = DateTime.Parse(storeTime),
+                            StoreTime = string.IsNullOrWhiteSpace(storeTime) ? storeTime2 : DateTime.Parse(storeTime ),
                             ExpirationTime = DateTime.Parse(expirationTime),
 
                             Origin = "WMS鐢熸垚",

--
Gitblit v1.8.0