| | |
| | | if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null) |
| | | { |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | if (conveyorLineInfoRead.StatusPV == 3 && conveyorLineInfoRead.Command == 11) |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.StatusPV == 2 && conveyorLineInfoRead.Command == 11) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && (x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.RGV_Executing.ObjToInt() || x.TaskState == TaskStatusEnum.New.ObjToInt())); |
| | | if (task == null) |
| | | { |
| | | //è·åç«å° |
| | | //è·åç«å°çæä»»å¡ |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple("", item.StationCode); |
| | | //string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, "AGV_CP"); |
| | | //if (string.IsNullOrEmpty(locationCode) && task.TaskType != TaskTypeEnum.EmptyProductBack.ObjToInt()) |
| | | //{ |
| | | // WriteError(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | // continue; |
| | | //} |
| | | if (content.Status) |
| | | { |
| | | Dt_Task taskNew = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && (x.TaskState == TaskStatusEnum.New.ObjToInt())); |
| | |
| | | _taskService.UpdateTask(taskNew, TaskStatusEnum.RGV_Execute); |
| | | } |
| | | } |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | } |