| | |
| | | Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active"); |
| | | if (platform != null && !string.IsNullOrEmpty(platform.Location)) |
| | | { |
| | | if (platform.PlatCode == "1299" || platform.PlatCode == "1295" || platform.PlatCode == "1291" || platform.PlatCode == "1287" || platform.PlatCode == "1283") |
| | | if (platform.PlatCode == "2040" || platform.PlatCode == "2036" || platform.PlatCode == "2032" || platform.PlatCode == "2028" || platform.PlatCode == "2024") |
| | | { |
| | | Platform platformJZ = _platFormRepository.QueryFirst(x => x.PlatCode == "10086" && x.Status == "Active"); |
| | | if (platformJZ != null) |
| | |
| | | } |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // //ConsoleHelper.WriteErrorLine("静置空托不允许出料"); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | //var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode,command.Barcode); |
| | | if (taskInTray != null && taskInTray.TaskType == (int)TaskInboundTypeEnum.InTray) |
| | | { |
| | | RequestInNextAddress(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | |
| | | // 如果已有任务数量小于指定索引 |
| | | if (tasks.Count < Location.Count) |
| | | { |
| | | ConsoleHelper.WriteSuccessLine($"{childDeviceCode}"); |
| | | return childDeviceCode; |
| | | } |
| | | else |
| | |
| | | _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) |
| | |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | if (newTask != null) |
| | | { |
| | | |
| | | //ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask); |
| | | //taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | var next = newTask.NextAddress; |
| | |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | _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) |
| | |
| | | { |
| | | // 查询输送线任务,根据输送线设备和子设备代码获取任务信息 |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.Barcode); |
| | | |
| | | // 输出成功信息,包括输送线名称、任务号、托盘条码和子设备代码,以及任务信息 |
| | | var logs = $"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,task{task.ToJsonString()}"; |
| | |
| | | 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 (newTask != null) |
| | | { |
| | | //_taskService.UpdateData(newTask); |
| | | // 获取下一目标地址 |
| | | var next = newTask.NextAddress; |
| | | |
| | |
| | | |
| | | // 标记输送线发送任务完成 |
| | | 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) |