From 0d453df0e07ec3ada05a53640a35df92f27d4f3e Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期六, 11 一月 2025 14:56:12 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs |  133 +++++++++++++++++++-------------------------
 1 files changed, 58 insertions(+), 75 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
index e40f51a..6163330 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
@@ -27,84 +27,67 @@
         }
 
         static object locker = new object();
-        public override WebResponseContent AddData(SaveModel saveModel)
-        {
-            int warehouseId = 0;
-            int count = 0;
-            if (saveModel.MainData.TryGetValue("warehouseId", out object? warehouse) && warehouse != null)
-            {
-                warehouseId = warehouse.ObjToInt();
-            }
-            if (saveModel.MainData.TryGetValue("count", out object? countValue) && countValue != null)
-            {
-                count = countValue.ObjToInt();
-            }
-            lock (locker)
-            {
-                List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>();
-                int serialNo = 0;
-                DateTime now = DateTime.Now;
-                Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } });
-                if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day)
-                {
-                    serialNo = palletCodeInfo.SerialNo + 1;
+        //public override WebResponseContent AddData(SaveModel saveModel)
+        //{
+        //    int warehouseId = 0;
+        //    int count = 0;
+        //    if (saveModel.MainData.TryGetValue("warehouseId", out object? warehouse) && warehouse != null)
+        //    {
+        //        warehouseId = warehouse.ObjToInt();
+        //    }
+        //    if (saveModel.MainData.TryGetValue("count", out object? countValue) && countValue != null)
+        //    {
+        //        count = countValue.ObjToInt();
+        //    }
+        //    lock (locker)
+        //    {
+        //        List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>();
+        //        int serialNo = 0;
+        //        DateTime now = DateTime.Now;
+        //        Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } });
+        //        if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day)
+        //        {
+        //            serialNo = palletCodeInfo.SerialNo + 1;
 
-                }
-                else
-                {
-                    serialNo = 1;
-                }
-                Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId);
-                string uplen = "";
-                switch (_Warehouse.WarehouseCode)
-                {
-                    case "HA57":
-                        uplen = "B";
-                        break;
-                    case "HA58":
-                        uplen = "P";
-                        break;
-                    case "HA152":
-                        uplen = "G";
-                        break;
-                    case "HA64":
-                        uplen = "S";
-                        break;
-                    case "闃荤剨浠�":
-                        uplen = "Z";
-                        break;
-                    case "HA153":
-                        uplen = "Y";
-                        break;
-                    case "HA71":
-                        uplen = "C";
-                        break;
-                    case "HA60":
-                        uplen = "F";
-                        break;
-                    default:
-                        uplen = "N";
-                        break;
-                };
-                for (int i = 0; i < count; i++)
-                {
+        //        }
+        //        else
+        //        {
+        //            serialNo = 1;
+        //        }
+        //        Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId);
+        //        string uplen = "";
+        //        uplen = _Warehouse.WarehouseCode switch
+        //        {
+        //            "HA57" => "B",
+        //            "HA58" => "P",
+        //            "HA152" => "G",
+        //            "HA64" => "S",
+        //            "闃荤剨浠�" => "Z",
+        //            "HA153" => "Y",
+        //            "HA71" => "C",
+        //            "HA60" => "F",
+        //            _ => "N"
+        //        };
+        //        for (int i = 0; i < count; i++)
+        //        {
 
-                    palletCodeInfos.Add(new Dt_PalletCodeInfo
-                    {
-                        SerialNo = serialNo,
-                        PalletCode = uplen + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'),
-                        PalletType = 1,
-                        PalletTypeId = 0,
-                        WarehouseId = warehouseId,
-                        Status = 0,
-                        Size = 0
-                    });
+        //            palletCodeInfos.Add(new Dt_PalletCodeInfo
+        //            {
+        //                SerialNo = serialNo,
+        //                PalletCode = uplen + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'),
+        //                PalletType = 1,
+        //                PalletTypeId = 0,
+        //                WarehouseId = warehouseId,
+        //                Status = 0,
+        //                Size = 0
+        //            });
 
-                    serialNo = serialNo + 1;
-                }
-                return base.AddData(palletCodeInfos);
-            }
-        }
+        //            serialNo = serialNo + 1;
+        //        }
+        //        return base.AddData(palletCodeInfos);
+        //    }
+        //    }
+        //}
 
 
         public WebResponseContent AddData(int warehouseId, int count, int palletTypeId)

--
Gitblit v1.9.3