From abff6261e5e74ff16a844f4739f84d49b6133000 Mon Sep 17 00:00:00 2001 From: xxyy <cathay_xy@163.com> Date: 星期六, 15 二月 2025 13:01:02 +0800 Subject: [PATCH] 新增分容空框出库功能及代码结构优化 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs index 6e9638b..2b93a15 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs @@ -16,6 +16,7 @@ using System.Drawing; using WIDESEAWCS_ITaskInfoService; using Mapster; +using AngleSharp.Io; namespace WIDESEAWCS_TaskInfoService { @@ -85,6 +86,40 @@ return content.Error("褰撳墠鎵樼洏瀛樺湪浠诲姟"); } + if (stationManager.stationType == 7) + { + var Station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); + var runTask = await BaseDal.QueryFirstAsync(x => x.SourceAddress == Station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.InNew && x.TaskType == (int)TaskInboundTypeEnum.InTray); + if (runTask != null) + { + runTask.TargetAddress = stationManager.stationLocation; + runTask.NextAddress = stationManager.stationChildCode; + runTask.Grade = 3; + runTask.TaskType = (int)TaskOutboundTypeEnum.InToOut; + + var config1 = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var wmsBase1 = config1.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; + var requestTask1 = config1.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.SetEmptyOutbyInToOutAsync)?.ConfigValue; + if (wmsBase1 == null || requestTask1 == null) + { + throw new InvalidOperationException("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss1 = wmsBase1 + requestTask1; + + var result1 = await HttpHelper.PostAsync(wmsIpAddrss1, new { palletCode = runTask.PalletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode }.ToJsonString()); + content = JsonConvert.DeserializeObject<WebResponseContent>(result1); + if (content.Status) + { + await BaseDal.UpdateDataAsync(runTask); + return content.OK("鎴愬姛"); + } + else + ConsoleHelper.WriteErrorLine(content.Message); + } + else + ConsoleHelper.WriteErrorLine("鏈壘鍒扮┖鎵樼洏鍏ュ簱浠诲姟"); + } + var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestInTask)?.ConfigValue; -- Gitblit v1.9.3