报警历史更改,预览版
This commit is contained in:
@ -50,36 +50,11 @@ namespace HT.Cloud.Domain.ReportManage
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Archive", ColumnDescription = "",ColumnDataType = "bit(1)")]
|
||||
public bool Archive { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="DefaultValue", ColumnDescription = "",ColumnDataType = "sql_variant", IsNullable = true)]
|
||||
public string DefaultValue { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Description", ColumnDescription = "",ColumnDataType = "nvarchar(128)", IsNullable = true)]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Maximum", ColumnDescription = "",ColumnDataType = "real(24)")]
|
||||
public Single Maximum { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Minimum", ColumnDescription = "",ColumnDataType = "real(24)")]
|
||||
public Single Minimum { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Cycle", ColumnDescription = "",ColumnDataType = "int(10)")]
|
||||
public int Cycle { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="Subsystem", ColumnDescription = "",ColumnDataType = "varchar(64)")]
|
||||
public string Subsystem { get; set; }
|
||||
/// <summary>
|
||||
@ -92,5 +67,10 @@ namespace HT.Cloud.Domain.ReportManage
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="WriteAddress", ColumnDescription = "",ColumnDataType = "varchar(64)", IsNullable = true)]
|
||||
public string WriteAddress { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 报警类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Alarmtype", ColumnDescription = "报警类型", ColumnDataType = "varchar(8)", IsNullable = true)]
|
||||
public string Alarmtype { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using HT.Cloud.Domain.ReportManage;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -40,7 +41,7 @@ namespace HT.Cloud.Service.ReportManage
|
||||
new SubAllTagReturn()
|
||||
{
|
||||
TagID = (short)subsystem.TagID,
|
||||
Description = subsystem.Description + $"({subsystem.Units})",
|
||||
Description = subsystem.Description,
|
||||
Units = subsystem.Units
|
||||
}
|
||||
);
|
||||
@ -102,7 +103,35 @@ namespace HT.Cloud.Service.ReportManage
|
||||
//return resultlist.ToJson();
|
||||
}
|
||||
|
||||
private class AlarmValue
|
||||
public async Task<string> GetAlarmRecordQuick(string HATYPE, string startdt, string enddt)
|
||||
{
|
||||
|
||||
SugarParameter[] sqlParameters =
|
||||
{
|
||||
new SugarParameter("@HATYPE",HATYPE),
|
||||
new SugarParameter("@Hstartdt",startdt),
|
||||
new SugarParameter("@Henddt",enddt)
|
||||
|
||||
|
||||
};
|
||||
var dt = _context.Ado.UseStoredProcedure().GetDataTable("Query_Tag_Alarm_Count", sqlParameters);
|
||||
var valuelist = DataTableConvertModel<AlarmValueCount>.ConvertDataTableToList(dt);
|
||||
return valuelist.ToJson();
|
||||
|
||||
}
|
||||
public async Task<string> GetAlarmSubSystem(string alarmName)
|
||||
{
|
||||
var subSystem = repository.IQueryable().Where(x => x.Description == alarmName).First().Subsystem;
|
||||
return subSystem.ToJson();
|
||||
}
|
||||
private class AlarmValueCount
|
||||
{
|
||||
public string Alarmtype { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int hcount { get; set; }
|
||||
public int hztime { get; set; }
|
||||
}
|
||||
private class AlarmValue
|
||||
{
|
||||
public string Description { get; set; }
|
||||
public string startdt { get; set; }
|
||||
|
@ -48,8 +48,25 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
var data = await _metaTagAlarmService.GetAlarmRecord(TagID, StartTime, EndTime);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmRecordQuick(Alarm_Quick_Params alarm_Quick_Params)
|
||||
{
|
||||
var Alarmtype = alarm_Quick_Params.Alarmtype;
|
||||
var StartTime = Gettime(alarm_Quick_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_Quick_Params.EndTime);
|
||||
|
||||
public string Gettime(string longtime)
|
||||
var data = await _metaTagAlarmService.GetAlarmRecordQuick(Alarmtype, StartTime, EndTime);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmSubSystem(SubSystem_Params subSystem_Params)
|
||||
{
|
||||
var AlarmName = subSystem_Params.AlarmName;
|
||||
var data = await _metaTagAlarmService.GetAlarmSubSystem(AlarmName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
public string Gettime(string longtime)
|
||||
{
|
||||
long jsTimeStamp = long.Parse(longtime);
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
|
||||
@ -76,23 +93,32 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
public string SubsysytemName { get; set; }
|
||||
}
|
||||
|
||||
//public class HDATETIMEVALUE
|
||||
//{
|
||||
// public String HDATETIME { get; set; }
|
||||
// public decimal VALUE { get; set; }
|
||||
//}
|
||||
//public class ChartData
|
||||
//{
|
||||
// public decimal value { get; set; }
|
||||
// public String name { get; set; }
|
||||
//}
|
||||
|
||||
public class Alarm_Params
|
||||
//public class HDATETIMEVALUE
|
||||
//{
|
||||
// public String HDATETIME { get; set; }
|
||||
// public decimal VALUE { get; set; }
|
||||
//}
|
||||
//public class ChartData
|
||||
//{
|
||||
// public decimal value { get; set; }
|
||||
// public String name { get; set; }
|
||||
//}
|
||||
public class SubSystem_Params
|
||||
{
|
||||
public string AlarmName { get; set; }
|
||||
}
|
||||
public class Alarm_Params
|
||||
{
|
||||
public string TagID { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
public class Alarm_Quick_Params
|
||||
{
|
||||
public string Alarmtype { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user