xu.lu 1 年之前
父节点
当前提交
c3e2b8ebec

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

@@ -158,15 +158,13 @@ namespace WCS.WorkEngineering.Systems
                                                 case "1N":
                                                     positionList.AddRange(new List<string>() { "2501", "2505", "2509", "2513" });
                                                     allPositionList.AddRange(new List<string>() {                                                        
-                                                        "2901", "2905", "2909", "2913",
-                                                        "3301", "3305", "3309", "3313"});
+                                                        "2901", "2905", "2909", "2913" });
                                                     break;
 
                                                 case "1S":
                                                     positionList.AddRange(new List<string>() { "2701", "2705", "2709", "2713"/*"2501", "2505", "2509", "2513"*/ });
                                                     allPositionList.AddRange(new List<string>() {                                                       
-                                                        "3101", "3105", "3109", "3113",
-                                                        "3501", "3505", "3509", "3513"});
+                                                        "3101", "3105", "3109", "3113"});
                                                     break;
 
                                                 case "2N":
@@ -183,14 +181,12 @@ namespace WCS.WorkEngineering.Systems
 
                                                 case "3N":
                                                     positionList.AddRange(new List<string>() { "3301", "3305", "3309", "3313" });
-                                                    allPositionList.AddRange(new List<string>() {
-                                                        "2901" , "2905" , "2909" , "2913" , "2501" , "2505" , "2509" , "2513"});
+                                                    allPositionList.AddRange(new List<string>() { "2901", "2905", "2909", "2913" });
                                                     break;
 
                                                 case "3S":
                                                     positionList.AddRange(new List<string>() { "3501", "3505", "3509", "3513" });
-                                                    allPositionList.AddRange(new List<string>() {
-                                                        "3101" , "3105" , "3109" , "3113" , "2701" , "2705" , "2709" , "2713"});
+                                                    allPositionList.AddRange(new List<string>() { "3101", "3105", "3109", "3113" });
                                                     break;
                                             }
 

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

@@ -102,7 +102,7 @@ namespace WCS.WorkEngineering.Systems
                                     task.AgvTaskID = agv.ID;
                                     task.Status = Entity.TaskStatus.WaitingToExecute;
                                     db.Default.UpdateableRowLock(task).UpdateColumns(x => new { x.Status, x.AgvTaskID }).ExecuteCommand();
