林豪 左 1 an în urmă
părinte
comite
ef29f12276

+ 11 - 16
业务工程/分拣库/WCS.WorkEngineering/Systems/分拣主线/满轮主线预写入目标地址.cs

@@ -5,6 +5,7 @@ using ServiceCenter.Logs;
 using ServiceCenter.Redis;
 using ServiceCenter.SqlSugars;
 using System.ComponentModel;
+using System.Threading.Tasks;
 using WCS.Core;
 using WCS.Entity;
 using WCS.Entity.Protocol.BCR;
@@ -54,27 +55,22 @@ namespace WCS.WorkEngineering.Systems
                 {
                     WCS_TaskInfo taskInfo = null;
 
-                    try
+                    SqlSugarHelper.Do(_db =>
                     {
-                        SqlSugarHelper.Do(_db =>
+                        var db = _db.Default;
+                        var task = db.Queryable<WCS_TaskInfo>().NoLock().First(x => x.BarCode == bcrCode && x.Status == TaskStatus.NewBuild);
+                        if (task == null)
                         {
-                            var db = _db.Default;
-                            var task = db.Queryable<WCS_TaskInfo>().NoLock().First(x => x.BarCode == bcrCode && x.Status == TaskStatus.NewBuild);
-                            if (task == null)
-                            {
-                                World.Log($"{bcrCode}:找不到匹配的任务", LogLevelEnum.High);
-                                return;
-                            }
+                            World.Log($"{bcrCode}:找不到匹配的任务", LogLevelEnum.High);
+                            return;
+                        }
 
-                            taskInfo = task;
-                        });
-                    }
-                    catch (Exception e)
+                        taskInfo = task;
+                    });
+                    if (taskInfo == null)
                     {
-                        World.Log($"{bcrCode}:----{e.Message}", LogLevelEnum.High);
                         continue;
                     }
-
                     var srmCode = taskInfo.WarehouseCode.WarehouseToSrm();
                     var path = DevicePath.GetPath(obj.Entity.Code, srmCode);
                     if (path == null || path is { Points.Count: < 2 })
@@ -111,7 +107,6 @@ namespace WCS.WorkEngineering.Systems
             catch (Exception e)
             {
                 World.Log($"{e.Message}:---{e.StackTrace}", LogLevelEnum.High);
-                throw;
             }
         }