林豪 左 1 rok temu
rodzic
commit
ff13d51103

+ 16 - 17
WCS.Core/DataBlock.cs

@@ -1,5 +1,4 @@
 using System.Collections;
-using System.Net.NetworkInformation;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
@@ -30,23 +29,23 @@ namespace WCS.Core
             id = DBList.Count;
         }
 
-        DateTime faildTime = DateTime.MinValue;
+        private DateTime faildTime = DateTime.MinValue;
 
         public void RefreshData()
-        { 
+        {
+            var isPing = false;
             try
             {
-                if (failed)
-                { 
-                    if (!Entity.PLCInfo.Ex().Ping) 
-                    {
-                        return;
-                        //throw new Exception($"{Entity.PLCInfo.IP}无法访问");
-                    }
-                } 
+                if (!Entity.PLCInfo.Ex().Ping)
+                {
+                    isPing = true;
+                    throw new Exception($"网络异常IP为{Entity.PLCInfo.IP}的设备PLC无法访问");
+                }
+
                 Start = (ushort)ProxyList.Min(v => v.Info.Position);
                 var last = ProxyList.OrderBy(v => v.Info.Position).Last();
                 Length = (ushort)(last.Info.Position + last.BytesCount);
+
                 var data = new byte[0];
                 lock (Entity.PLCInfo.Ex())
                 {
@@ -55,16 +54,16 @@ namespace WCS.Core
                 if (!Data.SequenceEqual(data))
                 {
                     Data = data;
-                    //DbChanged?.Invoke(Data);
+                    DbChanged?.Invoke(Data);
                 }
-                failed = false;
             }
             catch (Exception ex)
             {
-                failed = true; 
-                throw;
+                if (isPing) throw new Exception($"{ex.Message}");
+
+                throw new Exception($"{ex.Message}:\r{ex.StackTrace}");
             }
-        } 
+        }
 
         public PlcItem<T> Regist<T>(ProtocolProxyBase proxy, string objid, string name, int start, byte arrLen = 1, byte strLen = 0)
         {
@@ -114,7 +113,7 @@ namespace WCS.Core
                 {
                     throw new Exception("只支持一维数组");
                 }
-                var arr = Array.CreateInstance(t, arrLength);   
+                var arr = Array.CreateInstance(t, arrLength);
 
                 for (int i = 0; i < arr.Length; i++)
                 {

+ 13 - 13
WCS.Core/Device.cs

@@ -101,19 +101,19 @@ namespace WCS.Core
             return ProtocolObjs(world)[protocolType];
         }
 
-        object Copy(object obj, Type type)
-        {
-            var res = Activator.CreateInstance(type);
-            foreach (var p in type.GetProperties())
-            {
-                var p2 = obj.GetType().GetProperty(p.Name);
-                if (p2 != null && p2.PropertyType == p.PropertyType)
-                {
-                    p.SetValue(res, p2.GetValue(obj));
-                }
-            }
-            return res;
-        }
+        //object Copy(object obj, Type type)
+        //{
+        //    var res = Activator.CreateInstance(type);
+        //    foreach (var p in type.GetProperties())
+        //    {
+        //        var p2 = obj.GetType().GetProperty(p.Name);
+        //        if (p2 != null && p2.PropertyType == p.PropertyType)
+        //        {
+        //            p.SetValue(res, p2.GetValue(obj));
+        //        }
+        //    }
+        //    return res;
+        //}
 
         public override string ToString()
         {

+ 0 - 2
WCS.Core/ProtocolProxyBase.cs

@@ -82,8 +82,6 @@ namespace WCS.Core
                 BytesCount += item.DataSize;
             }
 
-            var a = ProtocolType.Assembly.GetTypes().Where(v => v.IsClass);
-
             ProtocolDataType = ProtocolType.Assembly.GetTypes().Where(v => v.IsClass).First(v => v.GetInterface(ProtocolType.Name) != null && v != this.GetType());
         }
 

+ 10 - 7
WCS.Core/World.cs

@@ -254,15 +254,17 @@ namespace WCS.Core
 
         private void LoadPlcData(List<WorkTimes> list)
         {
-            var aa = this.GetDataBlocks();
+            var a = this.GetDataBlocks();
             Parallel.ForEach(this.GetDataBlocks(), db =>
             {
+                var b = GetType();
+                var a = b.GetCustomAttribute(typeof(DescriptionAttribute)) as DescriptionAttribute;
                 var channel = new Channel
                 {
-                    World = GetType().Name,
+                    World = a.Description,
                     Stage = "LoadPlcData",
                     System = "",
-                    Item = $"{db.Entity.PLCInfo.IP}_{db.Entity.No}"
+                    Item = $"{db.Entity.PLCInfo.IP}"
                 };
                 var sw = new Stopwatch();
                 sw.Start();
@@ -273,6 +275,9 @@ namespace WCS.Core
                 catch (Exception ex)
                 {
                     this.Ex().Publish(channel, ex.GetBaseException().Message);
+                    sw.Stop();
+                    list.AddSafe(new WorkTimes { Key = $"{db.Entity.PLCInfo.IP}/{db.Entity.No}", Total = sw.ElapsedMilliseconds });
+                    OnLog(channel, ex.Message);
                 }
                 sw.Stop();
                 list.AddSafe(new WorkTimes { Key = $"{db.Entity.PLCInfo.IP}/{db.Entity.No}", Total = sw.ElapsedMilliseconds });
@@ -398,8 +403,7 @@ namespace WCS.Core
 
         public void Publish(Channel channel, string msg)
         {
-            if ((DateTime.Now - SubTime).TotalSeconds > 20)
-                return;
+            if ((DateTime.Now - SubTime).TotalSeconds > 20) return;
             var flag = false;
 
             flag = ChannelList.Any(v =>
@@ -408,8 +412,7 @@ namespace WCS.Core
                 return b.Success;
             });
 
-            if (flag)
-                Redis.Publish(channel.ToString(), msg);
+            if (flag) Redis.Publish(channel.ToString(), msg);
         }
     }
 

+ 1 - 1
WCS.Entity/WCS_Palletizing.cs

@@ -26,7 +26,7 @@ namespace WCS.Entity
         ///  任务
         /// </summary>
         [Navigate(NavigateType.OneToOne, nameof(TaskId))]
-        public WCS_TaskInfo TaskInfo { get; set; }
+        public WCS_TaskInfo? TaskInfo { get; set; }
 
         /// <summary>
         ///  托盘条码

+ 33 - 28
业务工程/分拣库/WCS.WorkEngineering/Systems/SrmSystems.cs

@@ -90,39 +90,44 @@ namespace WCS.WorkEngineering.Systems
                             break;
 
                         case TaskType.OutDepot:
-                            var devs = new List<string>() { };
-                            if ()
+                            var devs = new List<string>() { "1605", "1615", "1625", "1635", "1645", "1655" };
+                            if (devs.Contains(task.SrmStation))
                             {
-
+                                task.Status = Entity.TaskStatus.StackerCompleted;
+                                db.Default.Updateable(task).ExecuteCommand();
+                                task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "出库任务到达放货站台");
                             }
-                            switch (task.OutType)
+                            else
                             {
-                                case OutTypeEnum.自动出库任务 or OutTypeEnum.全自动手动出库任务:
-
-                                    if (task.SrmStation is "1601" or "1605" or "1611" or "1615")
-                                    {
+                                switch (task.OutType)
+                                {
+                                    case OutTypeEnum.自动出库任务 or OutTypeEnum.全自动手动出库任务:
+
+                                        if (task.SrmStation is "1601" or "1605" or "1611" or "1615")
+                                        {
+                                            task.Status = Entity.TaskStatus.Finish;
+                                            var dev = new Station(Device.All.FirstOrDefault(v => v.Code == task.SrmStation) ?? throw new KnownException($"未找到{task.SrmStation}信息", LogLevelEnum.High), this.World);
+                                            db.Default.Updateable(task).ExecuteCommand();
+                                            task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "出库任务到达放货站台");
+                                        }
+                                        else
+                                        {
+                                            task.Status = Entity.TaskStatus.ConveyorExecution;
+                                            var dev = new Station(Device.All.FirstOrDefault(v => v.Code == task.SrmStation) ?? throw new KnownException($"未找到{task.SrmStation}信息", LogLevelEnum.High), this.World);
+                                            dev.Data.TaskNumber = task.ID;
+                                            db.Default.Updateable(task).ExecuteCommand();
+                                            task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "出库任务到达放货站台");
+                                        }
+
+                                        break;
+
+                                    case OutTypeEnum.半自动手动出库任务:
                                         task.Status = Entity.TaskStatus.Finish;
-                                        var dev = new Station(Device.All.FirstOrDefault(v => v.Code == task.SrmStation) ?? throw new KnownException($"未找到{task.SrmStation}信息", LogLevelEnum.High), this.World);
-                                        db.Default.Updateable(task).ExecuteCommand();
-                                        task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "出库任务到达放货站台");
-                                    }
-                                    else
-                                    {
-                                        task.Status = Entity.TaskStatus.ConveyorExecution;
-                                        var dev = new Station(Device.All.FirstOrDefault(v => v.Code == task.SrmStation) ?? throw new KnownException($"未找到{task.SrmStation}信息", LogLevelEnum.High), this.World);
-                                        dev.Data.TaskNumber = task.ID;
+                                        task.EditTime = DateTime.Now;
                                         db.Default.Updateable(task).ExecuteCommand();
-                                        task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "出库任务到达放货站台");
-                                    }
-
-                                    break;
-
-                                case OutTypeEnum.半自动手动出库任务:
-                                    task.Status = Entity.TaskStatus.Finish;
-                                    task.EditTime = DateTime.Now;
-                                    db.Default.Updateable(task).ExecuteCommand();
-                                    task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "半自动手动出库任务结束");
-                                    break;
+                                        task.AddWCS_TASK_DTL(db.Default, task.SrmStation, "半自动手动出库任务结束");
+                                        break;
+                                }
                             }
 
                             break;

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

@@ -152,8 +152,7 @@ namespace WCS.WorkEngineering.Systems
             //未结束且包含当前物料编号的垛形,按时间排序,创建时间早的优先分配,当前任务的仓库号必须要等于码垛信息绑定的仓库号
             var palletizingList = db.Queryable<WCS_Palletizing>()
                 .Includes(x => x.Layers, r => r.Rows, l => l.Locs)
-                .Includes(x => x.TaskInfo)
-                .Where(x => (!x.Finish || (x.Finish && x.isItHalf && x.TaskInfo == null)) && x.MatCodeList.Contains(taskInfo.MatCode) && x.WarehouseCode == taskInfo.WarehouseCode)
+                .Where(x => (!x.Finish || (x.Finish && x.isItHalf)) && x.MatCodeList.Contains(taskInfo.MatCode) && x.WarehouseCode == taskInfo.WarehouseCode)
                 .OrderBy(x => x.AddTime)
                 .ToList();
 
@@ -223,11 +222,11 @@ namespace WCS.WorkEngineering.Systems
                             break;
 
                         case "855":
-                            twoDevCode.AddRange(new List<string>() { "", "" });
+                            twoDevCode.AddRange(new List<string>() { "1700", "1701" });
                             break;
 
                         case "1055":
-                            twoDevCode.AddRange(new List<string>() { "", "" });
+                            twoDevCode.AddRange(new List<string>() { "1715", "1716" });
                             break;
 
                         case "1255":

