| | |
| | | } |
| | | } |
| | | //å
许æ¾è¡ä¸å·å¼æå£åºåºä»»å¡ |
| | | bool outAllow = device.Communicator.Read<bool>("DB14.4.6"); |
| | | if (outAllow) |
| | | bool outAllowLine1 = device.Communicator.Read<bool>("DB14.4.6"); |
| | | if (outAllowLine1) |
| | | { |
| | | Dt_Task taskExcuting = _taskRepository.QueryFirst(x => x.WarehouseId== warehouseDevice.WarehouseId && (x.TargetAddress== "SCUTL-001" || x.TargetAddress == "1101") |
| | | && (x.TaskState==TaskStatusEnum.SC_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() |
| | |
| | | WriteDebug($"ä¸å·å¼æå£æ¾è¡ä»»å¡", $"ä»»å¡å·{taskExecute.TaskNum}"); |
| | | } |
| | | } |
| | | //å
许æ¾è¡äºå·å¼æå£åºåºä»»å¡ |
| | | bool outAllowLine2 = device.Communicator.Read<bool>("DB14.12.6"); |
| | | if (outAllowLine2) |
| | | { |
| | | Dt_Task taskExcuting = _taskRepository.QueryFirst(x => x.WarehouseId == warehouseDevice.WarehouseId && (x.TargetAddress == "SCUTL-002" || x.TargetAddress == "1103") |
| | | && (x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() |
| | | || x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt())); |
| | | Dt_Task? taskExecute = _taskRepository.QueryData(x => x.WarehouseId == warehouseDevice.WarehouseId && x.TargetAddress == "SCUTL-002" |
| | | && x.TaskState == TaskStatusEnum.MesPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).ThenBy(x => x.CreateDate).FirstOrDefault(); |
| | | if (taskExcuting == null && taskExecute != null) |
| | | { |
| | | _taskService.UpdateTask(taskExecute, TaskStatusEnum.SC_Execute); |
| | | WriteDebug($"äºå·å¼æå£æ¾è¡ä»»å¡", $"ä»»å¡å·{taskExecute.TaskNum}"); |
| | | } |
| | | } |
| | | //å
许æ¾è¡æå¨å¼æå£åºåºä»»å¡ |
| | | bool outAllowMusual = device.Communicator.Read<bool>("DB14.4.7"); |
| | | if (outAllowMusual) |
| | | { |
| | | Dt_Task taskExcuting = _taskRepository.QueryFirst(x => x.WarehouseId == warehouseDevice.WarehouseId && (x.TargetAddress == "SCUTL_04-001" || x.TargetAddress == "1102") |
| | | && (x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() |
| | | || x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt())); |
| | | Dt_Task? taskExecute = _taskRepository.QueryData(x => x.WarehouseId == warehouseDevice.WarehouseId && x.TargetAddress == "SCUTL_04-001" |
| | | && x.TaskState == TaskStatusEnum.MesPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).ThenBy(x => x.CreateDate).FirstOrDefault(); |
| | | if (taskExcuting == null && taskExecute != null) |
| | | { |
| | | _taskService.UpdateTask(taskExecute, TaskStatusEnum.SC_Execute); |
| | | WriteDebug($"æå¨å¼æå£æ¾è¡ä»»å¡", $"ä»»å¡å·{taskExecute.TaskNum}"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |