| | |
| | | using WIDESEAWCS_Model.Models; |
| | | using static Dm.net.buffer.ByteArrayBuffer; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_DTO.Agv; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | agvTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt(); |
| | | //agvTask.Remark = content.Data.ObjToString(); |
| | | _taskService.UpdateTask(agvTask, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | _taskService.UpdateData(newTasks); |
| | | //鍑哄簱缁戝畾鏌ヨ |
| | | Dt_Task outBound = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.Exception.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode) && x.TaskType==TaskTypeEnum.Outbound.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x=>x.CreateDate).First(); |
| | | if (outBound != null) |
| | | { |
| | | AgvPodBerthAndMatDTO andMatDTO = new AgvPodBerthAndMatDTO() |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString().Replace("-", ""), |
| | | PositionCode=outBound.TargetAddress |
| | | }; |
| | | WebResponseContent content = _taskService.AgvPodBerthAndMat(andMatDTO); |
| | | if (content.Status) |
| | | { |
| | | outBound.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | outBound.ExceptionMessage = ""; |
| | | //agvTask.Remark = content.Data.ObjToString(); |
| | | _taskService.UpdateTask(outBound, TaskStatusEnum.AGV_Execute); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | if (WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | if (WaitToTasks.FirstOrDefault(x=>x.TaskState==TaskStatusEnum.AGV_Puting.ObjToInt())!=null) |
| | | if (WaitToTasks.FirstOrDefault(x=>x.TaskState==TaskStatusEnum.AGV_Puting.ObjToInt() || x.TaskState == TaskStatusEnum.Finish.ObjToInt()) !=null) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | WaitToTask.TaskState = TaskStatusEnum.AGV_Puting.ObjToInt(); |
| | | _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Puting); |
| | | break; |
| | | } |
| | | else if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | WaitToTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt(); |
| | | _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Executing); |
| | | } |
| | | else |
| | | { |
| | | WaitToTask.TaskState = TaskStatusEnum.Exception.ObjToInt(); |
| | | WaitToTask.ExceptionMessage = content.Message; |
| | | _taskService.UpdateTask(WaitToTask, TaskStatusEnum.Exception); |
| | | } |
| | | } |
| | | _taskService.UpdateData(WaitToTasks); |