Pārlūkot izejas kodu

库前路径配置、放货站点更新

xu.lu 2 gadi atpakaļ
vecāks
revīzija
486f17f435

+ 49 - 12
成品库/WCS.WorkEngineering/Systems/NoInteractionSystems.cs

@@ -63,23 +63,61 @@ namespace WCS.WorkEngineering.Systems
                                     }
                                     else if (task.Type == TaskType.OutDepot)
                                     {
-                                        if (task.SrmStation.IsNullOrEmpty()) //如果没有指定放货站台
+                                        //if (task.SrmStation.IsNullOrEmpty()) //如果没有指定放货站台
+                                        //{
+                                        //    //获取堆垛机到目标地址的路径信息
+                                        //    var path = DevicePath.GetPath(task.Device, task.AddrTo);
+                                        //    task.SrmStation = path.Points[1].Code;
+                                        //}
+                                        string putStation = "";
+                                        if (task.AddrTo == "8278")
                                         {
-                                            //获取堆垛机到目标地址的路径信息
-                                            var path = DevicePath.GetPath(task.Device, task.AddrTo);
-                                            task.SrmStation = path.Points[1].Code;
+                                            switch (task.Tunnel)
+                                            {
+                                                case "1":
+                                                    putStation = "8271";
+                                                    break;
+                                                case "2":
+                                                    putStation = "8272";
+                                                    break;
+                                                case "3":
+                                                    putStation = "8273";
+                                                    break;
+                                                case "4":
+                                                    putStation = "8274";
+                                                    break;
+                                                case "5":
+                                                    putStation = "8275";
+                                                    break;
+                                            }
+                                        }
+                                        else if (task.AddrTo == "8263" || task.AddrTo == "8257" || task.AddrTo == "8269")
+                                        {
+                                            switch (task.Tunnel)
+                                            {
+                                                case "1":
+                                                    putStation = "8251";
+                                                    break;
+                                                case "2":
+                                                    putStation = "8248";
+                                                    break;
+                                                case "3":
+                                                    putStation = "8247";
+                                                    break;
+                                                case "4":
+                                                    putStation = "8245";
+                                                    break;
+                                                case "5":
+                                                    putStation = "8242";
+                                                    break;
+                                            }
                                         }
                                         //更新任务状态
                                         task.Status = Entity.TaskStatus.WaitingToExecute;
+                                        task.SrmStation = putStation;
                                         db.Default.Updateable(task).ExecuteCommand();
                                         task.AddWCS_TASK_DTL(db, task.Device, $"初始化出库任务信息,放货站台:{task.SrmStation}");
-                                    }
-                                    else if (task.Type == TaskType.Delivery) //一楼叉车搬运任务
-                                    {
-                                    }
-                                    else if (task.Type == TaskType.EmptyInit)
-                                    {
-                                    }
+                                    }                                                                  
                                 });
                             }
                             catch (Exception ex)
@@ -102,7 +140,6 @@ namespace WCS.WorkEngineering.Systems
                 RedisHub.Default.Del(key);
             }
         }
-
         public override bool Select(Device dev)
         {
             return dev.Code == "8271";

+ 2 - 7
成品库/WCS.WorkEngineering/Systems/出库分配目标地址.cs

@@ -34,14 +34,12 @@ namespace WCS.WorkEngineering.Systems
 
         public override void Do(Device<IStation520, IStation521, IStation523> obj)
         {
-
             //if (obj.Entity.Code == "8273" && obj.Data2.Request == 1 && obj.Data.GoodsEnd != 8271)
             //{
             //    obj.Data.TaskNumber = obj.Data2.TaskNumber;
             //    obj.Data.GoodsEnd = 8271;
             //    obj.Data.VoucherNo ++;
             //}
-
             //return;
 
             //if (obj.Data2.TaskNumber <= 0)
@@ -67,15 +65,12 @@ namespace WCS.WorkEngineering.Systems
             //    obj.Data.TaskNumber = obj.Data2.TaskNumber;
             //    obj.Data.GoodsEnd = 8278;
             //    obj.Data.VoucherNo++;
-            //});
-            
-
-            
+            //});                       
         }
 
         public override bool Select(Device dev)
         {
-            return new string[] { "8271", "8272", "8273", "8274", "8275" }.Contains(dev.Code);
+            return new string[] { "8263", "8257", "8269" }.Contains(dev.Code);
         }
     }
 }

