From e2655143a06ee42eec06a97b045f33a09fbb3a3f Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期二, 24 十二月 2024 17:40:18 +0800 Subject: [PATCH] 合并更改 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs index 63f98fd..2c879f9 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs @@ -41,6 +41,7 @@ using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; using WIDESEAWCS_QuartzJob.DTO; +using WIDESEAWCS_QuartzJob.Repository; using WIDESEAWCS_QuartzJob.Service; using WIDESEAWCS_SignalR; using WIDESEAWCS_Tasks.ConveyorLineJob; @@ -62,8 +63,9 @@ private readonly IDt_StationManagerRepository _stationManagerRepository; private readonly ICacheService _cacheService; private readonly INoticeService _noticeService; + private readonly IDeviceInfoRepository _deviceInfoRepository; - public CommonConveyorLine_GWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService) + public CommonConveyorLine_GWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository) { _taskService = taskService; _taskExecuteDetailService = taskExecuteDetailService; @@ -75,6 +77,7 @@ _stationManagerRepository = stationManagerRepository; _cacheService = cacheService; _noticeService = noticeService; + _deviceInfoRepository = deviceInfoRepository; } public Task Execute(IJobExecutionContext context) @@ -434,7 +437,7 @@ taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray; else taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound; - await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker, platform); + await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform); } catch (Exception) { @@ -444,7 +447,7 @@ /// <summary> /// 妫�鏌ヤ换鍔″苟鍒涘缓鏂颁换鍔� /// </summary> - private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, Platform platform) + private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, Platform platform) { var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode); if (tasks.Count < index) @@ -463,10 +466,11 @@ } var wmsIpAddress = wmsBase + requestTrayOutTask; - + var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString()); + var deviceCode = device.Select(x => x.DeviceCode).ToList(); List<string> strings = platform.Location.Split(',').ToList(); - var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = roadWay, AreaCdoes = strings, platform.ProductionLine }.ToJsonString()); + var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.ToJsonString()); //var result = await HttpHelper.PostAsync("http://localhost:5000/api/Task/RequestTrayOutTaskAsync", dynamic.ToJsonString()); WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); -- Gitblit v1.9.3