|
|
@@ -131,15 +131,26 @@ namespace DataVAPI.Controllers |
|
|
|
/// 统计数量 |
|
|
|
/// </summary> |
|
|
|
/// <param name="clientId"></param> |
|
|
|
/// <param name="name"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet] |
|
|
|
public JsonMsg<object> StatsConut(string clientId) |
|
|
|
public JsonMsg<object> StatsConut(string clientId,string name) |
|
|
|
{ |
|
|
|
st = System.Reflection.MethodBase.GetCurrentMethod().Name; |
|
|
|
try |
|
|
|
{ |
|
|
|
List<LogTable> log = mglog.ALLData(clientId); |
|
|
|
List<AlarmTable> alarm = mggj.ALLData(clientId); |
|
|
|
List<LogTable> log = new List<LogTable>(); |
|
|
|
List<AlarmTable> alarm = new List<AlarmTable>(); |
|
|
|
if (string.IsNullOrEmpty(name)) |
|
|
|
{ |
|
|
|
log = mglog.ALLData(clientId); |
|
|
|
alarm = mggj.ALLData(clientId); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
log = mglog.ALLDataName(clientId,name); |
|
|
|
alarm = mggj.ALLDataName(clientId, name); |
|
|
|
} |
|
|
|
List<object> list = new List<object>(); |
|
|
|
int? count = log?.FindAll(par => par.LogMessage.Contains("设备在线了")).Count; |
|
|
|
list.Add(new { Name = "运行次数", Count = count?.ToString()}); |
|
|
|