| | |
| | | |
| | | using AutoMapper; |
| | | using HslCommunication; |
| | | using Microsoft.CodeAnalysis; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using SqlSugar; |
| | |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | using Platform = WIDESEAWCS_Model.Models.Platform; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | /// <param name="command">读取的请求信息</param> |
| | | /// <param name="childDeviceCode">子设备编号</param> |
| | | /// <param name="index">线体当前bool读取偏移地址</param> |
| | | public async void EmptyTrayReturn(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, int index, Platform platform) |
| | | public async void EmptyTrayReturn(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, int index, WIDESEAWCS_Model.Models.Platform platform) |
| | | { |
| | | try |
| | | { |
| | |
| | | taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray; |
| | | else |
| | | taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound; |
| | | await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker); |
| | | await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker, platform); |
| | | } |
| | | catch (Exception) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 检查任务并创建新任务 |
| | | /// </summary> |
| | | private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, List<string> roadways = null) |
| | | private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, Platform platform) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode); |
| | | if (tasks.Count < index) |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTrayOutTask; |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = roadWay, roadways = roadways }.ToJsonString()); |
| | | |
| | | 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("http://localhost:5000/api/Task/RequestTrayOutTaskAsync", dynamic.ToJsonString()); |
| | | |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |