3 Commits 8aa490dfa7 ... dba24458a7

Author SHA1 Message Date
  谢翼翔 dba24458a7 合并后提交 1 year ago
  谢翼翔 4349336fef 临时提交 1 year ago
  谢翼翔 20410e264d 临时提交 1 year ago

+ 7 - 4
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/CustomerService.cs

@@ -34,7 +34,7 @@ namespace SCADA_DAQ.Customer.Service
     /// <summary>
     /// 
     /// </summary>
-    [DisplayName("折弯机记录查询服务")]
+    [DisplayName("获取设备稼动率跟产能服务")]
     public class CustomerService : BaseService
     {
         private static CustomerService _instance;
@@ -325,9 +325,10 @@ namespace SCADA_DAQ.Customer.Service
         {
             var startDayTime = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
             var endDayTime = DateTime.Parse(DateTime.Now.ToString("23:59:59"));
-            OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
-            DailyOeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
+            OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>(t => t.CreateTime >= startDayTime && t.CreateTime <= endDayTime);
+        
             LastDeviceName = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>();
+            DailyOeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>(t => t.CreateTime >= startDayTime && t.CreateTime <= endDayTime);
         }
 
         public string OeeValue { get; set; }
@@ -340,6 +341,8 @@ namespace SCADA_DAQ.Customer.Service
             {
                 var device = deviceName[i];
                 var deviceDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].Sum(t => t.DurationSec);
+                var deviceStopTime = OeeData.ToLookup(t => t.Device)[deviceName[i]].ToLookup(t => t.StateCode)["计划停止时间"].Sum(t => t.DurationSec);
+                var deviceallTime = deviceDayTIme - deviceStopTime;
                 var deviceRunDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].ToLookup(t => t.StateCode)["运行标志位"].Sum(t => t.DurationSec);
                 var deviceNameList = LastDeviceName.ToLookup(t => t.DeviceName)[deviceName[i]].LastOrDefault();
                 if (deviceDayTIme == 0)
@@ -348,7 +351,7 @@ namespace SCADA_DAQ.Customer.Service
                 }
                 else
                 {
-                    OeeValue = Math.Round(Convert.ToDouble(deviceRunDayTIme) / deviceDayTIme, 4).ToString();
+                    OeeValue = Math.Round(Convert.ToDouble(deviceRunDayTIme) / deviceallTime, 4).ToString();
 
                 }
                 if (DailyOeeData.Count() != 0)

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

@@ -31,7 +31,7 @@ namespace SCADA_DAQ.Customer.Service
     /// <summary>
     /// 
     /// </summary>
-    [DisplayName("设备状态查询服务")]
+    [DisplayName("获取设备状态时间服务")]
     public class GetTimeService : BaseService
     {
         private static GetTimeService _instance;

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmBendDeviceOeeInformation.xaml.cs

@@ -79,7 +79,7 @@ namespace SCADA_DAQ.Customer
             Days = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now), DateTimeHelper.ToMonthEnd(DateTime.Now));
             var first = DateTime.Parse(Days.First().StartTime.ToString());
             var last = DateTime.Parse(Days.Last().EndTime.ToString());
-            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= first & t.CreateTime <= last);
+            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>(t => t.CreateTime >= first & t.CreateTime <= last);
 
 
         }

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml.cs

@@ -132,7 +132,7 @@ namespace SCADA_DAQ.Customer
             Days = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now), DateTimeHelper.ToMonthEnd(DateTime.Now));
             var first = DateTime.Parse(Days.First().StartTime.ToString());
             var last = DateTime.Parse(Days.Last().EndTime.ToString());
-            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= first & t.CreateTime <= last);
+            OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>(t => t.CreateTime >= first & t.CreateTime <= last);
 
 
         }

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Env.cs

@@ -31,7 +31,7 @@ namespace SCADA_DAQ
         //public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
 
         //public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("127.0.0.1", "Vertiv", "sa", "M+123456");
-
+        
         public static SqlSchema.DIL.DILDB SqlDAL = new SqlSchema.DIL.DILDB("10.163.96.79", "Vertiv", "sa", "1qaz2wsx");
 
         //public static SqlSchema.DIL.DILDB SqlDAL;

File diff suppressed because it is too large
+ 0 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj


Some files were not shown because too many files changed in this diff