From cbd78ef6650440fcaa2f9eb8b47d16ad76cb4d77 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 23 五月 2024 10:26:07 +0800 Subject: [PATCH] 添加叠盘区超时未使用空托入库 --- 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs" index 8ac8691..64201bf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs" @@ -36,6 +36,7 @@ using WIDESEA_Comm.MES_Info; using System.Reflection; using static System.Collections.Specialized.BitVector32; +using WIDESEA_Comm; namespace WIDESEA_WMS.Services { @@ -224,6 +225,8 @@ public override WebResponseContent Del(object[] keys, bool delList = true) { WebResponseContent content = new WebResponseContent(); + VOLContext context = new VOLContext(); + Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); string str = ""; try { @@ -244,7 +247,7 @@ detail detail = new detail(); detail.sn = inventory.SN; lists.Add(detail); - str = str == "" ? inventory.SN : "," + inventory.SN; + str += str == "" ? inventory.SN : "," + inventory.SN; } agvInWarehousePara outWarehousePara = new agvInWarehousePara() { @@ -268,6 +271,33 @@ foreach (var inventory in inventorys) { + var station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault(); + station.quantity = station.quantity - 1; + if (station.quantity == 0) + { + station.stationType = string.Empty; + station.heatNumber = string.Empty; + station.Number = string.Empty; + station.billetID = string.Empty; + station.bindSN = string.Empty; + station.enable = false; + station.tray_status = string.Empty; + station.location_state = LocationStateEnum.Empty.ToString(); + } + else + { + var bindSNS = station.bindSN.Split(","); + station.bindSN = ToMesServer.OperStr(bindSNS, inventory.SN); + var billetS = station.billetID.Split(","); + station.billetID = ToMesServer.OperStr(billetS, inventory.BilletNumber.ToString()); + } + + #region 鍙栨秷璺熻釜DbContext涓璺熻釜鐨勫疄浣� + var currentEntry = stationinfoRepository.DbContext.ChangeTracker.Entries<dt_stationinfo>().FirstOrDefault(); + if (currentEntry != null) currentEntry.State = EntityState.Detached; + #endregion + + stationinfoRepository.Update(station, true); _repository.Delete(inventory, true); } WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", $"璐т綅缂栧彿锛歿inventorys.Key}锛汼N鍙凤細{str}", LogState.Sucess, "WMS", UserContext.Current.UserName); -- Gitblit v1.9.3