-                                    task.AddWCS_TASK_DTL(db.Default, task.Device, $"初始化单独皮盘任务");
+                                    task.AddWCS_TASK_DTL(db.Default, task.Device, $"初始化单独皮盘任务");
                                 }
                                 else
                                 {

+ 3 - 2
业务工程/分拣库/WCS.WorkEngineering/Systems/RGVSystems.cs

@@ -72,7 +72,7 @@ namespace WCS.WorkEngineering.Systems
                             World.Log($"任务处理:开始-取货完成-任务号[{obj.Data2.TaskNumber}]起始地址[{obj.Data2.StartPosition}]目标地址[{obj.Data2.DestPosition}]");
                             //开始申请读码信息
                             var bcrCode = obj.Data3.GetBCRCode();
-                            if (bcrCode.IsNullOrWhiteSpace())
+                            if (bcrCode.IsNullOrWhiteSpace() || bcrCode.Contains(":"))
                             {
                                 World.Log("扫码失败,内容为空", LogLevelEnum.Mid);
                                 return;
@@ -340,7 +340,8 @@ namespace WCS.WorkEngineering.Systems
                     .Where(x => !x.Data3.Status.HasFlag(StationStatus.PH_Status))
                     .Where(x => !x.Data3.Status.HasFlag(StationStatus.OT_Status))
                     .Select(x => x.Entity.Code.ToShort());
-                var devList = devs.OrderBy(x => x.Entity.Code).Where(x => putDev.Contains(x.Data.GoodsEnd));
+                //var devList = devs.OrderBy(x => x.Entity.Code).Where(x => putDev.Contains(x.Data.GoodsEnd));
+                var devList = devs.OrderBy(x => x.Data.TaskNumber).Where(x => putDev.Contains(x.Data.GoodsEnd));
 
                 if (!devList.Any())
                 {

+ 66 - 11
业务工程/分拣库/WCS.WorkEngineering/Systems/分拣支线/环形库分流点.cs

@@ -1,4 +1,5 @@
-using PlcSiemens.Core.Extension;
+using NetTaste;
+using PlcSiemens.Core.Extension;
 using ServiceCenter.Extensions;
 using ServiceCenter.Logs;
 using ServiceCenter.SqlSugars;
@@ -69,14 +70,27 @@ namespace WCS.WorkEngineering.Systems
             {
                 var db = _db.Default;
                 var taskInfo = db.Queryable<WCS_TaskInfo>().UpdLock().First(v => v.ID == obj.Data2.TaskNumber && v.Status < TaskStatus.FinishOfShunt && !v.BarCode.Contains("Error"));
-                if (obj.Data2.TaskNumber == 1)
+                if (obj.Data2.TaskNumber == 1 || obj.Data2.TaskNumber == 3 || obj.Data2.TaskNumber == 2)
                 {
                     var type = goodsType.ToString();
                     //找到一条起点是当前位置且状态小于2的任务
                     taskInfo = db.Queryable<WCS_TaskInfo>().UpdLock().OrderBy(x => x.AddTime).First(x => x.AddrFrom == obj.Entity.Code && x.BarCode.Contains("Error") && x.AddrNext == null && x.GoodsType == goodsType);
                     if (taskInfo == null)
                     {
-                        WmsApi.PalletizingCreateseErrorTasks(obj.Entity.Code, type);
+                        if (obj.Data2.TaskNumber == 1)
+                        {
+                            WmsApi.PalletizingCreateseErrorTasks(obj.Entity.Code, type);
+                        }
+                        //bc质量
+                        else if (obj.Data2.TaskNumber == 3)
+                        {
+                            WmsApi.PalletizingCreateseErrorTasks(obj.Entity.Code, type, 3);
+                        }
+                        //南北流错
+                        else if (obj.Data2.TaskNumber == 2)
+                        {
+                            WmsApi.PalletizingCreateseErrorTasks(obj.Entity.Code, type, 2);
+                        }
                         return;
                     }
                     if (taskInfo.Status == TaskStatus.NewBuild)
@@ -90,14 +104,23 @@ namespace WCS.WorkEngineering.Systems
                     World.Log($"未找到对应的WCS任务{obj.Data2.TaskNumber}", LogLevelEnum.Mid);
                     return;
                 }
-                else if (taskInfo.AddTime < DateTime.Now.AddHours(-12) && obj.Data2.TaskNumber == taskInfo.ID)
+                else if (taskInfo.AddTime < DateTime.Now.AddHours(-12)  && obj.Data2.TaskNumber == taskInfo.ID)
                 {
                     obj.Data.TaskNumber = 1;
                     obj.Data.GoodsEnd = obj.Entity.Code.ToShort();
                     obj.Data.VoucherNo++;
-                    World.Log($"执行记录:任务号[{taskInfo.ID}]-[{obj.Data.TaskNumber}]-[{obj.Data.VoucherNo}]");
+                    World.Log($"超时执行记录:任务号[{taskInfo.ID}]-[{obj.Data.TaskNumber}]-[{obj.Data.VoucherNo}]");
+                    return;
+                }
+                else if (taskInfo.Grade != null &&(taskInfo.Grade.ToUpper() == "B" || taskInfo.Grade.ToUpper() == "C")  && obj.Data2.TaskNumber == taskInfo.ID)
+                {
+                    obj.Data.TaskNumber = 3;
+                    obj.Data.GoodsEnd = obj.Entity.Code.ToShort();
+                    obj.Data.VoucherNo++;
+                    World.Log($"BC执行记录:任务号[{taskInfo.ID}]-[{obj.Data.TaskNumber}]-[{obj.Data.VoucherNo}]");
                     return;
                 }
+                
 
                 if (!taskInfo.BarCode.Contains("Error"))
                 {
@@ -125,27 +148,51 @@ namespace WCS.WorkEngineering.Systems
                 switch (obj.Entity.Code)
                 {
                     case "418":
-                        if (taskInfo.WarehouseCode != "1N") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "1N") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {                            
+                            WriteInfo(obj,taskInfo);
+                            return;
+                        }                       
                         break;
 
                     case "618":
-                        if (taskInfo.WarehouseCode != "1S") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "1S") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {
+                            WriteInfo(obj, taskInfo);
+                            return;
+                        }
                         break;
 
                     case "818":
-                        if (taskInfo.WarehouseCode != "2N") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "2N") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {
+                            WriteInfo(obj, taskInfo);
+                            return;
+                        }
                         break;
 
                     case "1018":
-                        if (taskInfo.WarehouseCode != "2S") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "2S") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {
+                            WriteInfo(obj, taskInfo);
+                            return;
+                        }
                         break;
 
                     case "1218":
-                        if (taskInfo.WarehouseCode != "3N") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "3N") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {
+                            WriteInfo(obj, taskInfo);
+                            return;
+                        }
                         break;
 
                     case "1418":
-                        if (taskInfo.WarehouseCode != "3S") throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        if (taskInfo.WarehouseCode != "3S") //throw new KnownException($"当前任务应该当前往{taskInfo.WarehouseCode}库", LogLevelEnum.Mid);
+                        {
+                            WriteInfo(obj, taskInfo);
+                            return;
+                        }
                         break;
                 };
 
