From d6112a8535dd122184b8ac7bcccab152190b8b83 Mon Sep 17 00:00:00 2001 From: fyf Date: Sat, 11 Jun 2022 15:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataVAPI/Controllers/DeviceStatsController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DataVAPI/Controllers/DeviceStatsController.cs b/DataVAPI/Controllers/DeviceStatsController.cs index ffa258f..8b99b92 100644 --- a/DataVAPI/Controllers/DeviceStatsController.cs +++ b/DataVAPI/Controllers/DeviceStatsController.cs @@ -158,6 +158,9 @@ namespace DataVAPI.Controllers //LogTable log2 = log?.Find(par => par.LogMessage.Contains("设备离线了")); 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) //{ // 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}%" }); //} //else - { - list.Add(new { Name = "故障次数", Count = 0 }); - list.Add(new { Name = "故障率", Count = $"0%" }); - } + //{ + // list.Add(new { Name = "告警次数", Count = 0 }); + + //} return JsonMsg.OK(list, st); } catch (Exception ex)