林豪 左 преди 1 година
родител
ревизия
a8bd1cbf94
променени са 25 файла, в които са добавени 1214 реда и са изтрити 1131 реда
  1. 21 16
      ServiceCenter/Redis/RedisHub.cs
  2. 2 2
      WCS.Core/PlcItem.cs
  3. 3 2
      WCS.Core/ProtocolProxyBase.cs
  4. 7 1
      WCS.Entity/WCS_Palletizing.cs
  5. 1 1
      WCS.Service/appsettings.json
  6. 371 347
      业务工程/分拣库/WCS.Entity.Protocol/Truss/ITruss530.cs
  7. 136 125
      业务工程/分拣库/WCS.Entity.Protocol/Truss/WCS_Truss530.cs
  8. 131 131
      业务工程/分拣库/WCS.WorkEngineering/ProtocolProxy.cs
  9. 2 2
      业务工程/分拣库/WCS.WorkEngineering/Systems/AgvSystems.cs
  10. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/DataCollectionSysyem.cs
  11. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/DeviceWriteSystem.cs
  12. 12 11
      业务工程/分拣库/WCS.WorkEngineering/Systems/RGVSystems.cs
  13. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/UpLoadSystems.cs
  14. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/一楼叠盘机入库.cs
  15. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/二楼拆盘机自动补空托盘组.cs
  16. 6 0
      业务工程/分拣库/WCS.WorkEngineering/Systems/分拣主线/满轮主线预写入目标地址.cs
  17. 26 19
      业务工程/分拣库/WCS.WorkEngineering/Systems/分拣支线/桁架分流点.cs
  18. 1 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/机台叫料生成AGV任务.cs
  19. 14 15
      业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架.cs
  20. 5 5
      业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架码垛区补空托盘任务生成.cs
  21. 2 1
      业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架码垛工位任务结束处理.cs
  22. 54 54
      业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架缓存放行点.cs
  23. 7 3
      业务工程/分拣库/WCS.WorkEngineering/Systems/环形库/机械臂cs.cs
  24. 18 6
      业务工程/分拣库/WCS.WorkEngineering/Systems/环形库/环形库码垛结束.cs
  25. 390 384
      业务工程/分拣库/WCS.WorkEngineering/WorkStart.cs

+ 21 - 16
ServiceCenter/Redis/RedisHub.cs

@@ -33,6 +33,8 @@ namespace ServiceCenter.Redis
         /// </summary>
         public static string WMSContextType { get; private set; } = null!;
 
+        public static object redisLock = new object();
+
         /// <summary>
         /// 设置默认链接
         /// </summary>
@@ -179,23 +181,26 @@ namespace ServiceCenter.Redis
         /// <exception cref="Exception"></exception>
         public static void Do(string key, string lockKey, Action<RedisClient> act)
         {
-            if (!RedisClients.Any()) throw new Exception($"请调用{nameof(CreateContext)}方法设置设置数据库连接");
-            var redis = Context(key);
-            lockKey = "ConcurrentLock:" + lockKey;
-            try
-            {
-                if (redis.Exists(lockKey)) throw new Exception($"重复调用:{lockKey}");
-                redis.Set(lockKey, lockKey);
-                redis.Expire(lockKey, 60);
-                act(redis);
-            }
-            catch (Exception ex)
+            lock (redisLock)
             {
-                throw new KnownException($"{ex.Message}", LogLevelEnum.Mid);
-            }
-            finally
-            {
-                redis.Del(lockKey);
+                if (!RedisClients.Any()) throw new Exception($"请调用{nameof(CreateContext)}方法设置设置数据库连接");
+                var redis = Context(key);
+                lockKey = "ConcurrentLock:" + lockKey;
+                try
+                {
+                    if (redis.Exists(lockKey)) throw new Exception($"重复调用:{lockKey}");
+                    redis.Set(lockKey, lockKey);
+                    redis.Expire(lockKey, 60);
+                    act(redis);
+                }
+                catch (Exception ex)
+                {
+                    throw new KnownException($"{ex.Message}", LogLevelEnum.Mid);
+                }
+                finally
+                {
+                    redis.Del(lockKey);
+                }
             }
         }
     }

+ 2 - 2
WCS.Core/PlcItem.cs

@@ -115,9 +115,9 @@ namespace WCS.Core
                     Db.Write<T>(Start, (T)value, StringLength, ArrayLength);
                     return;
                 }
-                catch
+                catch (Exception ex)
                 {
-                    if (i >= 3) throw;
+                    if (i >= 3) throw new Exception($"写入出错{ex.Message}--{Start}--{(T)value}--{StringLength}--{ArrayLength}--{Db.Entity.No}");
                     i++;
                     Thread.Sleep(100);
                 }

+ 3 - 2
WCS.Core/ProtocolProxyBase.cs

@@ -126,7 +126,7 @@ namespace WCS.Core
             var item = Items[propertyName] as PlcItem<T>;
             var res = item.Value;
             var channel = Ltc.GetChannel();
-            if (channel != null) this.World.OnInternalLog(channel, $"获取值:{Device.Code}.{ProtocolType.Name}.{propertyName}:{res}");
+            //if (channel != null) this.World.OnInternalLog(channel, $"获取值:{Device.Code}.{ProtocolType.Name}.{propertyName}:{res}");
             return res;
         }
 
@@ -134,7 +134,8 @@ namespace WCS.Core
         {
             var item = Items[propertyName] as PlcItem<T>;
             item.Value = value;
-            var channel = Ltc.GetChannel(); this.World.OnInternalLog(channel, $"设置值:{Device.Code}.{ProtocolType.Name}.{propertyName} :{value}");
+            var channel = Ltc.GetChannel();
+            if (channel != null) this.World.OnInternalLog(channel, $"设置值:{Device.Code}.{ProtocolType.Name}.{propertyName} :{value}");
         }
 
         #endregion

+ 7 - 1
WCS.Entity/WCS_Palletizing.cs

@@ -28,6 +28,12 @@ namespace WCS.Entity
         [Navigate(NavigateType.OneToOne, nameof(TaskId))]
         public WCS_TaskInfo? TaskInfo { get; set; }
 
+        /// <summary>
+        ///  触发任务的下一个地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "触发任务的下一个地址")]
+        public string TaskAddNext { get; set; }
+
         /// <summary>
         ///  托盘条码
         /// </summary>
@@ -103,7 +109,7 @@ namespace WCS.Entity
         /// <summary>
         ///  是否二次绑盘
         /// </summary>
-        [SugarColumn(IsNullable = false, ColumnDescription = "是否二次绑盘")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "是否二次绑盘")]
         public bool isItHalf { get; set; }
 
         /// <summary>

+ 1 - 1
WCS.Service/appsettings.json

@@ -7,6 +7,6 @@
     }
   },
   "ConnectionStrings": {
-    "Redis": "127.0.0.1,database=0,prefix=Sorting:"
+    "Redis": "10.30.37.1,password=123456,database=0,prefix=Sorting:"
   }
 }

+ 371 - 347
业务工程/分拣库/WCS.Entity.Protocol/Truss/ITruss530.cs

@@ -7,365 +7,389 @@ namespace WCS.Entity.Protocol.Truss
     /// </summary>
     public interface ITruss530 : IProtocol
     {
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods0 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods1 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods2 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods3 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods4 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods5 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods6 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods7 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods8 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods9 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods10 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods11 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods12 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods13 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods14 { get; set; }
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods0 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods1 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods2 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods3 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods4 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods5 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods6 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods7 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods8 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods9 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods10 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods11 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods12 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods13 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods14 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods15 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods16 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods17 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods18 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods19 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods20 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods21 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods22 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods23 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods24 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods25 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods26 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods27 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods28 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods29 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods30 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods31 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods32 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods33 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods34 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods35 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods36 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods37 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods38 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods39 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods40 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods41 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods42 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods43 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods44 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods45 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods46 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods47 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods48 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods49 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods50 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods51 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods52 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods53 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods54 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods55 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods56 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods57 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods58 { get; set; }
+
+        ///// <summary>
+        /////  是否有货
+        ///// </summary>
+        //[Description("是否有货")]
+        //public bool IsGoods59 { get; set; }
 
         /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods15 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods16 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods17 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods18 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods19 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods20 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods21 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods22 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods23 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods24 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods25 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods26 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods27 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods28 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods29 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods30 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods31 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods32 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods33 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods34 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods35 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods36 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods37 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods38 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods39 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods40 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods41 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods42 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods43 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods44 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods45 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods46 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods47 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods48 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods49 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods50 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods51 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods52 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods53 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods54 { get; set; }
-
-        /// <summary>
-        ///  是否有货
-        /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods55 { get; set; }
-
-        /// <summary>
-        ///  是否有货
+        ///  垛形
         /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods56 { get; set; }
+        [Description("垛形")]
+        public short Type1 { get; set; }
 
         /// <summary>
-        ///  是否有货
+        ///  垛形
         /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods57 { get; set; }
+        [Description("垛形")]
+        public short Type2 { get; set; }
 
         /// <summary>
-        ///  是否有货
+        ///  垛形
         /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods58 { get; set; }
+        [Description("垛形")]
+        public short Type3 { get; set; }
 
         /// <summary>
-        ///  是否有货
+        ///  垛形
         /// </summary>
-        [Description("是否有货")]
-        public bool IsGoods59 { get; set; }
+        [Description("垛形")]
+        public short Type4 { get; set; }
 
         /// <summary>
         ///  垛形

+ 136 - 125
业务工程/分拣库/WCS.Entity.Protocol/Truss/WCS_Truss530.cs

@@ -7,199 +7,210 @@ namespace WCS.Entity.Protocol.Truss
     [SugarTable("Truss530")]
     public class WCS_Truss530 : TDengineBaseEntity, ITruss530
     {
-        [DataMember(Order = 0)]
-        public bool IsGoods0 { get; set; }
+        //[DataMember(Order = 0)]
+        //public bool IsGoods0 { get; set; }
 
-        [DataMember(Order = 1)]
-        public bool IsGoods1 { get; set; }
+        //[DataMember(Order = 1)]
+        //public bool IsGoods1 { get; set; }
 
-        [DataMember(Order = 2)]
-        public bool IsGoods2 { get; set; }
+        //[DataMember(Order = 2)]
+        //public bool IsGoods2 { get; set; }
 
-        [DataMember(Order = 3)]
-        public bool IsGoods3 { get; set; }
+        //[DataMember(Order = 3)]
+        //public bool IsGoods3 { get; set; }
 
-        [DataMember(Order = 4)]
-        public bool IsGoods4 { get; set; }
+        //[DataMember(Order = 4)]
+        //public bool IsGoods4 { get; set; }
 
-        [DataMember(Order = 5)]
-        public bool IsGoods5 { get; set; }
+        //[DataMember(Order = 5)]
+        //public bool IsGoods5 { get; set; }
 
-        [DataMember(Order = 6)]
-        public bool IsGoods6 { get; set; }
+        //[DataMember(Order = 6)]
+        //public bool IsGoods6 { get; set; }
 
-        [DataMember(Order = 7)]
-        public bool IsGoods7 { get; set; }
+        //[DataMember(Order = 7)]
+        //public bool IsGoods7 { get; set; }
 
-        [DataMember(Order = 8)]
-        public bool IsGoods8 { get; set; }
+        //[DataMember(Order = 8)]
+        //public bool IsGoods8 { get; set; }
 
-        [DataMember(Order = 9)]
-        public bool IsGoods9 { get; set; }
+        //[DataMember(Order = 9)]
+        //public bool IsGoods9 { get; set; }
 
-        [DataMember(Order = 10)]
-        public bool IsGoods10 { get; set; }
+        //[DataMember(Order = 10)]
+        //public bool IsGoods10 { get; set; }
 
-        [DataMember(Order = 11)]
-        public bool IsGoods11 { get; set; }
+        //[DataMember(Order = 11)]
+        //public bool IsGoods11 { get; set; }
 
-        [DataMember(Order = 12)]
-        public bool IsGoods12 { get; set; }
+        //[DataMember(Order = 12)]
+        //public bool IsGoods12 { get; set; }
 
-        [DataMember(Order = 13)]
-        public bool IsGoods13 { get; set; }
+        //[DataMember(Order = 13)]
+        //public bool IsGoods13 { get; set; }
 
-        [DataMember(Order = 14)]
-        public bool IsGoods14 { get; set; }
+        //[DataMember(Order = 14)]
+        //public bool IsGoods14 { get; set; }
 
-        [DataMember(Order = 15)]
-        public bool IsGoods15 { get; set; }
+        //[DataMember(Order = 15)]
+        //public bool IsGoods15 { get; set; }
 
-        [DataMember(Order = 16)]
-        public bool IsGoods16 { get; set; }
+        //[DataMember(Order = 16)]
+        //public bool IsGoods16 { get; set; }
 
-        [DataMember(Order = 17)]
-        public bool IsGoods17 { get; set; }
+        //[DataMember(Order = 17)]
+        //public bool IsGoods17 { get; set; }
 
-        [DataMember(Order = 18)]
-        public bool IsGoods18 { get; set; }
+        //[DataMember(Order = 18)]
+        //public bool IsGoods18 { get; set; }
 
-        [DataMember(Order = 19)]
-        public bool IsGoods19 { get; set; }
+        //[DataMember(Order = 19)]
+        //public bool IsGoods19 { get; set; }
 
-        [DataMember(Order = 20)]
-        public bool IsGoods20 { get; set; }
+        //[DataMember(Order = 20)]
+        //public bool IsGoods20 { get; set; }
 
-        [DataMember(Order = 21)]
-        public bool IsGoods21 { get; set; }
+        //[DataMember(Order = 21)]
+        //public bool IsGoods21 { get; set; }
 
-        [DataMember(Order = 22)]
-        public bool IsGoods22 { get; set; }
+        //[DataMember(Order = 22)]
+        //public bool IsGoods22 { get; set; }
 
-        [DataMember(Order = 23)]
-        public bool IsGoods23 { get; set; }
+        //[DataMember(Order = 23)]
+        //public bool IsGoods23 { get; set; }
 
-        [DataMember(Order = 24)]
-        public bool IsGoods24 { get; set; }
+        //[DataMember(Order = 24)]
+        //public bool IsGoods24 { get; set; }
 
-        [DataMember(Order = 25)]
-        public bool IsGoods25 { get; set; }
+        //[DataMember(Order = 25)]
+        //public bool IsGoods25 { get; set; }
 
-        [DataMember(Order = 26)]
-        public bool IsGoods26 { get; set; }
+        //[DataMember(Order = 26)]
+        //public bool IsGoods26 { get; set; }
 
-        [DataMember(Order = 27)]
-        public bool IsGoods27 { get; set; }
+        //[DataMember(Order = 27)]
+        //public bool IsGoods27 { get; set; }
 
-        [DataMember(Order = 28)]
-        public bool IsGoods28 { get; set; }
+        //[DataMember(Order = 28)]
+        //public bool IsGoods28 { get; set; }
 
-        [DataMember(Order = 29)]
-        public bool IsGoods29 { get; set; }
+        //[DataMember(Order = 29)]
+        //public bool IsGoods29 { get; set; }
 
-        [DataMember(Order = 30)]
-        public bool IsGoods30 { get; set; }
+        //[DataMember(Order = 30)]
+        //public bool IsGoods30 { get; set; }
 
-        [DataMember(Order = 31)]
-        public bool IsGoods31 { get; set; }
+        //[DataMember(Order = 31)]
+        //public bool IsGoods31 { get; set; }
 
-        [DataMember(Order = 32)]
-        public bool IsGoods32 { get; set; }
+        //[DataMember(Order = 32)]
+        //public bool IsGoods32 { get; set; }
 
-        [DataMember(Order = 33)]
-        public bool IsGoods33 { get; set; }
+        //[DataMember(Order = 33)]
+        //public bool IsGoods33 { get; set; }
 
-        [DataMember(Order = 34)]
-        public bool IsGoods34 { get; set; }
+        //[DataMember(Order = 34)]
+        //public bool IsGoods34 { get; set; }
 
-        [DataMember(Order = 35)]
-        public bool IsGoods35 { get; set; }
+        //[DataMember(Order = 35)]
+        //public bool IsGoods35 { get; set; }
 
-        [DataMember(Order = 36)]
-        public bool IsGoods36 { get; set; }
+        //[DataMember(Order = 36)]
+        //public bool IsGoods36 { get; set; }
 
-        [DataMember(Order = 37)]
-        public bool IsGoods37 { get; set; }
+        //[DataMember(Order = 37)]
+        //public bool IsGoods37 { get; set; }
 
-        [DataMember(Order = 38)]
-        public bool IsGoods38 { get; set; }
+        //[DataMember(Order = 38)]
+        //public bool IsGoods38 { get; set; }
 
-        [DataMember(Order = 39)]
-        public bool IsGoods39 { get; set; }
+        //[DataMember(Order = 39)]
+        //public bool IsGoods39 { get; set; }
 
-        [DataMember(Order = 40)]
-        public bool IsGoods40 { get; set; }
+        //[DataMember(Order = 40)]
+        //public bool IsGoods40 { get; set; }
 
-        [DataMember(Order = 41)]
-        public bool IsGoods41 { get; set; }
+        //[DataMember(Order = 41)]
+        //public bool IsGoods41 { get; set; }
 
-        [DataMember(Order = 42)]
-        public bool IsGoods42 { get; set; }
+        //[DataMember(Order = 42)]
+        //public bool IsGoods42 { get; set; }
 
-        [DataMember(Order = 43)]
-        public bool IsGoods43 { get; set; }
+        //[DataMember(Order = 43)]
+        //public bool IsGoods43 { get; set; }
 
-        [DataMember(Order = 44)]
-        public bool IsGoods44 { get; set; }
+        //[DataMember(Order = 44)]
+        //public bool IsGoods44 { get; set; }
 
-        [DataMember(Order = 45)]
-        public bool IsGoods45 { get; set; }
+        //[DataMember(Order = 45)]
+        //public bool IsGoods45 { get; set; }
 
-        [DataMember(Order = 46)]
-        public bool IsGoods46 { get; set; }
+        //[DataMember(Order = 46)]
+        //public bool IsGoods46 { get; set; }
 
-        [DataMember(Order = 47)]
-        public bool IsGoods47 { get; set; }
+        //[DataMember(Order = 47)]
+        //public bool IsGoods47 { get; set; }
 
-        [DataMember(Order = 48)]
-        public bool IsGoods48 { get; set; }
+        //[DataMember(Order = 48)]
+        //public bool IsGoods48 { get; set; }
 
-        [DataMember(Order = 49)]
-        public bool IsGoods49 { get; set; }
+        //[DataMember(Order = 49)]
+        //public bool IsGoods49 { get; set; }
 
-        [DataMember(Order = 50)]
-        public bool IsGoods50 { get; set; }
+        //[DataMember(Order = 50)]
+        //public bool IsGoods50 { get; set; }
 
-        [DataMember(Order = 51)]
-        public bool IsGoods51 { get; set; }
+        //[DataMember(Order = 51)]
+        //public bool IsGoods51 { get; set; }
 
-        [DataMember(Order = 52)]
-        public bool IsGoods52 { get; set; }
+        //[DataMember(Order = 52)]
+        //public bool IsGoods52 { get; set; }
 
-        [DataMember(Order = 53)]
-        public bool IsGoods53 { get; set; }
+        //[DataMember(Order = 53)]
+        //public bool IsGoods53 { get; set; }
 
-        [DataMember(Order = 54)]
-        public bool IsGoods54 { get; set; }
+        //[DataMember(Order = 54)]
+        //public bool IsGoods54 { get; set; }
 
-        [DataMember(Order = 55)]
-        public bool IsGoods55 { get; set; }
+        //[DataMember(Order = 55)]
+        //public bool IsGoods55 { get; set; }
 
-        [DataMember(Order = 56)]
-        public bool IsGoods56 { get; set; }
+        //[DataMember(Order = 56)]
+        //public bool IsGoods56 { get; set; }
 
-        [DataMember(Order = 57)]
-        public bool IsGoods57 { get; set; }
+        //[DataMember(Order = 57)]
+        //public bool IsGoods57 { get; set; }
 
-        [DataMember(Order = 58)]
-        public bool IsGoods58 { get; set; }
+        //[DataMember(Order = 58)]
+        //public bool IsGoods58 { get; set; }
 
-        [DataMember(Order = 59)]
-        public bool IsGoods59 { get; set; }
+        //[DataMember(Order = 59)]
+        //public bool IsGoods59 { get; set; }
+        [DataMember(Order = 1)]
+        public short Type1 { get; set; }
 
-        [DataMember(Order = 60)]
+        [DataMember(Order = 2)]
+        public short Type2 { get; set; }
+
+        [DataMember(Order = 3)]
+        public short Type3 { get; set; }
+
+        [DataMember(Order = 4)]
+        public short Type4 { get; set; }
+
+        [DataMember(Order = 5)]
         public short Type { get; set; }
 
-        [DataMember(Order = 61)]
+        [DataMember(Order = 6)]
         public short MaxQuantity { get; set; }
 
-        [DataMember(Order = 62)]
+        [DataMember(Order = 7)]
         public short Quantity { get; set; }
 
-        [DataMember(Order = 63)]
+        [DataMember(Order = 8)]
         public TrussCmdType CmdType { get; set; }
 
-        [DataMember(Order = 64)]
+        [DataMember(Order = 9)]
         public short VoucherNo { get; set; }
     }
 }

+ 131 - 131
业务工程/分拣库/WCS.WorkEngineering/ProtocolProxy.cs

@@ -93,137 +93,137 @@ namespace WCS.WorkEngineering
                 }
             });
 
-            foreach (var ty in type.GetProperties().Where(x => x.Name == nameof(TDengineBaseEntity.CreateSql)))
-            {
-                var db = new SqlSugarHelper().PLC;
-                switch (type.Name)
-                {
-                    case nameof(WCS_SRM520):
-                        var item = entity as WCS_SRM520;
-                        ty.SetValue(entity, GetString(db.Insertable(item).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_SRM521):
-                        var item1 = entity as WCS_SRM521;
-                        ty.SetValue(entity, GetString(db.Insertable(item1).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_SRM537):
-                        var item2 = entity as WCS_SRM537;
-                        ty.SetValue(entity, GetString(db.Insertable(item2).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_RGV520):
-                        var item3 = entity as WCS_RGV520;
-                        ty.SetValue(entity, GetString(db.Insertable(item3).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_RGV521):
-                        var item4 = entity as WCS_RGV521;
-                        ty.SetValue(entity, GetString(db.Insertable(item4).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_BCR80):
-                        var item5 = entity as WCS_BCR80;
-                        ty.SetValue(entity, GetString(db.Insertable(item5).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_BCR81):
-                        var item6 = entity as WCS_BCR81;
-                        ty.SetValue(entity, GetString(db.Insertable(item6).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_BCR83):
-                        var item7 = entity as WCS_BCR83;
-                        ty.SetValue(entity, GetString(db.Insertable(item7).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station520):
-                        var item8 = entity as WCS_Station520;
-                        ty.SetValue(entity, GetString(db.Insertable(item8).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station521):
-                        var item9 = entity as WCS_Station521;
-                        ty.SetValue(entity, GetString(db.Insertable(item9).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station523):
-                        var item10 = entity as WCS_Station523;
-                        ty.SetValue(entity, GetString(db.Insertable(item10).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station524):
-                        var item11 = entity as WCS_Station524;
-                        ty.SetValue(entity, GetString(db.Insertable(item11).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station525):
-                        var item12 = entity as WCS_Station525;
-                        ty.SetValue(entity, GetString(db.Insertable(item12).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station90):
-                        var item13 = entity as WCS_Station90;
-                        ty.SetValue(entity, GetString(db.Insertable(item13).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Station91):
-                        var item14 = entity as WCS_Station91;
-                        ty.SetValue(entity, GetString(db.Insertable(item14).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Truss520):
-                        var item15 = entity as WCS_Truss520;
-                        ty.SetValue(entity, GetString(db.Insertable(item15).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Truss521):
-                        var item16 = entity as WCS_Truss521;
-                        ty.SetValue(entity, GetString(db.Insertable(item16).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Truss523):
-                        var item17 = entity as WCS_Truss523;
-                        ty.SetValue(entity, GetString(db.Insertable(item17).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Truss530):
-                        var item18 = entity as WCS_Truss530;
-                        ty.SetValue(entity, GetString(db.Insertable(item18).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Truss531):
-                        var item19 = entity as WCS_Truss531;
-                        ty.SetValue(entity, GetString(db.Insertable(item19).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Robot520):
-                        var item20 = entity as WCS_Robot520;
-                        ty.SetValue(entity, GetString(db.Insertable(item20).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Robot521):
-                        var item21 = entity as WCS_Robot521;
-                        ty.SetValue(entity, GetString(db.Insertable(item21).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Robot522):
-                        var item22 = entity as WCS_Robot522;
-                        ty.SetValue(entity, GetString(db.Insertable(item22).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Robot530):
-                        var item23 = entity as WCS_Robot530;
-                        ty.SetValue(entity, GetString(db.Insertable(item23).ToSqlString()));
-                        break;
-
-                    case nameof(WCS_Robot531):
-                        var item24 = entity as WCS_Robot531;
-                        ty.SetValue(entity, GetString(db.Insertable(item24).ToSqlString()));
-                        break;
-                }
-            }
+            //foreach (var ty in type.GetProperties().Where(x => x.Name == nameof(TDengineBaseEntity.CreateSql)))
+            //{
+            //    var db = new SqlSugarHelper().PLC;
+            //    switch (type.Name)
+            //    {
+            //        case nameof(WCS_SRM520):
+            //            var item = entity as WCS_SRM520;
+            //            ty.SetValue(entity, GetString(db.Insertable(item).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_SRM521):
+            //            var item1 = entity as WCS_SRM521;
+            //            ty.SetValue(entity, GetString(db.Insertable(item1).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_SRM537):
+            //            var item2 = entity as WCS_SRM537;
+            //            ty.SetValue(entity, GetString(db.Insertable(item2).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_RGV520):
+            //            var item3 = entity as WCS_RGV520;
+            //            ty.SetValue(entity, GetString(db.Insertable(item3).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_RGV521):
+            //            var item4 = entity as WCS_RGV521;
+            //            ty.SetValue(entity, GetString(db.Insertable(item4).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_BCR80):
+            //            var item5 = entity as WCS_BCR80;
+            //            ty.SetValue(entity, GetString(db.Insertable(item5).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_BCR81):
+            //            var item6 = entity as WCS_BCR81;
+            //            ty.SetValue(entity, GetString(db.Insertable(item6).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_BCR83):
+            //            var item7 = entity as WCS_BCR83;
+            //            ty.SetValue(entity, GetString(db.Insertable(item7).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station520):
+            //            var item8 = entity as WCS_Station520;
+            //            ty.SetValue(entity, GetString(db.Insertable(item8).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station521):
+            //            var item9 = entity as WCS_Station521;
+            //            ty.SetValue(entity, GetString(db.Insertable(item9).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station523):
+            //            var item10 = entity as WCS_Station523;
+            //            ty.SetValue(entity, GetString(db.Insertable(item10).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station524):
+            //            var item11 = entity as WCS_Station524;
+            //            ty.SetValue(entity, GetString(db.Insertable(item11).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station525):
+            //            var item12 = entity as WCS_Station525;
+            //            ty.SetValue(entity, GetString(db.Insertable(item12).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station90):
+            //            var item13 = entity as WCS_Station90;
+            //            ty.SetValue(entity, GetString(db.Insertable(item13).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Station91):
+            //            var item14 = entity as WCS_Station91;
+            //            ty.SetValue(entity, GetString(db.Insertable(item14).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Truss520):
+            //            var item15 = entity as WCS_Truss520;
+            //            ty.SetValue(entity, GetString(db.Insertable(item15).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Truss521):
+            //            var item16 = entity as WCS_Truss521;
+            //            ty.SetValue(entity, GetString(db.Insertable(item16).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Truss523):
+            //            var item17 = entity as WCS_Truss523;
+            //            ty.SetValue(entity, GetString(db.Insertable(item17).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Truss530):
+            //            var item18 = entity as WCS_Truss530;
+            //            ty.SetValue(entity, GetString(db.Insertable(item18).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Truss531):
+            //            var item19 = entity as WCS_Truss531;
+            //            ty.SetValue(entity, GetString(db.Insertable(item19).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Robot520):
+            //            var item20 = entity as WCS_Robot520;
+            //            ty.SetValue(entity, GetString(db.Insertable(item20).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Robot521):
+            //            var item21 = entity as WCS_Robot521;
+            //            ty.SetValue(entity, GetString(db.Insertable(item21).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Robot522):
+            //            var item22 = entity as WCS_Robot522;
+            //            ty.SetValue(entity, GetString(db.Insertable(item22).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Robot530):
+            //            var item23 = entity as WCS_Robot530;
+            //            ty.SetValue(entity, GetString(db.Insertable(item23).ToSqlString()));
+            //            break;
+
+            //        case nameof(WCS_Robot531):
+            //            var item24 = entity as WCS_Robot531;
+            //            ty.SetValue(entity, GetString(db.Insertable(item24).ToSqlString()));
+            //            break;
+            //    }
+            //}
             return entity;
         }
 

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

@@ -16,7 +16,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  Agv交互系统
     /// </summary>
-    //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     [Description("Agv交互系统")]
     public class AgvSystems : DeviceSystem<Device<IStation520>>
     {
@@ -154,7 +154,7 @@ namespace WCS.WorkEngineering.Systems
                                             switch (task.WarehouseCode)
                                             {
                                                 case "1N":
-                                                    positionList.AddRange(new List<string>() { "2501", "2505", "2509"/*, "2513"*/ });
+                                                    positionList.AddRange(new List<string>() { "2501", "2505", "2509", "2513" });
                                                     break;
 
                                                 case "1S":

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

@@ -14,7 +14,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  数据采集系统
     /// </summary>
-    [BelongTo(typeof(DataCollectionWorld))]
+    //[BelongTo(typeof(DataCollectionWorld))]
     [Description("数据采集系统")]
     public class DataCollectionSysyem : DeviceSystem<SRM>
     {

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

@@ -9,7 +9,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  设备信息写入接口
     /// </summary>
-    //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     public class DeviceWriteSystem : ServiceSystem<DeviceWriteInfo>
     {
         /// <summary>

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

@@ -17,7 +17,7 @@ using TaskStatus = WCS.Entity.TaskStatus;
 namespace WCS.WorkEngineering.Systems
 {
     /// <summary>
-    ///  Agv交互系统
+    ///  RGV交互系统
     /// </summary>
     [BelongTo(typeof(RgvWorld))]
     [Description("RGV交互系统")]
@@ -99,8 +99,7 @@ namespace WCS.WorkEngineering.Systems
                                 var startPosition = Device.All.Where(x => x.Code == obj.Data2.StartPosition.ToString())
                                     .Select(x => new Device<IStation520, IStation521, IStation523>(x, World))
                                     .FirstOrDefault();
-                                var destPosition =
-                                    Device.All.FirstOrDefault(x => x.Code == obj.Data2.DestPosition.ToString());
+                                var destPosition = Device.All.FirstOrDefault(x => x.Code == obj.Data2.DestPosition.ToString());
                                 var isPalletizing = destPosition!.HasFlag(DeviceFlags.桁架码垛位, DeviceFlags.环形库码垛工位);
                                 short countQty = 0;
                                 short shortCode = 0;
@@ -159,7 +158,7 @@ namespace WCS.WorkEngineering.Systems
                             }
                             catch (Exception e)
                             {
-                                throw new KnownException($"处理小车放货完成是出现错误:{e.Message}", LogLevelEnum.High);
+                                throw new KnownException($"处理小车放货完成是出现错误:{e.Message}-{e.StackTrace}", LogLevelEnum.High);
                             }
                             obj.Data.RES1 = 1;
                             break;
@@ -175,9 +174,11 @@ namespace WCS.WorkEngineering.Systems
                             break;
 
                         case RGVCmdType.PickPutGoods:
-                            var statDev = new Device<IStation520, IStation521, ITruss530>(Device.All.FirstOrDefault(x => x.Code == obj.Data.StartPosition.ToString())!, World);
-                            if (statDev.Entity.HasFlag(DeviceFlags.二次码垛RGV取货口))
+                            var statDev = Device.All.FirstOrDefault(x => x.Code == obj.Data.StartPosition.ToString());
+
+                            if (statDev.HasFlag(DeviceFlags.二次码垛RGV取货口))
                             {
+                                var dev = new Device<IStation520, IStation521, ITruss530>(statDev, World);
                                 WCS_Palletizing pall = new WCS_Palletizing();
                                 //获取码垛信息
                                 SqlSugarHelper.Do(_db =>
@@ -190,13 +191,13 @@ namespace WCS.WorkEngineering.Systems
 
                                 foreach (var loc in pallLoc)
                                 {
-                                    statDev.Data3.GetType().GetProperty($"IsGoods{loc.XYNo - 1}").SetValue(obj.Data3, loc.Finish);
+                                    dev.Data3.GetType().GetProperty($"IsGoods{loc.XYNo - 1}").SetValue(obj.Data3, loc.Finish);
                                 }
 
-                                statDev.Data3.MaxQuantity = pall.CountQty.ToShort();
-                                statDev.Data3.Quantity = pallLoc.Count(x => x.Finish).ToShort();
-                                statDev.Data3.Type = pall.ShortCode;
-                                statDev.Data3.VoucherNo++;
+                                dev.Data3.MaxQuantity = pall.CountQty.ToShort();
+                                dev.Data3.Quantity = pallLoc.Count(x => x.Finish).ToShort();
+                                dev.Data3.Type = pall.ShortCode;
+                                dev.Data3.VoucherNo++;
                             }
                             else
                             {

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

@@ -43,7 +43,7 @@ namespace WCS.WorkEngineering.Systems
                 //拆分防止锁表
                 foreach (var taskId in taskIdList)
                 {
-                    var task = db.Queryable<WCS_TaskInfo>().SplitTable(x => x.Take(2)).First(x => x.ID == taskId);
+                    var task = db.Queryable<WCS_TaskInfo>().First(x => x.ID == taskId);
                     task.Uploaded = TaskStatus.ConveyorExecution;
                     task.EditTime = DateTime.Now;
                     db.Updateable(task).ExecuteCommand();

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/一楼叠盘机入库.cs

@@ -15,7 +15,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  一楼叠盘机入库
     /// </summary>
-   //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     [Description("一楼叠盘机入库")]
     public class 一楼叠盘机入库 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
     {

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/二楼拆盘机自动补空托盘组.cs

@@ -14,7 +14,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  二楼拆盘机自动补空托盘组
     /// </summary>
-    //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     [Description("二楼拆盘机自动补空托盘组")]
     public class 二楼拆盘机自动补空托盘组 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
     {

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

@@ -48,6 +48,12 @@ namespace WCS.WorkEngineering.Systems
                 }
                 var mainlineDiversion = JsonConvert.DeserializeObject<MainlineDiversion>(value);
                 var srmCode = mainlineDiversion.WarehouseCode.WarehouseToSrm();
+                var path = DevicePath.GetPath(obj.Entity.Code, srmCode);
+                if (path is { Points.Count: < 2 })
+                {
+                    World.Log($"{bcrCode}:路径错误,当前位置{obj.Entity.Code},目标位置:{srmCode}", LogLevelEnum.High);
+                    continue;
+                }
                 var next = DevicePath.GetPath(obj.Entity.Code, srmCode).Points[1].Code;
                 WCS_TaskInfo taskInfo = null;
 

+ 26 - 19
业务工程/分拣库/WCS.WorkEngineering/Systems/分拣支线/桁架分流点.cs

@@ -127,24 +127,24 @@ namespace WCS.WorkEngineering.Systems
             if (devCode == 0)
             {
                 World.Log($"无可用线体:{taskInfo.ID}");
-                var endTime = DateTime.Now.AddMinutes(-10);
-                //找一个当前时间最早且已超过25分钟未码垛的码垛信息半托入库
-                //未结束且包含当前物料编号的垛形,按时间排序,创建时间早的优先分配,当前任务的仓库号必须要等于码垛信息绑定的仓库号
-                var palletizing = db.Queryable<WCS_Palletizing>()
-                    .Includes(x => x.Layers, r => r.Rows, l => l.Locs)
-                    .Where(x => !x.Finish && x.WarehouseCode == taskInfo.WarehouseCode && x.Layers.Any(l => l.Rows.Any(r => r.Finish)))
-                    .Where(x => x.EditTime < endTime).ToList()
-                    .MinBy(x => x.AddTime);
-                cacheLineList = db.Queryable<WCS_CacheLine>().Where(x => x.WarehouseCode == taskInfo.WarehouseCode && x.IsTruss).ToList();
-
-                if (palletizing != null && !cacheLineList.Any())
-                {
-                    var dev = Device.All.Where(x => x.Code == palletizing.PalletizingStation).Select(x => new Device<ITruss530>(x, World)).FirstOrDefault();
-                    if (dev != null && !dev.Data.CmdType.HasFlag(TrussCmdType.Two))
-                    {
-                        dev.Data.CmdType = TrussCmdType.Two;
-                    }
-                }
+                //var endTime = DateTime.Now.AddMinutes(-10);
+                ////找一个当前时间最早且已超过25分钟未码垛的码垛信息半托入库
+                ////未结束且包含当前物料编号的垛形,按时间排序,创建时间早的优先分配,当前任务的仓库号必须要等于码垛信息绑定的仓库号
+                //var palletizing = db.Queryable<WCS_Palletizing>()
+                //    .Includes(x => x.Layers, r => r.Rows, l => l.Locs)
+                //    .Where(x => !x.Finish && x.WarehouseCode == taskInfo.WarehouseCode && x.Layers.Any(l => l.Rows.Any(r => r.Finish)))
+                //    .Where(x => x.EditTime < endTime).ToList()
+                //    .MinBy(x => x.AddTime);
+                //cacheLineList = db.Queryable<WCS_CacheLine>().Where(x => x.WarehouseCode == taskInfo.WarehouseCode && x.IsTruss).ToList();
+
+                //if (palletizing != null && !cacheLineList.Any())
+                //{
+                //    var dev = Device.All.Where(x => x.Code == palletizing.PalletizingStation).Select(x => new Device<ITruss530>(x, World)).FirstOrDefault();
+                //    if (dev != null && !dev.Data.CmdType.HasFlag(TrussCmdType.Two))
+                //    {
+                //        dev.Data.CmdType = TrussCmdType.Two;
+                //    }
+                //}
                 return false;
             }
             var result = false;
@@ -214,7 +214,7 @@ namespace WCS.WorkEngineering.Systems
                     switch (obj.Entity.Code)
                     {
                         case "455":
-                            twoDevCode.AddRange(new List<string>() { "", "" });
+                            twoDevCode.AddRange(new List<string>() { "1674", "1675" });
                             break;
 
                         case "655":
@@ -253,6 +253,13 @@ namespace WCS.WorkEngineering.Systems
                     palletizing.EditTime = DateTime.Now;
                     palletizing.Finish = false;
                     palletizing.PalletizingStation = twoDevs.FirstOrDefault();
+                    palletizing.TaskAddNext ??= devCode.ToString();
+                    db.Updateable(palletizing).ExecuteCommand();
+                }
+
+                if (palletizing.TaskAddNext == null)
+                {
+                    palletizing.TaskAddNext = devCode.ToString();
                     db.Updateable(palletizing).ExecuteCommand();
                 }
 

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/机台叫料生成AGV任务.cs

@@ -12,7 +12,7 @@ using TaskStatus = WCS.Entity.TaskStatus;
 
 namespace WCS.WorkEngineering.Systems
 {
-    //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     [Description("机台叫料生成AGV任务")]
     public class 机台叫料生成AGV任务 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
     {

+ 14 - 15
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架.cs

@@ -97,7 +97,7 @@ namespace WCS.WorkEngineering.Systems
                     db.Updateable(palletizing).ExecuteCommand();
                     var taskId = upDateableRow.SelectMany(x => x.Locs).Select(x => x.TaskId).ToList();
                     var taskList = db.Queryable<WCS_TaskInfo>().Where(x => taskId.Contains(x.ID)).Select(x => x.BarCode).ToList();
-                    var res = WmsApi.BingPallet(palletizing.PalleCode, taskList, palletizing.WarehouseCode, palletizing.PalletizingStation);
+                    WmsApi.BingPallet(palletizing.PalleCode, taskList, palletizing.WarehouseCode, palletizing.PalletizingStation);
                     isFinish = true;
                 });
                 if (!isFinish) throw new KnownException($"绑盘失败", LogLevelEnum.High);
@@ -159,9 +159,8 @@ namespace WCS.WorkEngineering.Systems
                 //筛选出目标位置有光电的码垛记录信息
                 var devCode = palletizingLsit.Select(x => x.PalletizingStation);
                 var taskCode = palletizingLsit.Select(x => x.Id);
-                var devList = Device.All.Where(x => devCode.Contains(x.Code)).Select(x => new Device<IStation521, IStation523, ITruss530>(x, World)).ToList();
-                devList = devList.Where(x => x.Data2.Status.HasFlag(StationStatus.PH_Status) && taskCode.Contains(x.Data.TaskNumber) && !x.Data3.CmdType.HasFlag(TrussCmdType.Two)).ToList();
-                devCode = devList.Select(x => x.Entity.Code);
+                var devList = Device.All.Where(x => devCode.Contains(x.Code)).Select(x => new Device<IStation521, IStation523>(x, World)).ToList();
+                devList = devList.Where(x => x.Data2.Status.HasFlag(StationStatus.PH_Status) && taskCode.Contains(x.Data.TaskNumber)).ToList();
                 if (!devCode.Any()) throw new KnownException($"无可用放货码垛位,请检查实际有货位置的光电是否正常", LogLevelEnum.Mid);
                 palletizingLsit = palletizingLsit.Where(x => devCode.Contains(x.PalletizingStation)).ToList(); //可以放货的目标托盘
                 //可以取货的码垛信息
@@ -343,7 +342,7 @@ namespace WCS.WorkEngineering.Systems
 
         public override bool Select(Device dev)
         {
-            return dev.Code is "Truss1" or "Truss2" or "Truss3";
+            return dev.Code is "Truss1" /*or "Truss2" or "Truss3"*/;
         }
 
         public 桁架()
@@ -364,16 +363,16 @@ namespace WCS.WorkEngineering.Systems
                         _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "559"), World), Device.All.Where(x => x.Code is "559" or "560" or "561" or "562" or "563").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
                         _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "573"), World), Device.All.Where(x => x.Code is "573" or "574" or "575" or "576" or "577").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
                         _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "586"), World), Device.All.Where(x => x.Code is "586" or "587" or "588" or "589" or "590").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "661"), World), Device.All.Where(x => x.Code is "661" or "662" or "663" or "664" or "665").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "675"), World), Device.All.Where(x => x.Code is "675" or "676" or "677" or "678" or "679").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "689"), World), Device.All.Where(x => x.Code is "690" or "691" or "692" or "693" or "689").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "703"), World), Device.All.Where(x => x.Code is "703" or "704" or "705" or "706" or "707").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "717"), World), Device.All.Where(x => x.Code is "717" or "718" or "719" or "720" or "721").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "731"), World), Device.All.Where(x => x.Code is "732" or "733" or "734" or "735" or "731").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "745"), World), Device.All.Where(x => x.Code is "746" or "747" or "748" or "749" or "745").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "759"), World), Device.All.Where(x => x.Code is "759" or "760" or "761" or "762" or "763").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "773"), World), Device.All.Where(x => x.Code is "773" or "774" or "775" or "776" or "777").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-                        _pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "786"), World), Device.All.Where(x => x.Code is "786" or "787" or "788" or "789" or "790").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "661"), World), Device.All.Where(x => x.Code is "661" or "662" or "663" or "664" or "665").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "675"), World), Device.All.Where(x => x.Code is "675" or "676" or "677" or "678" or "679").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "689"), World), Device.All.Where(x => x.Code is "690" or "691" or "692" or "693" or "689").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "703"), World), Device.All.Where(x => x.Code is "703" or "704" or "705" or "706" or "707").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "717"), World), Device.All.Where(x => x.Code is "717" or "718" or "719" or "720" or "721").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "731"), World), Device.All.Where(x => x.Code is "732" or "733" or "734" or "735" or "731").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "745"), World), Device.All.Where(x => x.Code is "746" or "747" or "748" or "749" or "745").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "759"), World), Device.All.Where(x => x.Code is "759" or "760" or "761" or "762" or "763").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "773"), World), Device.All.Where(x => x.Code is "773" or "774" or "775" or "776" or "777").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+                        //_pickUpDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "786"), World), Device.All.Where(x => x.Code is "786" or "787" or "788" or "789" or "790").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
                         break;
 
                     case "Truss2":

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