+ 60 - 0
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/二次码垛任务到RGV取货位处理.cs

@@ -0,0 +1,60 @@
+using ServiceCenter.Extensions;
+using ServiceCenter.SqlSugars;
+using System.ComponentModel;
+using WCS.Core;
+using WCS.Entity;
+using WCS.Entity.Protocol.Station;
+using WCS.WorkEngineering.Extensions;
+using WCS.WorkEngineering.Worlds;
+using TaskStatus = WCS.Entity.TaskStatus;
+
+namespace WCS.WorkEngineering.Systems.桁架码垛
+{
+    /// <summary>
+    ///  二次码垛任务到RGV取货位处理
+    /// </summary>
+    [BelongTo(typeof(SortingPalletizingWorld))]
+    [Description("二次码垛任务到RGV取货位处理")]
+    public class 二次码垛任务到RGV取货位处理 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
+    {
+        protected override bool ParallelDo => true;
+        protected override bool SaveLogsToFile => true;
+
+        public override void Do(Device<IStation520, IStation521, IStation523> obj)
+        {
+            if (!obj.Data3.Status.HasFlag(StationStatus.Auto)) return;
+            if (!obj.Data3.Status.HasFlag(StationStatus.PH_Status)) return;
+            if (!obj.Data3.Status.HasFlag(StationStatus.OT_Status)) return;
+            if (obj.Data2.Request != 1) return;
+
+            var addNext = 1;
+            WCS_TaskInfo task = null;
+
+            SqlSugarHelper.Do(_db =>
+            {
+                var db = _db.Default;
+                var soDev = obj.Entity.Sources.First();
+                var taskInfo = db.Queryable<WCS_TaskInfo>().First(x => x.SrmStation == soDev.Code && x.Status == TaskStatus.StackerCompleted);
+                if (taskInfo == null) return;
+                var pall = db.Queryable<WCS_Palletizing>().First(x => x.TaskId == taskInfo.ID && !x.Finish);
+                if (pall == null) return;
+                taskInfo.Status = TaskStatus.Finish;
+                taskInfo.EditTime = DateTime.Now;
+                taskInfo.EndTime = DateTime.Now;
+                db.Updateable(taskInfo).ExecuteCommand();
+                taskInfo.AddWCS_TASK_DTL(db, obj.Entity.Code, "二次码垛出库任务完成");
+                task = taskInfo;
+            });
+            if (task == null) return;
+            obj.Data.TaskNumber = task.ID;
+            obj.Data.GoodsStart = obj.Entity.Code.ToShort();
+            obj.Data.GoodsEnd = addNext.ToShort();
+            obj.Data.VoucherNo++;
+        }
+
+        public override bool Select(Device dev)
+        {
+            return dev.Code is /*"1606" or "1616" or "1626" or*/ "1636" /*or "1646" or "1656"*/;
+        }
+    }
+}