+ 1 - 17
成品库/WCS.WorkEngineering/Systems/堆垛机.cs

@@ -147,7 +147,6 @@ namespace WCS.WorkEngineering.Systems
                                 default:
                                     break;
                             }
-
                             break;
 
                         case TaskType.TransferDepot:
@@ -156,7 +155,6 @@ namespace WCS.WorkEngineering.Systems
                             db.Default.Updateable(task).ExecuteCommand();
                             task.AddWCS_TASK_DTL(db, task.AddrTo, "移库任务结束");
                             break;
-
                     }                   
                     taskInfo = task;                   
                     if (task.Status >= TaskStatus.Finish) task.CompleteOrCancelTasks(db);                   
@@ -168,12 +166,9 @@ namespace WCS.WorkEngineering.Systems
                     WmsApi.CompleteTask(taskInfo.ID);
                 }
                 obj.Data.OkAck = 1;
-                //通知WMS任务完成
-                               
-
+                //通知WMS任务完成                              
                 World.Log($"堆垛机任务处理:结束--完成任务{obj.Data2.TaskFinishiId}", LogLevelEnum.Mid);
             }
-
             #endregion 处理完成任务
 
             //堆垛机是否可以下发任务
@@ -183,10 +178,8 @@ namespace WCS.WorkEngineering.Systems
 
             //默认没有移库任务
             bool isTransfer = false;
-
             //出入库优先级任务 1:无优先 2:入库 3:出库
             int enterOrOut = 1;
-
             //再检查是否有等待执行的货物
             SqlSugarHelper.Do(db =>
             {
@@ -211,7 +204,6 @@ namespace WCS.WorkEngineering.Systems
                     }
                 }
             });
-
             #region 移库
 
             if (isTransfer)
@@ -248,18 +240,13 @@ namespace WCS.WorkEngineering.Systems
             }
 
             #endregion 移库
-
             #region 出入库
-
             //上一个周期是不是出库任务 第一次获取返回结果会是false
             var lastIsOut = obj.Entity.GetFlag<bool>("LastIsOut");
             obj.Entity.SetFlag("LastIsOut", !lastIsOut);
-
-
             //入库任务优先 或 上一个周期是出库任务并且出库任务无优先
             if (enterOrOut == 2 || (lastIsOut && enterOrOut == 1)) //入库任务
             {
-
                 //判断本次优先执行楼层,并设置下次执行时优先楼层
                 //var floor = obj.Entity.GetFlag<int>("FloorIn");
                 //floor = floor % 2 + 1;
@@ -415,12 +402,9 @@ namespace WCS.WorkEngineering.Systems
                 obj.Data.TaskType = SrmTaskType.Default;
                 obj.Data.VoucherNo++;
                 World.Log($"堆垛机任务处理:结束---下发出库任务[{obj.Data.TaskNumber}][{obj.Data.SLine}][{obj.Data.SCol}][{obj.Data.SLayer}][{obj.Data.ELine}][{obj.Data.ECol}][{obj.Data.ELayer}][{obj.Data.TaskType}][{obj.Data.VoucherNo}]", LogLevelEnum.Mid);
-
             }
-
             #endregion 出入库
         }
