From 4de417b106a062452f5ac86e626e7e225b753eab Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期二, 23 九月 2025 08:03:11 +0800 Subject: [PATCH] 优化问题 --- Wms/WMS.BLL/SysServer/PalletsServer.cs | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-) diff --git a/Wms/WMS.BLL/SysServer/PalletsServer.cs b/Wms/WMS.BLL/SysServer/PalletsServer.cs index d024fa9..f4e202a 100644 --- a/Wms/WMS.BLL/SysServer/PalletsServer.cs +++ b/Wms/WMS.BLL/SysServer/PalletsServer.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; +using System.Security.Policy; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -9,6 +10,7 @@ using Model.ModelDto.LogDto; using Model.ModelDto.SysDto; using SqlSugar; +using Utility.Tools; using WMS.BLL.LogServer; using WMS.Entity.Context; using WMS.Entity.DataEntity; @@ -56,6 +58,7 @@ { Id = m.Id, PalletNo = m.PalletNo, + Standard = m.Standard, Type = m.Type == "0" ? "鎵樼洏" : m.Type == "1" ? "涓浆绠�" : "", Status = m.Status, LastUse = m.LastUse, @@ -120,7 +123,7 @@ /// <param name="locatNo"></param> /// <param name="userId"></param> /// <exception cref="Exception"></exception> - public void AddPallets(string palletNo,string locatNo, string deviceCode, int userId) + public void AddPallets(string palletNo,string locatNo, string deviceCode, string url, int userId) { var db = DataContext.Db; try @@ -156,31 +159,31 @@ { throw new Exception("鏂版坊鍔犵殑妗跺彧鑳界粦瀹氬噣妗跺尯"); } + if (!string.IsNullOrEmpty(deviceCode)) { - var areaInfo = db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.DeviceCode.Contains(deviceCode)); - if (areaInfo == null) + switch (deviceCode) { - throw new Exception("鏈煡鍒拌澶囨墍灞炲尯鍩熶俊鎭�"); + case "400": + deviceCode = "400L"; + break; + case "800": + deviceCode = "800L"; + break; + case "1000": + deviceCode = "1000L"; + break; + default: + throw new Exception("涓嶈兘褰曞叆400锛�800锛�1000浠ュ鐨勫��"); } - //125璁惧鏄帴鏂欏拰娣锋枡涓�浣撴満 - if (deviceCode != "125") - { - if (!areaInfo.AreaName.Contains("鎺ユ枡璁惧")) - { - throw new Exception("鍙兘缁戝畾鎺ユ枡璁惧"); - } - if (areaInfo.WareHouseNo != "M03") - { - throw new Exception("鍙湁澶у崟浣撹溅闂存墠鑳界粦瀹氳澶�"); - } - } + } //寮�鍚簨鍔� db.BeginTran(); palletModel = new SysPallets(); palletModel.PalletNo = palletNo; + palletModel.Standard = deviceCode; palletModel.Type = "0"; palletModel.Status = "0"; palletModel.CreateUser = userId; @@ -220,7 +223,7 @@ PalletStatus = "0",//鍑�妗� - UDF1 = deviceCode, + Standard = deviceCode, //瑙勬牸 IsDel = "0", CreateUser = userId, @@ -232,8 +235,23 @@ //鏇存柊鍌ㄤ綅鐘舵�� locatModel.Status = "1";//鏈夌墿鍝� + locatModel.UpdateTime = DateTime.Now; db.Updateable(locatModel).ExecuteCommand(); + //涓嬪彂AGV缁戝畾杞藉叿鎺ュ彛 + //璋冪敤AGV鎺ュ彛涓嬪彂浠诲姟 + //string agvMsg = string.Empty; + ////缁欎笅杞︿笅鍙戜换鍔� + //var agvResult = RcsHelper.BindPalletAndSite(palletNo, locatNo,url, out agvMsg); + //if (agvResult)//鎴愬姛 + //{ + // //澧炲姞鏃ュ織 + //} + //else//澶辫触 + //{ + // throw new Exception("灏忚溅杞藉叿鍜屽簱浣嶅叧绯荤粦瀹氬け璐ワ紝鍘熷洜锛�"+agvMsg); + //} + //鎻愪氦浜嬪姟 db.CommitTran(); } -- Gitblit v1.8.0