@@ -29,13 +29,13 @@ namespace WCS.WorkEngineering.Systems
             {
                 var db = _db.Default;
                 //取一个时间最靠前的,没有绑定码垛工位的码垛记录
-                var palletizingInfo = db.Queryable<WCS_Palletizing>().OrderBy(x => x.AddTime).First(x => x.DeviceCode != "Truss1" && x.PalletizingStation == null && !x.Finish);
+                var palletizingInfo = db.Queryable<WCS_Palletizing>().OrderBy(x => x.AddTime).First(x => x.PalletizingStation == null && !x.Finish);
                 if (palletizingInfo == null) throw new Exception($"没有可用码垛信息");
-                var palleTask = db.Queryable<WCS_TaskInfo>().First(x => x.ID == palletizingInfo.TaskId && (x.Status == TaskStatus.FinishOfShunt || x.Status == TaskStatus.ConveyorExecution));
-                if (palleTask == null) throw new Exception($"未找到任务{palleTask.ID}");
+                //var palleTask = db.Queryable<WCS_TaskInfo>().First(x => x.ID == palletizingInfo.TaskId && (x.Status == TaskStatus.FinishOfShunt || x.Status == TaskStatus.ConveyorExecution));
+                //if (palleTask == null) throw new Exception($"未找到任务{palleTask.ID}");
                 //获取可以使用的放货站台信息
-                var taskAddNext = Device.All.FirstOrDefault(x => x.Code == palleTask.AddrNext).Targets.FirstOrDefault().Targets.Where(x => x.HasFlag(DeviceFlags.桁架码垛位));
-                if (taskAddNext == null) throw new Exception($"未找到{palleTask.AddrNext}可去的码垛工位");
+                var taskAddNext = Device.All.FirstOrDefault(x => x.Code == palletizingInfo.TaskAddNext).Targets.FirstOrDefault().Targets.Where(x => x.HasFlag(DeviceFlags.桁架码垛位));
+                if (taskAddNext == null) throw new Exception($"未找到{palletizingInfo.TaskAddNext}可去的码垛工位");
                 var devs = Device.All.Where(x => taskAddNext.Contains(x)).Select(x => new Device<IStation520, IStation521, IStation523>(x, World)).ToList();
 
                 //获取所有的未结束且有码垛工位的码垛记录

+ 2 - 1
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架码垛工位任务结束处理.cs

@@ -87,7 +87,8 @@ namespace WCS.WorkEngineering.Systems
 
         public override bool Select(Device dev)
         {
-            return dev.HasFlag(DeviceFlags.桁架码垛位) || dev.Code is "1715" or "1716";
+            var devCodes = new List<string>() { "1674", "1675", "1715", "1716" };
+            return dev.HasFlag(DeviceFlags.桁架码垛位) || devCodes.Contains(dev.Code);
         }
     }
 }

+ 54 - 54
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架缓存放行点.cs

@@ -127,60 +127,60 @@ namespace WCS.WorkEngineering.Systems
             _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "578"), World), Device.All.Where(x => x.Code is "578" or "579" or "580" or "581" or "582").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "591"), World), Device.All.Where(x => x.Code is "591" or "592" or "593" or "594" or "595").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             //库一南
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "666"), World), Device.All.Where(x => x.Code is "666" or "667" or "668" or "669" or "670").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "680"), World), Device.All.Where(x => x.Code is "680" or "681" or "682" or "683" or "684").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "694"), World), Device.All.Where(x => x.Code is "694" or "695" or "696" or "697" or "698").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "708"), World), Device.All.Where(x => x.Code is "708" or "709" or "710" or "711" or "712").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "722"), World), Device.All.Where(x => x.Code is "722" or "723" or "724" or "725" or "726").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "736"), World), Device.All.Where(x => x.Code is "736" or "737" or "738" or "739" or "740").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "750"), World), Device.All.Where(x => x.Code is "750" or "751" or "752" or "753" or "754").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "764"), World), Device.All.Where(x => x.Code is "764" or "765" or "766" or "767" or "768").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "778"), World), Device.All.Where(x => x.Code is "778" or "779" or "780" or "781" or "782").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "791"), World), Device.All.Where(x => x.Code is "791" or "792" or "793" or "794" or "795").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //库二北
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "866"), World), Device.All.Where(x => x.Code is "866" or "867" or "868" or "869" or "870").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "880"), World), Device.All.Where(x => x.Code is "880" or "881" or "882" or "883" or "884").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "894"), World), Device.All.Where(x => x.Code is "894" or "895" or "896" or "897" or "898").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "908"), World), Device.All.Where(x => x.Code is "908" or "909" or "910" or "911" or "912").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "922"), World), Device.All.Where(x => x.Code is "922" or "923" or "924" or "925" or "926").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "936"), World), Device.All.Where(x => x.Code is "936" or "937" or "938" or "939" or "940").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "950"), World), Device.All.Where(x => x.Code is "950" or "951" or "952" or "953" or "954").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "964"), World), Device.All.Where(x => x.Code is "964" or "965" or "966" or "967" or "968").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "978"), World), Device.All.Where(x => x.Code is "978" or "979" or "980" or "981" or "982").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "991"), World), Device.All.Where(x => x.Code is "991" or "992" or "993" or "994" or "995").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //库二南
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1066"), World), Device.All.Where(x => x.Code is "1066" or "1067" or "1068" or "1069" or "1070").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1080"), World), Device.All.Where(x => x.Code is "1080" or "1081" or "1082" or "1083" or "1084").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1094"), World), Device.All.Where(x => x.Code is "1094" or "1095" or "1096" or "1097" or "1098").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1108"), World), Device.All.Where(x => x.Code is "1108" or "1109" or "1110" or "1111" or "1112").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1122"), World), Device.All.Where(x => x.Code is "1122" or "1123" or "1124" or "1125" or "1126").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1136"), World), Device.All.Where(x => x.Code is "1136" or "1137" or "1138" or "1139" or "1140").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1150"), World), Device.All.Where(x => x.Code is "1150" or "1151" or "1152" or "1153" or "1154").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1164"), World), Device.All.Where(x => x.Code is "1164" or "1165" or "1166" or "1167" or "1168").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1178"), World), Device.All.Where(x => x.Code is "1178" or "1179" or "1180" or "1181" or "1182").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1191"), World), Device.All.Where(x => x.Code is "1191" or "1192" or "1193" or "1194" or "1195").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //库三北
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1266"), World), Device.All.Where(x => x.Code is "1266" or "1267" or "1268" or "1269" or "1270").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1280"), World), Device.All.Where(x => x.Code is "1280" or "1281" or "1282" or "1283" or "1284").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1294"), World), Device.All.Where(x => x.Code is "1294" or "1295" or "1296" or "1297" or "1298").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1308"), World), Device.All.Where(x => x.Code is "1308" or "1309" or "1310" or "1311" or "1312").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1322"), World), Device.All.Where(x => x.Code is "1322" or "1323" or "1324" or "1325" or "1326").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1336"), World), Device.All.Where(x => x.Code is "1336" or "1337" or "1338" or "1339" or "1340").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1350"), World), Device.All.Where(x => x.Code is "1350" or "1351" or "1352" or "1353" or "1354").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1364"), World), Device.All.Where(x => x.Code is "1364" or "1365" or "1366" or "1367" or "1368").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1378"), World), Device.All.Where(x => x.Code is "1378" or "1379" or "1380" or "1381" or "1382").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1391"), World), Device.All.Where(x => x.Code is "1391" or "1392" or "1393" or "1394" or "1395").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //库三南
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1466"), World), Device.All.Where(x => x.Code is "1466" or "1467" or "1468" or "1469" or "1470").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1480"), World), Device.All.Where(x => x.Code is "1480" or "1481" or "1482" or "1483" or "1484").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1494"), World), Device.All.Where(x => x.Code is "1494" or "1495" or "1496" or "1497" or "1498").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1508"), World), Device.All.Where(x => x.Code is "1508" or "1509" or "1510" or "1511" or "1512").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1522"), World), Device.All.Where(x => x.Code is "1522" or "1523" or "1524" or "1525" or "1526").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1536"), World), Device.All.Where(x => x.Code is "1536" or "1537" or "1538" or "1539" or "1540").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1550"), World), Device.All.Where(x => x.Code is "1550" or "1551" or "1552" or "1553" or "1554").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1564"), World), Device.All.Where(x => x.Code is "1564" or "1565" or "1566" or "1567" or "1568").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1578"), World), Device.All.Where(x => x.Code is "1578" or "1579" or "1580" or "1581" or "1582").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1591"), World), Device.All.Where(x => x.Code is "1591" or "1592" or "1593" or "1594" or "1595").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "666"), World), Device.All.Where(x => x.Code is "666" or "667" or "668" or "669" or "670").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "680"), World), Device.All.Where(x => x.Code is "680" or "681" or "682" or "683" or "684").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "694"), World), Device.All.Where(x => x.Code is "694" or "695" or "696" or "697" or "698").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "708"), World), Device.All.Where(x => x.Code is "708" or "709" or "710" or "711" or "712").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "722"), World), Device.All.Where(x => x.Code is "722" or "723" or "724" or "725" or "726").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "736"), World), Device.All.Where(x => x.Code is "736" or "737" or "738" or "739" or "740").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "750"), World), Device.All.Where(x => x.Code is "750" or "751" or "752" or "753" or "754").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "764"), World), Device.All.Where(x => x.Code is "764" or "765" or "766" or "767" or "768").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "778"), World), Device.All.Where(x => x.Code is "778" or "779" or "780" or "781" or "782").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "791"), World), Device.All.Where(x => x.Code is "791" or "792" or "793" or "794" or "795").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            ////库二北
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "866"), World), Device.All.Where(x => x.Code is "866" or "867" or "868" or "869" or "870").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "880"), World), Device.All.Where(x => x.Code is "880" or "881" or "882" or "883" or "884").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "894"), World), Device.All.Where(x => x.Code is "894" or "895" or "896" or "897" or "898").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "908"), World), Device.All.Where(x => x.Code is "908" or "909" or "910" or "911" or "912").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "922"), World), Device.All.Where(x => x.Code is "922" or "923" or "924" or "925" or "926").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "936"), World), Device.All.Where(x => x.Code is "936" or "937" or "938" or "939" or "940").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "950"), World), Device.All.Where(x => x.Code is "950" or "951" or "952" or "953" or "954").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "964"), World), Device.All.Where(x => x.Code is "964" or "965" or "966" or "967" or "968").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "978"), World), Device.All.Where(x => x.Code is "978" or "979" or "980" or "981" or "982").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "991"), World), Device.All.Where(x => x.Code is "991" or "992" or "993" or "994" or "995").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            ////库二南
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1066"), World), Device.All.Where(x => x.Code is "1066" or "1067" or "1068" or "1069" or "1070").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1080"), World), Device.All.Where(x => x.Code is "1080" or "1081" or "1082" or "1083" or "1084").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1094"), World), Device.All.Where(x => x.Code is "1094" or "1095" or "1096" or "1097" or "1098").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1108"), World), Device.All.Where(x => x.Code is "1108" or "1109" or "1110" or "1111" or "1112").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1122"), World), Device.All.Where(x => x.Code is "1122" or "1123" or "1124" or "1125" or "1126").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1136"), World), Device.All.Where(x => x.Code is "1136" or "1137" or "1138" or "1139" or "1140").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1150"), World), Device.All.Where(x => x.Code is "1150" or "1151" or "1152" or "1153" or "1154").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1164"), World), Device.All.Where(x => x.Code is "1164" or "1165" or "1166" or "1167" or "1168").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1178"), World), Device.All.Where(x => x.Code is "1178" or "1179" or "1180" or "1181" or "1182").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1191"), World), Device.All.Where(x => x.Code is "1191" or "1192" or "1193" or "1194" or "1195").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            ////库三北
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1266"), World), Device.All.Where(x => x.Code is "1266" or "1267" or "1268" or "1269" or "1270").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1280"), World), Device.All.Where(x => x.Code is "1280" or "1281" or "1282" or "1283" or "1284").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1294"), World), Device.All.Where(x => x.Code is "1294" or "1295" or "1296" or "1297" or "1298").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1308"), World), Device.All.Where(x => x.Code is "1308" or "1309" or "1310" or "1311" or "1312").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1322"), World), Device.All.Where(x => x.Code is "1322" or "1323" or "1324" or "1325" or "1326").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1336"), World), Device.All.Where(x => x.Code is "1336" or "1337" or "1338" or "1339" or "1340").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1350"), World), Device.All.Where(x => x.Code is "1350" or "1351" or "1352" or "1353" or "1354").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1364"), World), Device.All.Where(x => x.Code is "1364" or "1365" or "1366" or "1367" or "1368").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1378"), World), Device.All.Where(x => x.Code is "1378" or "1379" or "1380" or "1381" or "1382").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1391"), World), Device.All.Where(x => x.Code is "1391" or "1392" or "1393" or "1394" or "1395").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            ////库三南
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1466"), World), Device.All.Where(x => x.Code is "1466" or "1467" or "1468" or "1469" or "1470").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1480"), World), Device.All.Where(x => x.Code is "1480" or "1481" or "1482" or "1483" or "1484").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1494"), World), Device.All.Where(x => x.Code is "1494" or "1495" or "1496" or "1497" or "1498").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1508"), World), Device.All.Where(x => x.Code is "1508" or "1509" or "1510" or "1511" or "1512").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1522"), World), Device.All.Where(x => x.Code is "1522" or "1523" or "1524" or "1525" or "1526").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1536"), World), Device.All.Where(x => x.Code is "1536" or "1537" or "1538" or "1539" or "1540").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1550"), World), Device.All.Where(x => x.Code is "1550" or "1551" or "1552" or "1553" or "1554").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1564"), World), Device.All.Where(x => x.Code is "1564" or "1565" or "1566" or "1567" or "1568").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1578"), World), Device.All.Where(x => x.Code is "1578" or "1579" or "1580" or "1581" or "1582").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1591"), World), Device.All.Where(x => x.Code is "1591" or "1592" or "1593" or "1594" or "1595").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
         }
     }
 }

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

