|
@@ -158,6 +158,9 @@ namespace DataVAPI.Controllers |
|
|
//LogTable log2 = log?.Find(par => par.LogMessage.Contains("设备离线了")); |
|
|
//LogTable log2 = log?.Find(par => par.LogMessage.Contains("设备离线了")); |
|
|
|
|
|
|
|
|
list.Add(new { Name = "运行次数", Count = count?.ToString()}); |
|
|
list.Add(new { Name = "运行次数", Count = count?.ToString()}); |
|
|
|
|
|
list.Add(new { Name = "告警次数", Count = alarm?.Count }); |
|
|
|
|
|
list.Add(new { Name = "日警次数", Count = alarm?.FindAll(par=>par.CreateTime>=DateTime.Now.Date)?.Count }); |
|
|
|
|
|
|
|
|
//if (log1 != null && log2 != null) |
|
|
//if (log1 != null && log2 != null) |
|
|
//{ |
|
|
//{ |
|
|
// double dob = Math.Abs((log1.CreateTime - log2.CreateTime).TotalMinutes); |
|
|
// double dob = Math.Abs((log1.CreateTime - log2.CreateTime).TotalMinutes); |
|
@@ -165,10 +168,10 @@ namespace DataVAPI.Controllers |
|
|
// list.Add(new { Name = "故障率", Count = $"{(dob / 120)*100/100}%" }); |
|
|
// list.Add(new { Name = "故障率", Count = $"{(dob / 120)*100/100}%" }); |
|
|
//} |
|
|
//} |
|
|
//else |
|
|
//else |
|
|
{ |
|
|
|
|
|
list.Add(new { Name = "故障次数", Count = 0 }); |
|
|
|
|
|
list.Add(new { Name = "故障率", Count = $"0%" }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//{ |
|
|
|
|
|
// list.Add(new { Name = "告警次数", Count = 0 }); |
|
|
|
|
|
|
|
|
|
|
|
//} |
|
|
return JsonMsg<object>.OK(list, st); |
|
|
return JsonMsg<object>.OK(list, st); |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|