From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 09 七月 2025 22:55:27 +0800 Subject: [PATCH] 增加质检出入库逻辑 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs | 32 +++++++++++--------------------- 1 files changed, 11 insertions(+), 21 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" index 5f67e6c..7409c06 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" @@ -9,6 +9,7 @@ using WIDESEA_Model.Models; using WIDESEAWCS_DTO.WCSInfo; using WIDESEA_DTO.WCSInfo; +using WIDESEA_Common.TaskEnum; namespace WIDESEA_TaskInfoService { @@ -107,40 +108,29 @@ BaseDal.UpdateData(task); return content; } - if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"鏈壘鍒版墭鐩樺彿[{lineDTO.Barcode}]鐨勫叆搴撲换鍔�"); + if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt() && task.TaskType != TaskTypeEnum.InQuality.ObjToInt()) throw new Exception($"鏈壘鍒版墭鐩樺彿[{lineDTO.Barcode}]鐨勫叆搴撲换鍔�"); - //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"鎵樼洏鍙穂{lineDTO.Barcode}]鐨勫叆搴撲换鍔$姸鎬佷笉鍖归厤"); + #region 鍒ゆ柇搴撳瓨鐘舵�� + Dt_InventoryInfo inventoryInfo = _stockService.InventoryInfoService.Repository.QueryFirst(x => x.PalletCode == lineDTO.Barcode); + if (inventoryInfo == null) throw new Exception("鏈壘鍒扮粍鐩樹俊鎭�"); + if (inventoryInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt()) throw new Exception("璇ョ粍鐩樼姸鎬佷笉鍙叆搴�"); + if (!string.IsNullOrEmpty(inventoryInfo.LocationCode)) throw new Exception("璇ユ墭鐩樺凡缁戝畾璐т綅"); - Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode); - (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo); - if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); - - Dt_StockInfoDetail? stockInfoDetail = stockInfo.Details.FirstOrDefault(); - - if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//妫�娴嬫潯浠堕渶鏇存敼锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒 - { - //task.NextAddress = "101"; - //task.TaskState = (int)InTaskStatusEnum.InException; - task.Remark = $"鎵樼洏[{lineDTO.Barcode}]瓒呴噸"; - //task.Remark = $"鎵樼洏[{lineDTO.Barcode}]淇℃伅涓嶅悎鏍�"; - //stockInfo.StockStatus = StockStatusEmun.鍏ュ簱鎾ら攢.ObjToInt(); - } + if (lineDTO.Weight > 1500) task.Remark = $"鎵樼洏[{lineDTO.Barcode}]瓒呴噸"; else { task.NextAddress = "1004"; task.CurrentAddress = lineDTO.stationCode; task.Remark = string.Empty; task.TaskState = (int)InTaskStatusEnum.Line_InExecuting; - stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(); - if (stockInfoDetail != null) stockInfoDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt(); + inventoryInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(); } + #endregion #region 浜嬪姟 Db.Ado.BeginTran(); BaseDal.UpdateData(task); - _stockService.StockInfoService.Repository.UpdateData(stockInfo); - if (stockInfoDetail != null) _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); - //Db.Updateable(stockInfo).ExecuteCommand(); + _stockService.InventoryInfoService.Repository.UpdateData(inventoryInfo); Db.Ado.CommitTran(); #endregion if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark); -- Gitblit v1.9.3