+ 29 - 2
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/创建二次码垛出库任务.cs

@@ -1,6 +1,11 @@
-using System.ComponentModel;
+using ServiceCenter.Logs;
+using ServiceCenter.SqlSugars;
+using System.ComponentModel;
 using WCS.Core;
+using WCS.Entity;
 using WCS.Entity.Protocol.Station;
+using WCS.WorkEngineering.Extensions;
+using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
 
 namespace WCS.WorkEngineering.Systems.桁架码垛
@@ -15,7 +20,29 @@ namespace WCS.WorkEngineering.Systems.桁架码垛
 
         public override void Do(Device<IStation520> obj)
         {
-            //var 
+            SqlSugarHelper.Do(_db =>
+            {
+                var db = _db.Default;
+                var palls = db.Queryable<WCS_Palletizing>().Where(x => !x.Finish && x.isItHalf).ToList();
+                foreach (var pall in palls)
+                {
+                    var task = db.Queryable<WCS_TaskInfo>().First(x => x.ID == pall.Id);
+                    if (task != null) continue;
+
+                    try
+                    {
+                        //没有对应的出库任务
+                        var res = WmsApi.GetTwoPallet(pall.WarehouseCode, pall.TaskId);
+                        pall.TaskId = res.ResData;
+                        db.Updateable(pall).ExecuteCommand();
+                    }
+                    catch (Exception e)
+                    {
+                        World.Log(e.Message, LogLevelEnum.Mid);
+                        continue;
+                    }
+                }
+            });
         }
 
         public override bool Select(Device dev)

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

@@ -69,8 +69,7 @@ namespace WCS.WorkEngineering.Systems
                         }
                         catch (Exception a)
                         {
-                            Console.WriteLine(a);
-                            throw;
+                            throw new KnownException(a.Message, LogLevelEnum.High);
                         }
                         row.Finish = true;
                         upDateableRow.Add(row);
@@ -159,11 +158,11 @@ namespace WCS.WorkEngineering.Systems
                     .Where(x => x.Layers.Any(l => !l.Finish) && x.PalletizingStation != null).ToList();
                 //筛选出目标位置有光电的码垛记录信息
                 var devCode = palletizingLsit.Select(x => x.PalletizingStation);