@@ -202,6 +249,14 @@ namespace WCS.WorkEngineering.Systems
             World.Log($"执行记录:任务号[{taskId}]-[{obj.Data.VoucherNo}]");
         }
 
+        private void WriteInfo(Device<IStation520, IStation521, IStation523, IStation91> device, WCS_TaskInfo task)
+        {
+            device.Data.TaskNumber = 2;
+            device.Data.GoodsEnd = device.Entity.Code.ToShort();
+            device.Data.VoucherNo++;
+            World.Log($"南北流错执行记录:任务号[{task.ID}]-[{device.Data.TaskNumber}]-[{device.Data.VoucherNo}]");
+        }
+
         public override bool Select(Device dev)
         {
             return dev.Code is "418" or "618" or "818" or "1018" or "1218" or "1418";

+ 3 - 3
业务工程/分拣库/WCS.WorkEngineering/WebApi/Controllers/WcsController.cs

@@ -251,7 +251,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
                                                                 TaskNo = item,
                                                                 Message = $"不能完成新建任务",
                                                             });
-                                                            break;
+                                                            continue;
 
                                                         case Entity.TaskStatus.WaitingToExecute:
                                                             response.ResDataList.Add(new HandleTaskResponse()
@@ -260,7 +260,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
                                                                 TaskNo = item,
                                                                 Message = $"不能完成待执行任务",
                                                             });
-                                                            break;
+                                                            continue;
 
                                                         case Entity.TaskStatus.StackerExecution:
                                                             response.ResDataList.Add(new HandleTaskResponse()
@@ -269,7 +269,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
                                                                 TaskNo = item,
                                                                 Message = $"不能完成堆垛机执行任务",
                                                             });
-                                                            break;
+                                                            continue;
                                                     };
                                                 }
                                                 break;

+ 6 - 5
业务工程/分拣库/WCS.WorkEngineering/WebApi/Controllers/WmsApi.cs

@@ -468,15 +468,16 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         }
 
         /// <summary>
-        ///  码垛工资轮创建异常任务信息
+        /// 码垛工资轮创建异常任务信息
         /// </summary>
-        /// <param name="loc"></param>
-        /// <param name="type"></param>
+        /// <param name="loc">位置</param>
+        /// <param name="type">类型</param>
+        /// <param name="errType">异常类型</param>
         /// <returns></returns>
         /// <exception cref="KnownException"></exception>
-        public static SRes PalletizingCreateseErrorTasks(string loc, string type)
+        public static SRes PalletizingCreateseErrorTasks(string loc, string type, int errType = 0)
         {
-            var res = APICaller.CallApi2<SRes>(WmsUrl + "/api/FJ/PalletizingCreateseErrorTasks", new Models.WMS.Request.PalletizingCreateseErrorTasksRequest(loc, type, loc.GetWareCode()));
+            var res = APICaller.CallApi2<SRes>(WmsUrl + "/api/FJ/PalletizingCreateseErrorTasks", new Models.WMS.Request.PalletizingCreateseErrorTasksRequest(loc, type, loc.GetWareCode(),errType));
 
             if (res.ResCode != ResponseStatusCodeEnum.Sucess)
             {

+ 7 - 1
业务工程/分拣库/WCS.WorkEngineering/WebApi/Models/WMS/Request/PalletizingCreateseErrorTasksRequest.cs

@@ -11,10 +11,11 @@
         /// <param name="equCode"></param>
         /// <param name="type"></param>
         /// <param name="warehouseCode"></param>
-        public PalletizingCreateseErrorTasksRequest(string equCode, string type, string warehouseCode)
+        public PalletizingCreateseErrorTasksRequest(string equCode, string type, string warehouseCode,int err)
         {
             WarehouseCode = warehouseCode;
             EquNo = equCode;
+            errType = err;
             Type = type;
         }
 
@@ -32,5 +33,10 @@
         ///  仓库编号
         /// </summary>
         public string? WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 异常类型
+        /// </summary>
+        public int errType { get; set; }
     }
 }