From 52af69dd4c1be4ec93e012013dee78c3105998ec Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期四, 06 三月 2025 16:34:27 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/SysServer/PalletsServer.cs |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/Wms/WMS.BLL/SysServer/PalletsServer.cs b/Wms/WMS.BLL/SysServer/PalletsServer.cs
index 622d79e..8691b93 100644
--- a/Wms/WMS.BLL/SysServer/PalletsServer.cs
+++ b/Wms/WMS.BLL/SysServer/PalletsServer.cs
@@ -120,7 +120,7 @@
         /// <param name="locatNo"></param>
         /// <param name="userId"></param>
         /// <exception cref="Exception"></exception>
-        public void AddPallets(string palletNo,string locatNo,int userId)
+        public void AddPallets(string palletNo,string locatNo, string deviceCode, int userId)
         {
             var db = DataContext.Db;
             try
@@ -155,6 +155,22 @@
                 if (!areaModel.AreaName.Contains("鍑�妗�"))
                 {
                     throw new Exception("鏂版坊鍔犵殑妗跺彧鑳界粦瀹氬噣妗跺尯");
+                }
+                if (!string.IsNullOrEmpty(deviceCode))
+                {
+                    var areaInfo = db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.DeviceCode.Contains(deviceCode));
+                    if (areaInfo == null)
+                    {
+                        throw new Exception("鏈煡鍒拌澶囨墍灞炲尯鍩熶俊鎭�");
+                    }
+                    if (!areaInfo.AreaName.Contains("鎺ユ枡璁惧"))
+                    {
+                        throw new Exception("鍙兘缁戝畾鎺ユ枡璁惧");
+                    }
+                    if (areaInfo.WareHouseNo != "M03")
+                    {
+                        throw new Exception("鍙湁澶у崟浣撹溅闂存墠鑳界粦瀹氳澶�");
+                    }
                 }
                 //寮�鍚簨鍔�
                 db.BeginTran();
@@ -200,9 +216,12 @@
 
                     PalletStatus = "0",//鍑�妗�
 
+                    UDF1 = deviceCode,
+
                     IsDel = "0",
                     CreateUser = userId,
-                    CreateTime = comTime
+                    CreateTime = comTime,
+                    UpdateTime=comTime,                   
                 };
                 //鎻掑叆搴撳瓨鏄庣粏
                 db.Insertable(model).ExecuteCommand();

--
Gitblit v1.8.0