-                var devList = Device.All.Where(x => devCode.Contains(x.Code)).Select(x => new Device<IStation520, IStation521, IStation523, ITruss530>(x, World)).ToList();
-                devList = devList.Where(x => x.Data3.Status.HasFlag(StationStatus.PH_Status) && !x.Data4.CmdType.HasFlag(TrussCmdType.Two)).ToList();
-                devCode = devList.Select(x => x.Entity.Code);
-                if (!devCode.Any()) throw new KnownException($"无可用放货码垛位,请检查实际有货位置的光电是否正常", LogLevelEnum.Mid);
-                palletizingLsit = palletizingLsit.Where(x => devCode.Contains(x.PalletizingStation)).ToList(); //可以放货的目标托盘
+                //var devList = Device.All.Where(x => devCode.Contains(x.Code)).Select(x => new Device<IStation520, IStation521, IStation523, ITruss530>(x, World)).ToList();
+                //devList = devList.Where(x => x.Data3.Status.HasFlag(StationStatus.PH_Status) && !x.Data4.CmdType.HasFlag(TrussCmdType.Two)).ToList();
+                //devCode = devList.Select(x => x.Entity.Code);
+                //if (!devCode.Any()) throw new KnownException($"无可用放货码垛位,请检查实际有货位置的光电是否正常", LogLevelEnum.Mid);
+                palletizingLsit = palletizingLsit.Where(x => x.PalletizingStation == "1716").ToList(); //可以放货的目标托盘
                 //可以取货的码垛信息
                 var pickUpCode = _pickUpDevices.Select(x => x.Key.Entity.Code.ToShort());
                 //从缓存线信息找到可以取货的缓存线

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

@@ -8,10 +8,12 @@ using WCS.WorkEngineering.WebApi.Models.WCS.Response;
 using WCS.WorkEngineering.WebApi.Models.WMS.Request;
 using WCS.WorkEngineering.WebApi.Models.WMS.Response;
 using wms.dto;
+using wms.dto.request;
 using wms.dto.request.fj;
 using wms.dto.response.fj;
 using FJBuildEmptyPalletsStockRequest = WCS.WorkEngineering.WebApi.Models.WMS.Request.FJBuildEmptyPalletsStockRequest;
 using FJEnteMainLineRequest = WCS.WorkEngineering.WebApi.Models.WMS.Request.FJEnteMainLineRequest;
+using GetTunnelPriorityListRequest = WCS.WorkEngineering.WebApi.Models.WMS.Request.GetTunnelPriorityListRequest;
 using ResponseStatusCodeEnum = WCS.WorkEngineering.WebApi.Models.WMS.Response.ResponseStatusCodeEnum;
 using TaskBusType = WCS.WorkEngineering.WebApi.Models.WMS.Request.TaskBusType;
 
@@ -447,6 +449,26 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             return res;
         }
 
+        /// <summary>
+        ///  绑盘
+        /// </summary>
+        /// <param name="warehouseCode"></param>
+        /// <returns></returns>
+        /// <exception cref="KnownException"></exception>
+        public static SRes<int> GetTwoPallet(string warehouseCode, int taskId)
+        {
+            var res = APICaller.CallApi<SRes<int>>(WmsUrl + "/api/FJ/GetTwoPallet", new FJGetTwoPalletDto
+            {
+                WarehouseCode = warehouseCode,
+                TaskId = taskId
+            });
+            if (res.ResCode != ResponseStatusCodeEnum.Sucess)
+            {
+                throw new KnownException(res.ResMsg, LogLevelEnum.High);
+            }
+            return res;
+        }
+
         /// <summary>
         ///   环形库申请码垛任务
         /// </summary>
@@ -483,4 +505,17 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             return res;
         }
     }
+
+    public class FJGetTwoPalletDto : BaseRequest
+    {
+        /// <summary>
+        ///  仓库号
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        ///  仓库号
+        /// </summary>
+        public int TaskId { get; set; }
+    }
 }

+ 5 - 1
业务工程/分拣库/WCS.WorkEngineering/WorkStart.cs

@@ -366,6 +366,10 @@ namespace WCS.WorkEngineering
                     {
                         conv!.AddProtocol<ITruss530>(db530, 530, item.Item1);
                         conv!.AddProtocol<ITruss531>(db531, 531, item.Item1);
+                        if (conv.Code == "1716")
+                        {
+                            var a = 0;
+                        }
                         db530 += 18;
                         db531 += 250;
                     }
