| 
					
				 | 
			
			
				@@ -3,7 +3,6 @@ using ServiceCenter.Logs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using ServiceCenter.Redis; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using ServiceCenter.SqlSugars; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.ComponentModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Threading.Tasks; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using WCS.Core; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using WCS.Entity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using WCS.WorkEngineering.Extensions; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -207,7 +206,7 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 string barCode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 var agv = db.Default.Queryable<WCS_AgvTaskInfo>().Where(t => t.ID == item.ID).SplitTable(v => v.Take(2)).First() ?? throw new Exception($"未找到对应的AGV任务:{item.ID}"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 //获取对应wcs任务 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                var wcs = db.Default.Queryable<WCS_TaskInfo>().Where(t => t.AgvTaskID == agv.ID && t.Status == Entity.TaskStatus.WaitingToExecute).First() ?? throw new Exception($"AGV任务[{item.ID}]未找到对应的WCS任务");                                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var wcs = db.Default.Queryable<WCS_TaskInfo>().Where(t => t.AgvTaskID == agv.ID && t.Status == Entity.TaskStatus.WaitingToExecute).First() ?? throw new Exception($"AGV任务[{item.ID}]未找到对应的WCS任务"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 switch (wcs.Floor) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     case 1: //一楼下发AGV任务 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -226,7 +225,7 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         if (!string.IsNullOrEmpty(wcs.BarCode) && wcs.BarCode.Contains("-")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                             barCode = wcs.BarCode.Substring(0, wcs.BarCode.IndexOf("-")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                        }                                        
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         var agvRes = IwmsApi.空轮回库(wcs.MatCode, wcs.SrmStation, wcs.IsSurplus, wcs.IsRework, agv.ID, barCode, wcs.AddWho); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         agv.Status = AGVTaskStatus.Confirm; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                         agv.AgvID = agvRes.data; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -255,7 +254,6 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 #region 一楼叉车补空任务处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<WCS_AgvTaskInfo> agvTaskInfos1 = new List<WCS_AgvTaskInfo>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 SqlSugarHelper.Do(db => 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -265,7 +263,7 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (agvTaskInfos1.Any()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    agvTaskInfos1 = agvTaskInfos1.OrderBy(x=>x.AddTime).Take(5).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    agvTaskInfos1 = agvTaskInfos1.GroupBy(GetLineNo).Select(x => x.OrderBy(a => a.AddTime).First()).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     foreach (var item in agvTaskInfos1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         try 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -295,7 +293,7 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                #endregion 移动任务处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                #endregion 一楼叉车补空任务处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             finally 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -307,5 +305,16 @@ namespace WCS.WorkEngineering.Systems 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return dev.Code == "1011"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ///  获取线体号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <param name="agv"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <returns></returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public int GetLineNo(WCS_AgvTaskInfo agv) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //TODO:需确定Station是否在叉车补空任务中对应产线站点 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return int.Parse(agv.Station.Substring(2, 2)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |