|
@@ -1,5 +1,6 @@
|
|
|
using DBModel;
|
|
|
using DBNames;
|
|
|
+using Mysqlx.Crud;
|
|
|
using NPOI.SS.Formula.Eval;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using SCADA.CommonCtrl.WpfControl;
|
|
@@ -46,68 +47,67 @@ namespace SCADA_DAQ.Customer
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
|
|
|
- var timeListAdd = new List<List<TimePiece>>();
|
|
|
- var timeStopTime = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device)["高机母线冲剪机"];
|
|
|
- var timeStopPieces = new List<TimePiece>();
|
|
|
- if (timeStopTime.Count() != 0)
|
|
|
- {
|
|
|
- foreach (var item in timeStopTime)
|
|
|
- {
|
|
|
- timeStopPieces.Add(new TimePiece
|
|
|
- {
|
|
|
- StartTime = Convert.ToDateTime(item.StartTime.ToString()).TimeOfDay,
|
|
|
- EndTime = Convert.ToDateTime(item.EndTime.ToString()).TimeOfDay
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
|
|
|
- var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
|
|
|
- var informationValue = Env.SqlDAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToLookup(t => t.Device_Str)["高机母线冲剪机"];
|
|
|
-
|
|
|
- var classesYesterdayStartTime = Convert.ToDateTime(DateTime.Now.AddDays(-1).Date);
|
|
|
- var classesDayEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
|
|
|
- var deviceValueInformation = Env.SqlDAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesYesterdayStartTime & t.CreateTime <= classesDayEndTime).ToLookup(t => t.Device_Str)["高机母线冲剪机"];
|
|
|
-
|
|
|
- var timePieces = new List<TimePiece>();
|
|
|
- if (deviceValueInformation.Count() != 0)
|
|
|
- {
|
|
|
- foreach (var item in deviceValueInformation)
|
|
|
- {
|
|
|
- if (item.StartTime < Convert.ToDateTime(DateTime.Now.ToString("00:00:00")) & item.EndTime > Convert.ToDateTime(DateTime.Now.ToString("00:00:00")))
|
|
|
- {
|
|
|
- timePieces.Add(new TimePiece
|
|
|
- {
|
|
|
- StartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00")).TimeOfDay,
|
|
|
- EndTime = item.EndTime.TimeOfDay
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- if (informationValue.Count() != 0)
|
|
|
- {
|
|
|
- foreach (var item in informationValue)
|
|
|
- {
|
|
|
- timePieces.Add(new TimePiece
|
|
|
- {
|
|
|
- StartTime = item.StartTime.TimeOfDay,
|
|
|
- EndTime = item.EndTime.TimeOfDay
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- timePieces = new List<TimePiece>() {
|
|
|
-
|
|
|
- new TimePiece{StartTime =TimeSpan.FromSeconds(DateTime.Now.ToOADate()) ,
|
|
|
- EndTime = TimeSpan.FromSeconds(DateTime.Now.ToOADate())},
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- var total = TimeTotalHelper.DistinctPlanStopTime(TimeTotalHelper.DistinctTime(timePieces), timeStopPieces);
|
|
|
+ // var timeListAdd = new List<List<TimePiece>>();
|
|
|
+ // var timeStopTime = DAL.App_Vertiv_DeviceScheduleStop.GetData<DeviceScheduleStopModel>().ToLookup(t => t.Device)["激光机"];
|
|
|
+ // var timeStopPieces = new List<TimePiece>();
|
|
|
+ // if (timeStopTime.Count() != 0)
|
|
|
+ // {
|
|
|
+ // foreach (var item in timeStopTime)
|
|
|
+ // {
|
|
|
+ // timeStopPieces.Add(new TimePiece
|
|
|
+ // {
|
|
|
+ // StartTime = Convert.ToDateTime(item.StartTime.ToString()).TimeOfDay,
|
|
|
+ // EndTime = Convert.ToDateTime(item.EndTime.ToString()).TimeOfDay
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // var classesStartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00"));
|
|
|
+ // var classesEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
|
|
|
+ // var informationValue = Env.SqlDAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesStartTime & t.CreateTime <= classesEndTime).ToLookup(t => t.Device_Str)["激光机"];
|
|
|
+
|
|
|
+ // var classesYesterdayStartTime = Convert.ToDateTime(DateTime.Now.AddDays(-1).Date);
|
|
|
+ // var classesDayEndTime = Convert.ToDateTime(DateTime.Now.ToString("23:59:59"));
|
|
|
+ // var deviceValueInformation = Env.SqlDAL.Base_AlarmLog.GetData<AlarmColumModel>()?.Where(t => t.CreateTime >= classesYesterdayStartTime & t.CreateTime <= classesDayEndTime).ToLookup(t => t.Device_Str)["激光机"];
|
|
|
+
|
|
|
+ // var timePieces = new List<TimePiece>();
|
|
|
+ // if (deviceValueInformation.Count() != 0)
|
|
|
+ // {
|
|
|
+ // foreach (var item in deviceValueInformation)
|
|
|
+ // {
|
|
|
+ // if (item.StartTime < Convert.ToDateTime(DateTime.Now.ToString("00:00:00")) & item.EndTime > Convert.ToDateTime(DateTime.Now.ToString("00:00:00")))
|
|
|
+ // {
|
|
|
+ // timePieces.Add(new TimePiece
|
|
|
+ // {
|
|
|
+ // StartTime = Convert.ToDateTime(DateTime.Now.ToString("00:00:00")).TimeOfDay,
|
|
|
+ // EndTime = item.EndTime.TimeOfDay
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // if (informationValue.Count() != 0)
|
|
|
+ // {
|
|
|
+ // foreach (var item in informationValue)
|
|
|
+ // {
|
|
|
+ // timePieces.Add(new TimePiece
|
|
|
+ // {
|
|
|
+ // StartTime = item.StartTime.TimeOfDay,
|
|
|
+ // EndTime = item.EndTime.TimeOfDay
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if(timePieces.Count() == 0 )
|
|
|
+ // {
|
|
|
+ // timePieces = new List<TimePiece>() {
|
|
|
+
|
|
|
+ // new TimePiece{StartTime =TimeSpan.FromSeconds(DateTime.Now.ToOADate()) ,
|
|
|
+ // EndTime = TimeSpan.FromSeconds(DateTime.Now.ToOADate())},
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // var total = TimeTotalHelper.DistinctPlanStopTime(TimeTotalHelper.DistinctTime(timePieces), timeStopPieces);
|
|
|
|
|
|
|
|
|
}
|