From 3b3f39b55ba6d04a95536bebd6233b2a6e464290 Mon Sep 17 00:00:00 2001 From: xxyy <cathay_xy@163.com> Date: 星期二, 18 二月 2025 10:20:02 +0800 Subject: [PATCH] 更新命名空间、异常处理和任务逻辑 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 48 insertions(+), 2 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs index a86d379..dbd804c 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs @@ -1,5 +1,4 @@ 锘縰sing Masuit.Tools; -using WIDESEA_Common; using WIDESEA_Common.CustomModels; //using WIDESEA_Common.CustomModels; @@ -1156,10 +1155,11 @@ #endregion #region 鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱 + public async Task<WebResponseContent> SetEmptyOutbyInToOutAsync(RequestTaskDto request) { WebResponseContent content = new WebResponseContent(); - var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode && x.CurrentAddress == request.Position); + var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode); if (!task.IsNullOrEmpty()) { var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position); @@ -1194,4 +1194,50 @@ } #endregion + + #region 鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱 + + /// <summary> + /// 鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱 + /// </summary> + /// <param name="request"></param> + /// <returns></returns> + public async Task<WebResponseContent> SetEmptyOutbyInToOutOneAsync(RequestTaskDto request) + { + WebResponseContent content = new WebResponseContent(); + var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode); + if (!task.IsNullOrEmpty()) + { + var toStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position); + var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == toStation.productLine && x.stationArea == toStation.stationArea); + if (!fromStation.IsNullOrEmpty()) + { + //var location = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress && x.AreaId == int.Parse(fromStation.stationArea)); + task.SourceAddress = toStation.stationLocation; + task.CurrentAddress = toStation.stationChildCode; + task.Grade = 3; + task.TaskType = (int)TaskOutboundTypeEnum.InToOut; + task.TaskState = (int)TaskOutStatusEnum.OutNew; + + //location.LocationStatus = (int)LocationEnum.Free; + + //await _locationRepository.UpdateDataAsync(location); + await BaseDal.UpdateDataAsync(task); + return content.OK("鎴愬姛"); + } + else + { + ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒板搴旂珯鍙�"); + content.Error("鏈壘鍒板搴旂珯鍙�"); + } + } + else + { + ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒颁换鍔�"); + content.Error("鏈壘鍒颁换鍔�"); + } + return content; + } + + #endregion } \ No newline at end of file -- Gitblit v1.9.3