@@ -11,13 +11,14 @@ using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
+using TaskStatus = WCS.Entity.TaskStatus;
 
 namespace WCS.WorkEngineering.Systems
 {
     /// <summary>
     ///   机械臂
     /// </summary>
-  [BelongTo(typeof(RingWorld))]
+    [BelongTo(typeof(RingWorld))]
     [Description("机械臂")]
     public class 机械臂 : DeviceSystem<Device<IRobot520, IRobot521, IRobot522>>
     {
@@ -81,11 +82,14 @@ namespace WCS.WorkEngineering.Systems
                                 break;
 
                             case TaskType.OutDepot:
+                                var pall = db.Default.Queryable<WCS_TaskInfo>().Where(x =>
+                                    x.AddrTo == task.AddrTo && x.Type == TaskType.Delivery &&
+                                    x.Status < TaskStatus.Finish).First() ?? throw new Exception($"未找到对应的托盘搬运任务,无法进行绑盘");
                                 task.Status = Entity.TaskStatus.ConveyorExecution;
                                 task.EditTime = DateTime.Now;
                                 db.Default.Updateable(task).ExecuteCommand();
                                 task.AddWCS_TASK_DTL(db.Default, task.AddrTo, "出库任务结束");
-
+                              
                                 break;
 
                             case TaskType.TransferDepot:
@@ -420,7 +424,7 @@ namespace WCS.WorkEngineering.Systems
 
         public override bool Select(Device dev)
         {
-            return dev.Code is /*"Robot1" or "Robot2" or*/ "Robot3" or "Robot4" or "Robot5" or "Robot6";
+            return dev.Code is "Robot1" or "Robot2" or "Robot3" or "Robot4" or "Robot5" or "Robot6";
         }
     }
 }