-
         public override bool Select(Device dev)
         {
             return dev.HasProtocol(typeof(ISRM520));

+ 2 - 2
成品库/WCS.WorkEngineering/Systems/成品入库.cs

@@ -79,7 +79,7 @@ namespace WCS.WorkEngineering.Systems
                     SRM srm = null;
                     List<Station> stations = new List<Station>();
                     //成品库库前堆垛机取货点
-                    stations = devs.Where(v => v.Entity.Code is "8001" or "8002" or "8003" or "8004" or "8005").ToList();
+                    stations = devs.Where(v => v.Entity.Code is "8250" or "8249" or "8246" or "8244" or "8243").ToList();
                     //筛选出可用站台c
                     stations = stations.Where(v => v.Data.VoucherNo == v.Data2.VoucherNo && v.Data3.Status.HasFlag(StationStatus.Auto))
                                        .Where(v => !v.Data3.Status.HasFlag(StationStatus.PH_Status) && !v.Data3.Status.HasFlag(StationStatus.OT_Status))
@@ -135,7 +135,7 @@ namespace WCS.WorkEngineering.Systems
         }
         public override bool Select(Device dev)
         {
-            return dev.Code == "";
+            return dev.Code == "8262" || dev.Code == "8270";
         }
     }
 }

+ 1 - 8
成品库/WCS.WorkEngineering/Systems/扫码入库.cs

