| | |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_SignalR; |
| | |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (conveyorLine != null) |
| | | { |
| | | ConsoleHelper.WriteColorLine("开始:" + DateTime.Now, ConsoleColor.Cyan); |
| | | //ConsoleHelper.WriteColorLine("开始:" + DateTime.Now, ConsoleColor.Cyan); |
| | | // 查询所有子设备的位置 |
| | | List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode); |
| | | // 获取所有站点管理器 |
| | |
| | | |
| | | await Task.WhenAll(tasks); |
| | | |
| | | ConsoleHelper.WriteColorLine("结束:" + DateTime.Now, ConsoleColor.Cyan); |
| | | //ConsoleHelper.WriteColorLine("结束:" + DateTime.Now, ConsoleColor.Cyan); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | // 查询平台信息 |
| | | Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active"); |
| | | Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active"); |
| | | if (platform != null && !string.IsNullOrEmpty(platform.Location)) |
| | | { |
| | | var strings = platform.Location.Split(',').ToList(); |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTrayOutTask; |
| | | |
| | | var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString()); |
| | | List<string> strings = platform.Roadway.Split(',').ToList(); |
| | | List<Dt_DeviceInfo> device; |
| | | if (strings.Count > 0) |
| | | { |
| | | device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && strings.Contains(x.DeviceCode)); |
| | | } |
| | | else |
| | | { |
| | | device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1"); |
| | | } |
| | | var deviceCode = device.Select(x => x.DeviceCode).ToList(); |
| | | |
| | | // 发送HTTP POST请求获取任务数据 |
| | |
| | | var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | if (content.Status) |
| | | { |
| | | Console.WriteLine($"{taskDTO.TaskType}呼叫成功"); |
| | | Console.WriteLine($"{taskDTO.TargetAddress}呼叫成功"); |
| | | } |
| | | return content; |
| | | } |