| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | // 查询平台信息 |
| | | 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(); |
| | |
| | | _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" }); |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode); |
| | | if (task != null) |
| | | { |
| | | if (command.Barcode == task.PalletCode) |
| | |
| | | WriteInfo(conveyorLine.DeviceName, logs); |
| | | |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | _taskService.UpdateData(newTask); |
| | | } |
| | | } |
| | | } |
| | |
| | | _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" }); |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode); |
| | | if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish) |
| | | { |
| | | if (command.Barcode == task.PalletCode && childDeviceCode == task.NextAddress) |
| | |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | |
| | | // 查询正在执行的输送线任务,根据任务号和子设备代码获取任务信息 |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode); |
| | | |
| | | // 如果任务存在 |
| | | if (task != null) |
| | |
| | | |
| | | // 标记输送线发送任务完成 |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | _taskService.UpdateData(newTask); |
| | | } |
| | | } |
| | | } |
| | |
| | | WriteInfo(conveyorLine.DeviceName, logs); |
| | | |
| | | // 查询正在执行的输送线任务 |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode); |
| | | |
| | | // 如果任务存在 |
| | | if (task != null) |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTrayOutTask; |
| | | |
| | | var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1"); |
| | | |
| | | List<Dt_DeviceInfo> device; |
| | | if (platform.Roadway != null) |
| | | { |
| | | List<string> strings = platform.Roadway.Split(',').ToList(); |
| | | 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 result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = platform.Stacker, AreaCdoes = deviceCode, platform.ProductionLine }.ToJsonString()); |
| | | // 解析返回的JSON数据 |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | |
| | | Console.WriteLine($"{JsonConvert.SerializeObject(content)}呼叫成功"); |
| | | |
| | | // 检查返回状态,如果失败则返回 |
| | | if (!content.Status) |
| | |
| | | |
| | | #endregion 调用WMS获取出库任务 |
| | | |
| | | |
| | | // 创建并发送任务 |
| | | CreateAndSendTask(taskDTO); |
| | | } |