ソースを参照

最新提交

master
fyf 2年前
コミット
bd4a8487a2
1個のファイルの変更15行の追加3行の削除
  1. +15
    -3
      DataVAPI/Controllers/DeviceStatsController.cs

+ 15
- 3
DataVAPI/Controllers/DeviceStatsController.cs ファイルの表示

@@ -153,10 +153,22 @@ namespace DataVAPI.Controllers
}
List<object> list = new List<object>();
int? count = log?.FindAll(par => par.LogMessage.Contains("设备在线了")).Count;
list.Add(new { Name = "运行次数", Count = count?.ToString()});
list.Add(new { Name = "故障次数", Count = alarm?.Count.ToString() });
list.Add(new { Name = "故障率", Count = $"{(alarm?.Count * 100) / 400}%" });

//LogTable log1 = log?.Find(par => par.LogMessage.Contains("设备在线了"));
//LogTable log2 = log?.Find(par => par.LogMessage.Contains("设备离线了"));

list.Add(new { Name = "运行次数", Count = count?.ToString()});
//if (log1 != null && log2 != null)
//{
// double dob = Math.Abs((log1.CreateTime - log2.CreateTime).TotalMinutes);
// list.Add(new { Name = "故障次数", Count = 0 });
// list.Add(new { Name = "故障率", Count = $"{(dob / 120)*100/100}%" });
//}
//else
{
list.Add(new { Name = "故障次数", Count = 0 });
list.Add(new { Name = "故障率", Count = $"0%" });
}
return JsonMsg<object>.OK(list, st);
}
catch (Exception ex)


読み込み中…
キャンセル
保存