@@ -68,9 +68,7 @@ namespace WCS.WorkEngineering.Systems
                 {
                     //开始获取堆垛机与可用站台信息
                     var res = WmsApi.GetTunnelPriorityList(taskInfo.ID);
-                    if (res == null) throw new Exception($"未返回巷道");
-
-                    
+                    if (res == null) throw new Exception($"未返回巷道");                    
                     var tunnelNo = res.ResData.Split(",").Select(v => "SRM" + v).ToList();
                     SRM srm = null;
                     List<Station> stations = new List<Station>();
@@ -86,14 +84,10 @@ namespace WCS.WorkEngineering.Systems
                     var count1 = stations.Where(v => v.Data.VoucherNo == v.Data2.VoucherNo && v.Data3.Status.HasFlag(StationStatus.Auto))
                                        .Where(v => !v.Data3.Status.HasFlag(StationStatus.PH_Status) && !v.Data3.Status.HasFlag(StationStatus.OT_Status))
                                        .Where(v => !v.Data3.Status.HasFlag(StationStatus.Run)).ToArray();
-
-
-
                     if (stations == null)
                     {
                         throw new KnownException($"{obj.Entity.Code}无可用放货站台", LogLevelEnum.High);
                     }
-
                     //World.Log($"可用站台信息[{count}]" + JsonConvert.SerializeObject(stations));
                     //可用堆垛机
                     srm = stations.Select(v => v.Entity.Sources).SelectMany(v => v).Where(v => v.IsTunnel()) //上一个地址是巷道的
@@ -123,7 +117,6 @@ namespace WCS.WorkEngineering.Systems
                     //{
                     //    throw new KnownException($"{obj.Entity.Code}有任务或光电", LogLevelEnum.High);
                     //}
-
                     //堆垛机的可用取货站台
                     taskInfo.SrmStation = nextPos.Entity.Code;
                     taskInfo.AddrNext = nextPos.Entity.Sources.First().Code;

+ 26 - 20
成品库/WCS.WorkEngineering/WorkStart.cs

@@ -36,7 +36,8 @@ namespace WCS.WorkEngineering
 
             List<StationSegmentInfo> segmentInfo = new List<StationSegmentInfo>
             {
-                new StationSegmentInfo(8271, 8279, "10.30.43.90")
+                new StationSegmentInfo(8271, 8279, "10.30.43.90"),
+                new StationSegmentInfo(8161, 8270, "10.30.43.93")
             };
 
             foreach (var item in segmentInfo)
@@ -59,7 +60,8 @@ namespace WCS.WorkEngineering
 
             List<BcrInfo> bcrInfo = new List<BcrInfo>
             {
-                new BcrInfo(new int[] {8277}, "10.30.43.90")
+                new BcrInfo(new int[] {8277}, "10.30.43.90"),
+                new BcrInfo(new int[] {8270}, "10.30.43.93")
             };
 
             foreach (var item in bcrInfo)
@@ -78,9 +80,8 @@ namespace WCS.WorkEngineering
             #region 外检信息
             //要按先后顺序,后面添加外检要注意
             List<ShapeInfo> shapeInfo = new List<ShapeInfo>
-            {
-                new ShapeInfo(new int[] {8277}, "10.30.43.90")
-            };
+            { new ShapeInfo(new int[] { 8277 }, "10.30.43.90"), 
+              new ShapeInfo(new int[] { 8270 }, "10.30.43.93") };
 
             foreach (var item in shapeInfo)
             {
@@ -146,27 +147,32 @@ namespace WCS.WorkEngineering
             {
                     new RouteInfo("SRM1", new string[] { "TY1" }),
                     new RouteInfo("SRM2", new string[] { "TY2" }),
-                    //new RouteInfo("SRM3", new string[] { "TY3" }),
-                    //new RouteInfo("SRM4", new string[] { "TY4" }),
-                    //new RouteInfo("SRM5", new string[] { "TY5" }),
+                    new RouteInfo("SRM3", new string[] { "TY3" }),
+                    new RouteInfo("SRM4", new string[] { "TY4" }),
+                    new RouteInfo("SRM5", new string[] { "TY5" }),
                     new RouteInfo("TY1", new string[] { "SRM1" }),
                     new RouteInfo("TY2", new string[] { "SRM2" }),
-                    //new RouteInfo("TY3", new string[] { "SRM3" }),
-                    //new RouteInfo("TY4", new string[] { "SRM4" }),
-                    //new RouteInfo("TY5", new string[] { "SRM5" }),
+                    new RouteInfo("TY3", new string[] { "SRM3" }),
+                    new RouteInfo("TY4", new string[] { "SRM4" }),
+                    new RouteInfo("TY5", new string[] { "SRM5" }),
 
                     //入
-                    new RouteInfo("TY1", new string[] { "8271" }),
-                    new RouteInfo("TY2", new string[] { "8272" }),
-                    //new RouteInfo("TY3", new string[] { "8273" }),
-                    //new RouteInfo("TY4", new string[] { "8274" }),
-                    //new RouteInfo("TY5", new string[] { "8275" }),
+                    new RouteInfo("TY1", new string[] { "8271" ,"8250"}),
+                    new RouteInfo("TY2", new string[] { "8272" ,"8249"}),
+                    new RouteInfo("TY3", new string[] { "8273" ,"8246"}),
+                    new RouteInfo("TY4", new string[] { "8274" ,"8244"}),
+                    new RouteInfo("TY5", new string[] { "8275" ,"8243"}),
                     //出
                     new RouteInfo("8271", new string[] { "TY1" }),
                     new RouteInfo("8272", new string[] { "TY2" }),
-                    //new RouteInfo("8273", new string[] { "TY3" }),
-                    //new RouteInfo("8274", new string[] { "TY4" }),
-                    //new RouteInfo("8275", new string[] { "TY5" }),
+                    new RouteInfo("8273", new string[] { "TY3" }),
+                    new RouteInfo("8274", new string[] { "TY4" }),
+                    new RouteInfo("8275", new string[] { "TY5" }),
+                    new RouteInfo("8251", new string[] { "TY1" }),
+                    new RouteInfo("8248", new string[] { "TY2" }),
+                    new RouteInfo("8247", new string[] { "TY3" }),
+                    new RouteInfo("8245", new string[] { "TY4" }),
+                    new RouteInfo("8242", new string[] { "TY5" }),
 
                     //new RouteInfo("8271", new string[] { "8278" }),
                     //new RouteInfo("8272", new string[] { "8278" }),
@@ -195,7 +201,7 @@ namespace WCS.WorkEngineering
 
             Dictionary<DeviceFlags, List<string>> devices = new Dictionary<DeviceFlags, List<string>>
             {
-                { DeviceFlags.入库, new List<string>() { "8271", "8272", "8273", "8274", "8275" } },
+                { DeviceFlags.入库, new List<string>() { "8271", "8272", "8273", "8274", "8275", "8250", "8249", "8246", "8244", "8243"} },
                 { DeviceFlags.出库, new List<string>() { "8271", "8272", "8273", "8274", "8275" } },
                 { DeviceFlags.扫码, new List<string>() {"8277"} },
                 { DeviceFlags.出库口, new List<string>() { "8271","8272", "8273", "8274", "8275" } }