| | |
| | | case 9: |
| | | case 11: |
| | | case 12: |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode); |
| | |
| | | // command.ConveyorLineBarcode = taskGW.PalletCode; |
| | | //} |
| | | //} |
| | | //如高温出库后任务标记NG异常则将任务更新为异常排出任务 |
| | | Dt_Task NGtask = _taskRepository.QueryFirst(x => x.Remark == "NG" && x.Roadway == stationManager.Roadway && x.Roadway.Contains("GW")); |
| | | if (NGtask != null) |
| | | { |
| | | CreateAbNormalOutbound(conveyorLine, command, childDeviceCode, NGtask); |
| | | break; |
| | | } |
| | | //如高温出库后任务标记NG异常则将任务更新为异常排出任务 --冠宇取消超时检测后 托盘超时不在出库至异常口 |
| | | //Dt_Task NGtask = _taskRepository.QueryFirst(x => x.Remark == "NG" && x.Roadway == stationManager.Roadway && x.Roadway.Contains("GW")); |
| | | //if (NGtask != null) |
| | | //{ |
| | | // CreateAbNormalOutbound(conveyorLine, command, childDeviceCode, NGtask); |
| | | // break; |
| | | //} |
| | | |
| | | RequestWmsTask(conveyorLine, command, childDeviceCode); |
| | | break; |
| | |
| | | { |
| | | if (command.ConveyorLineBarcode != "NoRead") |
| | | { |
| | | var taskDTO = CreateEmptyTrayTaskDto(command.ConveyorLineBarcode, childDeviceCode); |
| | | |
| | | if (_taskRepository.QueryFirst(x => x.PalletCode == taskDTO.PalletCode) != null) |
| | | var config = _sys_ConfigService.GetByConfigKey("SYS_BASE", "ISFRINTRAY"); |
| | | if (config.ConfigValue == "1") |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, "当前托盘存在任务"); |
| | | return; |
| | | } |
| | | |
| | | var content = CreateAndSendTask(taskDTO); |
| | | if (content.Status) |
| | | { |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |
| | | Random random = new Random(); |
| | | var task = new Dt_Task() |
| | | { |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | //ConveyorLineSendFinish(conveyorLine, childDeviceCode, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | CurrentAddress = childDeviceCode, |
| | | Grade = 1, |
| | | NextAddress = "2066", |
| | | PalletCode = command.ConveyorLineBarcode, |
| | | Roadway = "FR", |
| | | SourceAddress = childDeviceCode, |
| | | TargetAddress = "2066", |
| | | TaskNum = random.Next(1,9999), |
| | | TaskType = (int)TaskInboundTypeEnum.InTray, |
| | | TaskState = (int)TaskInStatusEnum.Line_InExecuting, |
| | | WMSId = 0 |
| | | }; |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | } |
| | | else |
| | | { |
| | | var taskDTO = CreateEmptyTrayTaskDto(command.ConveyorLineBarcode, childDeviceCode); |
| | | |
| | | if (_taskRepository.QueryFirst(x => x.PalletCode == taskDTO.PalletCode) != null) |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, "当前托盘存在任务"); |
| | | return; |
| | | } |
| | | |
| | | var content = CreateAndSendTask(taskDTO); |
| | | if (content.Status) |
| | | { |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | //ConveyorLineSendFinish(conveyorLine, childDeviceCode, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationPLC == conveyorLine.DeviceCode); |
| | | |
| | | if (command.ConveyorLineBarcode.IsNullOrEmpty()) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 2, childDeviceCode); |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (conveyorLine.ReadValue(ConveyorLineDBName_After.InteractiveSignal, childDeviceCode).ObjToInt() == 0) //托盘正反信号 |
| | | { |
| | | |
| | | }; |
| | | |
| | | conveyorLine.ReadValue(ConveyorLineDBName_After.InteractiveSignal, childDeviceCode); //托盘有无电芯信号 |
| | | |
| | | |
| | | |
| | | } |
| | | |