林豪 左 hace 1 año
padre
commit
8b23a9e55b

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/AgvSystems.cs

@@ -139,7 +139,7 @@ namespace WCS.WorkEngineering.Systems
                                 switch (agv.AgvStatus)
                                 {
                                     case AGVTaskStatus.NewBuild when agv.Status == AGVTaskStatus.NewBuild:
-                                        AgvApi.托盘回库(agv.Position, agv.ID.ToString());
+                                        AgvApi.托盘回库(agv.Position, agv.ID.ToString(), agv.Station);
                                         agv.AgvID = agv.ID.ToString();
                                         agv.Status = AGVTaskStatus.Confirm;
                                         agv.AgvStatus = AGVTaskStatus.Confirm;

+ 10 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/NoInteractionSystems.cs

@@ -182,7 +182,16 @@ namespace WCS.WorkEngineering.Systems
                                                 Status = AGVTaskStatus.NewBuild,
                                                 TaskId = task.ID,
                                                 Position = task.WorkBench,
-                                                Station = "2501",
+                                                Station = task.WarehouseCode switch
+                                                {
+                                                    "1N" => "2501",
+                                                    "1S" => "2701",
+                                                    "2N" => "2901",
+                                                    "2S" => "3101",
+                                                    "3N" => "3301",
+                                                    "3S" => "3501",
+                                                    _ => throw new NotImplementedException(),
+                                                },
                                                 AddWho = "WCS",
                                                 AddTime = DateTime.Now
                                             };

+ 2 - 2
业务工程/分拣库/WCS.WorkEngineering/Systems/码垛区域生成空托盘任务.cs

@@ -35,7 +35,7 @@ namespace WCS.WorkEngineering.Systems
                 {
                     var db = _db.Default;
                     //取一个时间最靠前的,没有绑定码垛工位的码垛记录
-                    var palletizingInfoList = db.Queryable<WCS_Palletizing>().Where(x => x.PalletizingStation == null && !x.Finish).OrderBy(x => x.AddTime).ToList();
+                    var palletizingInfoList = db.Queryable<WCS_Palletizing>().Where(x => x.PalletizingStation == null && !x.Finish && !x.isItHalf).OrderBy(x => x.AddTime).ToList();
                     if (!palletizingInfoList.Any())
                     {
                         World.Log("没有码垛信息可用!");
@@ -134,7 +134,7 @@ namespace WCS.WorkEngineering.Systems
                         var dev = Device.All.Where(x => x.Code == addrFrom.Code).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
                         if (dev.Data.TaskNumber != 0 || dev.Data.GoodsEnd != 0)
                         {
-                            World.Log($"{dev.Entity.Code}有残留任务信息 {dev.Data.TaskNumber} - {dev.Data.GoodsEnd} ,请处理!理!");
+                            World.Log($"{dev.Entity.Code}有残留任务信息 {dev.Data.TaskNumber} - {dev.Data.GoodsEnd} ,请处理!");
                             return;
                         }
 

+ 41 - 7
业务工程/分拣库/WCS.WorkEngineering/WebApi/Controllers/AgvApi.cs

@@ -1,5 +1,4 @@
-using PlcSiemens.Core.Extension;
-using ServiceCenter.Extensions;
+using ServiceCenter.Extensions;
 using ServiceCenter.Logs;
 using ServiceCenter.Redis;
 using ServiceCenter.WebApi;
@@ -88,22 +87,57 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         /// </summary>
         /// <param name="position">取货机台</param>
         /// <param name="taskCode">WMS任务号</param>
+        /// <param name="station">站台</param>
         /// <returns></returns>
-        public static GenAgvSchedulingTaskResponse 托盘回库(string position, string taskCode)
+        public static GenAgvSchedulingTaskResponse 托盘回库(string position, string taskCode, string station)
         {
-            
+            var position1 = "";
+            var position2 = "";
+            switch (station)
+            {
+                case "2501": //分拣一北
+                    position1 = "LX002";
+                    position2 = "LXSS1";
+                    break;
+
+                case "2701": //分拣一南
+                    position1 = "LX004";
+                    position2 = "LXSS4";
+                    break;
+
+                case "2901": //分拣二北
+                    position1 = "LX006";
+                    position2 = "LXSS2";
+                    break;
+
+                case "3101": //分拣二南
+                    position1 = "LX008";
+                    position2 = "LXSS5";
+                    break;
+
+                case "3301": //分拣三北
+                    position1 = "LX010";
+                    position2 = "LXSS3";
+                    break;
+
+                case "3501": //分拣三南
+                    position1 = "LX012";
+                    position2 = "LXSS6";
+                    break;
+            }
+
             return GenAgvSchedulingTask("iwms_third", "", "4", new List<positionCodeClass>()
             {
                 new positionCodeClass(){ //取货机台
                     positionCode=position,
                     type="00"
                 },
-                new positionCodeClass(){ //巷道分配点                    
-                    positionCode="LX002",
+                new positionCodeClass(){ //巷道分配点
+                    positionCode=position1,
                     type="00"
                 },
                 new positionCodeClass(){ //预分配放货点
-                    positionCode="LXSS2",
+                    positionCode=position2,
                     type="00"
                 }
             }, "1", taskCode, "ZTGT31", "1");