Browse Source

Merge branch '45维谛技术数采一期' of http://www.imaodou.com.cn:30030/c_jack/Aliyun_EICP3.0 into 45维谛技术数采一期

谢翼翔 1 year ago
parent
commit
64203a5fff

+ 15 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/CustomerEnv.cs

@@ -1,5 +1,6 @@
 using SCADA.CommonLib;
 using SCADA_DAQ.Customer.Models;
+using SCADA_DAQ.Customer.Models.DeviceInfoTime;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -27,8 +28,21 @@ namespace SCADA_DAQ.Customer
             });
         public static MaintainModel maintainModelConfig { get => maintainModel.Value; }
 
+        /// <summary>
+        /// 当天设备的所有记录
+        /// </summary>
+        public static List<MachineInfoModel> MachineInfos { get; set; }
+
+        /// <summary>
+        /// 当天维修时间
+        /// </summary>
+        public static List<MaintenanceTableModel> MaintenanceInfos { get; set; }
+
+        /// <summary>
+        /// 保养记录
+        /// </summary>
+        public static List<RepairTableModel> RepairInfos { get; set; }
 
-        
 
         public static AutoSaveParameterItem<ScheduleStopHourMinModel> ScheduleStopHourMinModel_1 { get; set; } =
             AutoSaveParameterItem.Create("ScheduleStopHourMinModel-1", new ScheduleStopHourMinModel()

+ 13 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/GetTimeService.cs

@@ -90,11 +90,20 @@ namespace SCADA_DAQ.Customer.Service
         private void Schedual_DateTimeChanged(object sender, DateTimeChangedArgs e)
         {
             
-            if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged & e.TimeFlag.Second % 10 == 0 )
+            if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged & e.TimeFlag.Second % 20 == 0 )
             {
-                var info = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>(t => t.CreateTime > DateTimeHelper.ToDayStart(DateTime.Now)
-                                        && t.CreateTime < DateTimeHelper.ToDayEnd(DateTime.Now));
-                Log.Info($"获取当前所有记录,条数为{info.Count}");
+                var start = DateTimeHelper.ToDayStart(DateTime.Now);
+                var end = DateTimeHelper.ToDayEnd(DateTime.Now);
+                CustomerEnv.MachineInfos = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>(t => t.CreateTime > start
+                                        && t.CreateTime <= end);
+                Log.Info($"获取当天状态所有记录,条数为{CustomerEnv.MachineInfos.Count}");
+
+                CustomerEnv.MaintenanceInfos = Env.SqlDAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>(t => t.CreateTime > start & t.CreateTime <= end);
+                Log.Info($"获取当前维修所有记录,条数为{CustomerEnv.MaintenanceInfos.Count}");
+
+                CustomerEnv.RepairInfos = Env.SqlDAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
+                Log.Info($"获取当前保养所有记录,条数为{CustomerEnv.MaintenanceInfos.Count}");
+
             }
         }
 

+ 9 - 8
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmKanbanForPressBrakeEquipment.xaml.cs

@@ -258,10 +258,11 @@ namespace SCADA_DAQ.Customer
             //var classesEndTime = Convert.ToDateTime(classesEndTimeSpan);
             var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
             var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
-            //获取当天所有设备信息
-            deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
-                .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
 
+            //获取当天所有设备信息
+            //deviceInformation = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>()?
+            //    .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();
+            deviceInformation = CustomerEnv.MachineInfos;
         }
         public double DeviceTimeValue(string deviceName, string StateCode)//设备运行状态时间
         {
@@ -282,9 +283,9 @@ namespace SCADA_DAQ.Customer
             var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
             var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
 
-            deviceMaintenanceTable = DAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>()?
-               .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备维修信息
-
+            //deviceMaintenanceTable = DAL.App_Vertiv_MaintenanceTable.GetData<MaintenanceTableModel>()?
+            //   .Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToList();//获取当天所有设备维修信息
+            deviceMaintenanceTable = CustomerEnv.MaintenanceInfos;
         }
         public TimeSpan DevicMainTableTime(string deviceName)
         {
@@ -316,8 +317,8 @@ namespace SCADA_DAQ.Customer
         public List<RepairTableModel> deviceRepairDay { get; set; }
         public void GetRepairTime()
         {
-            deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
-
+            //deviceRepairDay = DAL.APP_Vertiv_RepairTable.GetData<RepairTableModel>();
+            deviceRepairDay = CustomerEnv.RepairInfos;
         }
 
         public int DeviceRepairTime(string deviceName)//设备保养时间到期所剩的天数