| | |
| | | /// <param name="command"></param> |
| | | public void EmptySeatAllow(CommonConveyorLine device, StackPlateTaskCommandCommand command) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => x.DeviceCode == device.DeviceCode && (x.TaskState == (int)TaskStatusEnum.AGV_Execute||x.TaskState==(int)TaskStatusEnum.AGV_Executing)); |
| | | if (tasks.Count > 0 && tasks.Count < 9) |
| | | var station = _stationMangerRepository.QueryFirst(x => x.StationDeviceCode == device.DeviceCode); |
| | | var tasks = _taskRepository.QueryData(x => x.Roadway == device.DeviceCode && (x.TaskState == (int)TaskStatusEnum.AGV_Execute || x.TaskState == (int)TaskStatusEnum.AGV_Executing) && x.TargetAddress == device.DeviceCode); |
| | | if (tasks.Count + Convert.ToInt32(command.Num) < 9) |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => x.DeviceCode == device.DeviceCode && x.TaskState == (int)TaskStatusEnum.StackPlate_Execute); |
| | | if(task!= null) |
| | | var task = _taskRepository.QueryFirst(x => x.Roadway == device.DeviceCode && x.TaskState == (int)TaskStatusEnum.StackPlate_Execute); |
| | | if (task != null && station != null) |
| | | { |
| | | task.TaskState = (int)TaskStatusEnum.AGV_Execute; |
| | | _taskRepository.UpdateData(task); |
| | | station.Remark = task.PalletCode; |
| | | _stationMangerRepository.UpdateData(station); |
| | | } |
| | | } |
| | | } |