@@ -1076,7 +1080,7 @@ namespace WCS.WorkEngineering
                 { DeviceFlags.桁架取货点, new List<string>(){ /*"461", "475", "489", "503","517","531", "545", "559", "573", "586", "661", "675", "689", "703", "717", "731", "745", "759", "773", "786", */"861", "875", "889", "903", "917", "931", "945", "959", "973", "986", "1061", "1075", "1089", "1103", "1117", "1131", "1145", "1159", "1173", "1186", "1261", "1275", "1289", "1303", "1317", "1331", "1345", "1359", "1373", "1386" , "1461", "1475", "1489", "1503", "1517", "1531", "1545", "1559", "1573", "1586" } },
                 //{ DeviceFlags.拆盘机09, new List<string>(){ /*"1606", "1616",*/"1626","1636","1646","1656" } },
                 { DeviceFlags.拆盘机, new List<string>(){ /*"1602", "1612",*/"1622","1632","1642","1652" } },
-                { DeviceFlags.桁架码垛位, new List<string>(){/* "1670", "1671", "1672", "1673", "1674", "1675","1664","1662","1663","1665","1677","1678","1679","1680","1685","1686","1687","1688","1689","1690",*/ "1692", "1693", "1694", "1695", "1700", "1701", "1702", "1703", "1704", "1705", "1707", "1708", "1709", "1710", "1715", "1716", "1717", "1718", "1719", "1720", "1722", "1723", "1724", "1725", "1730", "1731", "1732", "1733", "1734", "1735", "1737", "1738", "1739", "1740", "1745", "1746", "1747", "1748", "1749", "1750" } },
+                { DeviceFlags.桁架码垛位, new List<string>(){/* "1670", "1671", "1672", "1673", "1674", "1675","1664","1662","1663","1665","1677","1678","1679","1680","1685","1686","1687","1688","1689","1690",*/ "1692", "1693", "1694", "1695", /*"1700", "1701",*/ "1702", "1703", "1704", "1705", "1707", "1708", "1709", "1710"/*, "1715", "1716"*/, "1717", "1718", "1719", "1720", "1722", "1723", "1724", "1725", "1730", "1731", "1732", "1733", "1734", "1735", "1737", "1738", "1739", "1740", "1745", "1746", "1747", "1748", "1749", "1750" } },
                 { DeviceFlags.环形库码垛工位, new List<string>(){ /*"1666", "1661", "1676", "1681",*/ "1691", "1696", "1706", "1711", "1721", "1726", "1736", "1741" } },
                 { DeviceFlags.AGV取货站台口, new List<string>(){ "2533", "2534", "2734","2733","2934","2933","3133","3134","3333","3334","3533","3534" } },
                 { DeviceFlags.Robot, new List<string>(){ /*"Robot1", "Robot2",*/ "Robot3","Robot4" , "Robot5", "Robot6" } },

+ 19 - 2
业务工程/分拣库/WCS.WorkEngineering/Worlds/MainWorld.cs

@@ -82,8 +82,25 @@ namespace WCS.WorkEngineering.Worlds
         /// <exception cref="NotImplementedException"></exception>
         protected override void OnLog(Channel channel, object logObj)
         {
-            var log = (LogInfo)logObj;
-            Logs.Enqueue(new KeyLog { Channel = channel, Log = log, Time = DateTime.Now });
+            if (logObj.GetType() == typeof(string))
+            {
+                Logs.Enqueue(new KeyLog
+                {
+                    Channel = channel,
+                    Log = new LogInfo()
+                    {
+                        Level = LogLevelEnum.High,
+                        LogUpLoad = LogUpLoadEnum.UpLoadWMS,
+                        Message = logObj as string,
+                    },
+                    Time = DateTime.Now
+                });
+            }
+            else
+            {
+                var log = (LogInfo)logObj;
+                Logs.Enqueue(new KeyLog { Channel = channel, Log = log, Time = DateTime.Now });
+            }
         }
 
         /// <summary>

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/数据采集.cs

@@ -8,7 +8,7 @@ using WCS.WorkEngineering.Worlds;
 
 namespace WCS.WorkEngineering.Systems
 {
-    [BelongTo(typeof(DataCollectionWorld))]
+    //[BelongTo(typeof(DataCollectionWorld))]
     [Description("数据采集系统")]
     public class 数据采集 : SystemBase
     {