+ 18 - 6
业务工程/分拣库/WCS.WorkEngineering/Systems/环形库/环形库码垛结束.cs

@@ -29,10 +29,7 @@ namespace WCS.WorkEngineering.Systems.环形库
 
         public override void Do(Device<IStation520, IStation521, IStation523, IRobot530, IRobot531> obj)
         {
-            if (!obj.Data5.CmdType.HasFlag(RobotCmdType.End))
-            {
-                obj.Data4.CmdType = 0;
-            }
+            if (!obj.Data5.CmdType.HasFlag(RobotCmdType.End) && obj.Data4.CmdType != 0) obj.Data4.CmdType = 0;
             if (!obj.Data3.Status.HasFlag(StationStatus.PH_Status)) return;
             if (!obj.Data5.CmdType.HasFlag(RobotCmdType.End)) return;
             if (obj.Data5.MaxQuantity != obj.Data5.Quantity || obj.Data5.Quantity == 0 || obj.Data5.MaxQuantity == 0) throw new KnownException($"码垛数量异常:最大码垛数量[{obj.Data5.MaxQuantity}]已码数量{obj.Data5.Quantity}", LogLevelEnum.High);
@@ -50,8 +47,23 @@ namespace WCS.WorkEngineering.Systems.环形库
                 {
                     //开始获取当前位置的空托盘搬运任务信息
                     var cbrCode = db.Queryable<WCS_TaskInfo>().First(x => x.Status == TaskStatus.RgvCompleted && x.AddrTo == obj.Entity.Code);
-                    //开始绑盘
-                    WmsApi.FinishBingPallet(cbrCode.BarCode, tasks.Select(x => x.BarCode).ToList(), obj.Entity.Code.GetWareCode(), obj.Entity.Code);
+                    try
+                    {
+                        //开始绑盘
+                        WmsApi.FinishBingPallet(cbrCode.BarCode, tasks.Select(x => x.BarCode).ToList(),
+                            obj.Entity.Code.GetWareCode(), obj.Entity.Code);
+                    }
+                    catch (Exception e)
+                    {
+                        try
+                        {
+                            WmsApi.BingPallet(cbrCode.BarCode, tasks.Select(x => x.BarCode).ToList(), task.WarehouseCode, task.AddrTo);
+                        }
+                        catch (Exception exception)
+                        {
+                            throw new Exception($"{e.Message}");
+                        }
+                    }
                     return;
                 }
 

Файловите разлики са ограничени, защото са твърде много
+ 390 - 384
业务工程/分拣库/WCS.WorkEngineering/WorkStart.cs


Някои файлове не бяха показани, защото твърде много файлове са промени