diff --git a/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs b/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs index 774a34e..fb58eef 100644 --- a/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs +++ b/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs @@ -50,36 +50,11 @@ namespace HT.Cloud.Domain.ReportManage /// /// /// - [SugarColumn(ColumnName="Archive", ColumnDescription = "",ColumnDataType = "bit(1)")] - public bool Archive { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="DefaultValue", ColumnDescription = "",ColumnDataType = "sql_variant", IsNullable = true)] - public string DefaultValue { get; set; } - /// - /// - /// [SugarColumn(ColumnName="Description", ColumnDescription = "",ColumnDataType = "nvarchar(128)", IsNullable = true)] public string Description { get; set; } /// /// /// - [SugarColumn(ColumnName="Maximum", ColumnDescription = "",ColumnDataType = "real(24)")] - public Single Maximum { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="Minimum", ColumnDescription = "",ColumnDataType = "real(24)")] - public Single Minimum { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="Cycle", ColumnDescription = "",ColumnDataType = "int(10)")] - public int Cycle { get; set; } - /// - /// - /// [SugarColumn(ColumnName="Subsystem", ColumnDescription = "",ColumnDataType = "varchar(64)")] public string Subsystem { get; set; } /// @@ -92,5 +67,10 @@ namespace HT.Cloud.Domain.ReportManage /// [SugarColumn(ColumnName="WriteAddress", ColumnDescription = "",ColumnDataType = "varchar(64)", IsNullable = true)] public string WriteAddress { get; set; } - } + /// + /// 报警类型 + /// + [SugarColumn(ColumnName = "Alarmtype", ColumnDescription = "报警类型", ColumnDataType = "varchar(8)", IsNullable = true)] + public string Alarmtype { get; set; } + } } diff --git a/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs index 609edff..02e4135 100644 --- a/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs +++ b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs @@ -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 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.ConvertDataTableToList(dt); + return valuelist.ToJson(); + + } + public async Task 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; } diff --git a/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs index dd071bf..c5d86c0 100644 --- a/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs +++ b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs @@ -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 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 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; } + } - } + } } diff --git a/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml index 8a6ae49..206a019 100644 --- a/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml +++ b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml @@ -10,9 +10,11 @@ - + + @**@ - - - - - @**@ - - - - - - + + 报警汇总 + 报警查询 + + + + + + @* + + + + + + + + + + + + *@ + + @* + + + + *@ + + + + + + + + 报警类型: + + + + + + 选择报警类型 + + + 一级报警 + + + 二级报警 + + + 三级报警 + + + 一级故障 + + + 二级故障 + + + 三级故障 + + + 高一级报警 + + + 高二级报警 + + + 高三级报警 + + + 低一级报警 + + + 低二级报警 + + + 低三级报警 + + + + + + + + + + 开始时间: + + + + + + + + + + 结束世间: + + + + + + + + + + 快捷节点: + + + + + + 快速选择周期 + + + 今日 + + + 昨日 + + + 本周 + + + 上周 + + + 本月 + + + 上月 + + + + + + + + + + + + + 确定 + + + + + + + + + + + + @*style="width: 100%; height: 100% "*@ + + + - - - @* - - + + + + + + @**@ + + + + + + + + + + + + + + @* + + + + *@ + + + + + + + 开始时间: + + + + + + + + + + 结束世间: + + + + + + + + + + 快捷节点: + + + + + + 快速选择周期 + + + 今日 + + + 昨日 + + + 本周 + + + 上周 + + + 本月 + + + 上月 + + + + + + + + + + + + + 确定 + + + + + + + + + + + + @*style="width: 100%; height: 100% "*@ + + + - *@ - - - - - - - 开始时间: - - - - - - - - - - 结束世间: - - - - - - - - - - 快捷节点: - - - - - - 快速选择周期 - - - 今日 - - - 昨日 - - - 本周 - - - 上周 - - - 本月 - - - 上月 - - - - - - - - - - - - - 确定 - - - - - - - - - - - - @*style="width: 100%; height: 100% "*@ - - +