From 047e8be481b2b626a5dbcc613b5f2e77323239be Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期四, 20 三月 2025 14:27:36 +0800 Subject: [PATCH] 更新配置和任务处理逻辑 --- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs | 66 +++++++++----------------------- 1 files changed, 19 insertions(+), 47 deletions(-) diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs index 0a71bac..4638dac 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs @@ -2,6 +2,7 @@ using Mapster; using Newtonsoft.Json; using System.Diagnostics.CodeAnalysis; +using WIDESEAWCS_BasicInfoRepository; using WIDESEAWCS_Common; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core; @@ -227,22 +228,22 @@ return content.Error($"銆恵stationManager.stationChildCode}銆戝凡瀛樺湪鐩存帴鍑哄簱浠诲姟浠诲姟"); } - if (stationManager.stationType == 7) - { - var result = await HandleStationType7(palletCode, stationManager); - if (result != null) - { - return result; - } - } - else if (stationManager.stationType == 6) - { - var result = await HandleStationType6(palletCode, stationManager); - if (result != null) - { - return result; - } - } + //if (stationManager.stationType == 7) + //{ + // var result = await HandleStationType7(palletCode, stationManager); + // if (result != null) + // { + // return result; + // } + //} + //else if (stationManager.stationType == 6) + //{ + // var result = await HandleStationType6(palletCode, stationManager); + // if (result != null) + // { + // return result; + // } + //} // 鍙戣捣璇锋眰鑾峰彇鍏ュ簱浠诲姟 content = await RequestInTask(palletCode, stationManager); @@ -279,38 +280,9 @@ } // 澶勭悊 stationType 涓� 7 鐨勬儏鍐� - private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager) + private async Task<WebResponseContent> HandleStationType7(Dt_StationManager stationManager) { - var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); - var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray); - - if (runTask != null) - { - runTask.TargetAddress = stationManager.stationLocation; - runTask.NextAddress = stationManager.stationChildCode; - runTask.Grade = 3; - runTask.TaskType = (int)TaskOutboundTypeEnum.InToOut; - runTask.TaskState = (int)TaskOutStatusEnum.OutNew; - - var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.SetEmptyOutbyInToOutAsync); - var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = runTask.PalletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = station.stationChildCode }.ToJsonString()); - var content = JsonConvert.DeserializeObject<WebResponseContent>(result); - - if (content.Status) - { - await BaseDal.UpdateDataAsync(runTask); - ConsoleHelper.WriteSuccessLine($"銆恵runTask.PalletCode}鐩存帴鍑哄簱鑷充簩灏併��"); - return content.OK("鎴愬姛"); - } - else - { - ConsoleHelper.WriteErrorLine(content.Message); - } - } - else - { - ConsoleHelper.WriteErrorLine($"銆恵station.stationChildCode}銆戞湭鎵惧埌绌烘墭鐩樺叆搴撲换鍔�"); - } + var station = await _taskNeedBarcodeRepository.QueryFirstAsync(x => x.toArea == stationManager.stationChildCode && x.productLine == stationManager.productLine); return null; } -- Gitblit v1.9.3