| | |
| | | if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230||x.TaskState == (int)TaskInStatusEnum.RGV_TransFer|| x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskSecond != null) |
| | | { |
| | | if (taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_Indispatch || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_InAwaitWMS || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | |
| | | { |
| | | if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskSecond != null) |
| | | { |
| | | if (taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_Indispatch || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_InAwaitWMS || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | |
| | | try |
| | | { |
| | | var tasks = _taskService.QueryRGVTask(); |
| | | Dt_Task task; |
| | | Dt_Task task = new Dt_Task(); |
| | | if (tasks.Count() == 0) |
| | | { |
| | | return null; |
| | |
| | | { |
| | | if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskSecond != null) |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskSecond != null) |
| | | { |
| | | task = GetDispatchTask(tasks, taskSecond); |
| | | |
| | |
| | | return task; |
| | | } |
| | | } |
| | | var taskNews = tasks.Where(x => (x.TaskType == (int)TaskInboundTypeEnum.Inbound && Convert.ToInt32(x.SourceAddress) < 1015) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound && (x.Roadway == "SC01" || x.Roadway == "SC02" || x.Roadway == "SC03")) || x.RGVName == "RGV01").ToList(); |
| | | var taskNews = tasks.Where(x => (x.TaskType == (int)TaskInboundTypeEnum.Inbound && (Convert.ToInt32(x.SourceAddress) < 1015|| Convert.ToInt32(x.SourceAddress)>1031)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound && (x.Roadway == "SC01" || x.Roadway == "SC02" || x.Roadway == "SC03")) || x.RGVName == "RGV01").ToList(); |
| | | if (taskNews.Count == 0) |
| | | { |
| | | return null; |
| | |
| | | if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | |
| | | var taskFirst = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | var taskFirst = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskFirst != null) |
| | | { |
| | | task = GetDispatchTask(tasks, taskFirst); |
| | |
| | | |
| | | return task; |
| | | } |
| | | |
| | | } |
| | | var taskNews = tasks.Where(x => (x.TaskType == (int)TaskInboundTypeEnum.Inbound && Convert.ToInt32(x.SourceAddress) > 1014) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound && (x.Roadway == "SC04" || x.Roadway == "SC05" || x.Roadway == "SC06")) || x.RGVName == "RGV02").ToList(); |
| | | var taskNews = tasks.Where(x => (x.TaskType == (int)TaskInboundTypeEnum.Inbound && Convert.ToInt32(x.SourceAddress) > 1014 && Convert.ToInt32(x.SourceAddress)<1031) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound && (x.Roadway == "SC04" || x.Roadway == "SC05" || x.Roadway == "SC06")) || x.RGVName == "RGV02").ToList(); |
| | | if (taskNews.Count == 0) |
| | | { |
| | | return null; |
| | |
| | | try |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => x.Floor == "1F" && (x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish || x.TaskState == (int)TaskOutStatusEnum.RGV_TransFerFInish)); |
| | | Dt_Task task; |
| | | Dt_Task task = new Dt_Task(); |
| | | if (tasks.Count() == 0) |
| | | { |
| | | return null; |
| | |
| | | if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskSecond != null) |
| | | { |
| | | if (taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | |
| | | if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)) |
| | | { |
| | | |
| | | var taskFirst = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState < 230) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | var taskFirst = _taskRepository.QueryFirst(x => x.RGVName == "RGV01" && x.TaskNum == commonRGVFirst.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound))); |
| | | if (taskFirst != null) |
| | | { |
| | | if (taskFirst.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || taskFirst.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || taskFirst.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | |
| | | |
| | | public Dt_Task? GetDispatchTask(List<Dt_Task> tasks, Dt_Task oldtask) |
| | | { |
| | | Dt_Task y = tasks.Where(x => x.Remark != null && ((x.SourceStation - oldtask.TargetStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.SourceStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TargetStation - oldtask.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound))).FirstOrDefault(); |
| | | Dt_Task y = tasks.Where(x => x.Remark != null&& ((x.SourceStation - oldtask.TargetStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.SourceStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TargetStation - oldtask.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound))).FirstOrDefault(); |
| | | if (y == null) |
| | | { |
| | | LogAndWarn("æ¥è¯¢ä»»å¡", $" è¿åä»»å¡ï¼ã{JsonConvert.SerializeObject(oldtask)}ãã"); |
| | | if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || oldtask.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | | { |
| | | |
| | | return tasks.FirstOrDefault(x => (x.SourceStation - oldtask.TargetStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.SourceStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TargetStation - oldtask.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound)); |
| | | } |
| | | else if ((oldtask.CurrentAddress == "1025" || oldtask.CurrentAddress == "1026") && (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting)) |
| | | { |
| | | return tasks.FirstOrDefault(x => (x.SourceStation - oldtask.TargetStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.SourceStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TargetStation - oldtask.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound)); |
| | | } |
| | | else if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting) |
| | | { |
| | | return tasks.FirstOrDefault(x => x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.TargetStation > 1); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | else |
| | |
| | | } |
| | | if (next != null) |
| | | { |
| | | oldtask.Remark = next; |
| | | _taskRepository.UpdateData(oldtask); |
| | | return oldtask; |
| | | y.Remark = next; |
| | | _taskRepository.UpdateData(y); |
| | | LogAndWarn("ä¸è½¬ä»»å¡", $" è¿åä»»å¡ï¼ã{JsonConvert.SerializeObject(y)}ãã"); |
| | | return y; |
| | | } |
| | | } |
| | | if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || oldtask.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) |
| | |
| | | |
| | | public Dt_Task? GetDispatchExecutingTask(Dt_Task oldtask) |
| | | { |
| | | |
| | | var stationManager = _stationManagerRepository.QueryData(x => x.stationType == 15); |
| | | if (stationManager.Count() > 0) |
| | | { |
| | |
| | | { |
| | | oldtask.Remark = next; |
| | | _taskRepository.UpdateData(oldtask); |
| | | LogAndWarn("ä¸è½¬ä»»å¡GetDispatchExecutingTask", $" è¿åä»»å¡ï¼ã{JsonConvert.SerializeObject(oldtask)}ãã"); |
| | | return oldtask; |
| | | } |
| | | } |