林豪 左 2 سال پیش
والد
کامیت
d3fd298990
1فایلهای تغییر یافته به همراه16 افزوده شده و 13 حذف شده
  1. 16 13
      WCS.Service/Systems/DataCollectionSysyem.cs

+ 16 - 13
WCS.Service/Systems/DataCollectionSysyem.cs

@@ -1,5 +1,8 @@
-using System.ComponentModel;
+using DBHelper;
+using Newtonsoft.Json;
+using System.ComponentModel;
 using WCS.Core;
+using WCS.Entity;
 using WCS.Entity.Protocol.Station;
 using WCS.Service.Worlds;
 using WCS.WorkEngineering.Extensions;
@@ -9,7 +12,7 @@ namespace WCS.Service.Systems
     /// <summary>
     ///  数据采集系统
     /// </summary>
-    //[BelongTo(typeof(DataCollectionWorld))]
+    [BelongTo(typeof(DataCollectionWorld))]
     [Description("数据采集系统")]
     public class DataCollectionSysyem : ServiceSystem<bool, bool>
     {
@@ -22,17 +25,17 @@ namespace WCS.Service.Systems
 
         protected override bool Do(bool obj)
         {
-            //Db.Do(db =>
-            //{
-            //    var plcData = new WCS_PlcData()
-            //    {
-            //        UPDATETIME = DateTime.Now,
-            //        WAREHOUSE = "111",
-            //        CONTENT = JsonConvert.SerializeObject(ConvList),
-            //    };
-            //    db.Default.Insertable<WCS_PlcData>(plcData).ExecuteCommand(); ;
-            //});
-            Console.WriteLine("11111");
+            Db.Do(db =>
+            {
+                var plcData = new WCS_PlcData()
+                {
+                    UPDATETIME = DateTime.Now,
+                    WAREHOUSE = "111",
+                    CONTENT = JsonConvert.SerializeObject(ConvList),
+                };
+                db.Default.Insertable<WCS_PlcData>(plcData).ExecuteCommand(); ;
+            });
+
             return true;
         }
     }