林豪 左 hace 1 año
padre
commit
1a894ece61

+ 6 - 3
业务工程/分拣库/WCS.WorkEngineering/Systems/环形库/机械臂cs.cs

@@ -374,11 +374,14 @@ namespace WCS.WorkEngineering.Systems
                             {
                                 var minDepth = taskInfos!.MinBy(x => x.Depth);
                                 var maxDepth = taskInfos.MaxBy(x => x.Depth);
-                                //物料号不同时只执行一个任务 不同的轮子物料号也不同
-                                if (minDepth.MatCode != maxDepth.MatCode) taskInfos = taskInfos.OrderBy(x => x.ProdLine).Take(1).ToList();
+                                //产品类型不同时,只能取一个
+                                if (minDepth.GoodsType != maxDepth.GoodsType)
+                                {
+                                    //南边取位号较大的,北边取位号较小的
+                                    taskInfos = warehouseCode.Contains("S") ? taskInfos.OrderByDescending(x => x.ProdLine).Take(1).ToList() : taskInfos.OrderBy(x => x.ProdLine).Take(1).ToList();
+                                }
                                 //深度之和等于6(机械臂当前无法同时执行两个三深度的取货任务)
                                 else if (taskInfos.Sum(x => x.Depth) == 6) taskInfos = taskInfos.OrderBy(x => x.ProdLine).Take(1).ToList();
-                                else if (minDepth.GoodsType != maxDepth.GoodsType) taskInfos = taskInfos.OrderBy(x => x.ProdLine).Take(1).ToList();
                                 else if (taskInfos[0].SrmStation != taskInfos[1].SrmStation) taskInfos = taskInfos.OrderBy(x => x.SrmStation).Take(1).ToList();
                                 else if (warehouseCode.Contains("S"))
                                 {