| | |
| | | /// <summary> |
| | | /// 处理新任务 |
| | | /// </summary> |
| | | private async void HandleNewTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | private async Task HandleNewTaskAsync(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationPLC == conveyorLine.DeviceCode); |
| | | |
| | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | //if ((conveyorLine.DeviceCode == "1003" && childDeviceCode == "1016") || (conveyorLine.DeviceCode == "1005" && childDeviceCode == "1048")) |
| | | //{ |
| | | // await CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | //} |
| | | //else if ((conveyorLine.DeviceCode == "1001" && childDeviceCode == "1088") || (conveyorLine.DeviceCode == "1004" && childDeviceCode == "1339")) |
| | | //{ |
| | | // await RequestWmsTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | //} |
| | | //else if ((conveyorLine.DeviceCode == "1001" && childDeviceCode == "1068")) |
| | | //{ |
| | | // ConveyorLineOutFinish(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private async Task RequestWmsTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | |
| | | var content = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); |
| | | if (content.Status) |
| | | { |
| | | var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | if (task.NextAddress.Contains("JZ")) |
| | | if (task.SourceAddress == "1059-4") |
| | | { |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | task.TaskState = nextStatus; |
| | | |
| | | ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{task.TaskNum}】,托盘条码:【{task.PalletCode}】已到达【{childDeviceCode}】请求扫码入库(实盘),下一目标地址【{task.TargetAddress}】"); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, "1000", childDeviceCode); |
| | | |
| | | ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{task.TaskNum}】,托盘条码:【{task.PalletCode}】已到达【{childDeviceCode}】请求扫码入库(实盘),下一目标地址【{1000}】"); |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | } |
| | | else |
| | | { |
| | | //var taskCommand = MapTaskCommand(task, command); |
| | | var next = task.NextAddress; |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | task.NextAddress = next; |