diff --git a/HT.Cloud.Domain/Entity/DevicesManage/MetaTagScopeEntity.cs b/HT.Cloud.Domain/Entity/DevicesManage/MetaTagScopeEntity.cs new file mode 100644 index 0000000..e61514b --- /dev/null +++ b/HT.Cloud.Domain/Entity/DevicesManage/MetaTagScopeEntity.cs @@ -0,0 +1,111 @@ +using System; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace HT.Cloud.Domain.DevicesManage +{ + /// + /// 创 建:cdl + /// 日 期:2023-03-16 09:39 + /// 描 述:设备报警信息实体类 + /// + [SugarTable("Meta_Tag_Scope")] + public class MetaTagScopeEntity + { + /// + /// TagID + /// + [SugarColumn(ColumnName="TagID", ColumnDescription = "TagID",ColumnDataType = "smallint(5)",IsIdentity = true,IsPrimaryKey = true)] + public int TagID { get; set; } + /// + /// 变量名称 + /// + [SugarColumn(ColumnName="TagName", ColumnDescription = "变量名称",ColumnDataType = "nvarchar(512)")] + public string TagName { get; set; } + /// + /// 数据类型 + /// + [SugarColumn(ColumnName="DataType", ColumnDescription = "数据类型",ColumnDataType = "tinyint(3)")] + public bool DataType { get; set; } + /// + /// 读取地址 + /// + [SugarColumn(ColumnName="Address", ColumnDescription = "读取地址",ColumnDataType = "varchar(64)")] + public string Address { get; set; } + /// + /// GroupID + /// + [SugarColumn(ColumnName="GroupID", ColumnDescription = "GroupID",ColumnDataType = "smallint(5)")] + public int GroupID { get; set; } + /// + /// 是否启用 + /// + [SugarColumn(ColumnName="IsActive", ColumnDescription = "是否启用",ColumnDataType = "bit(1)")] + public bool IsActive { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnName="Description", ColumnDescription = "描述",ColumnDataType = "nvarchar(128)", IsNullable = true)] + public string Description { get; set; } + /// + /// 子系统 + /// + [SugarColumn(ColumnName="Subsystem", ColumnDescription = "子系统",ColumnDataType = "varchar(64)")] + public string Subsystem { get; set; } + /// + /// 单位 + /// + [SugarColumn(ColumnName="Units", ColumnDescription = "单位",ColumnDataType = "varchar(20)")] + public string Units { get; set; } + /// + /// 回写地址 + /// + [SugarColumn(ColumnName="WriteAddress", ColumnDescription = "回写地址",ColumnDataType = "varchar(64)", IsNullable = true)] + public string WriteAddress { get; set; } + /// + /// 低三级报警值 + /// + [SugarColumn(ColumnName="LLLmum", ColumnDescription = "低三级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? LLLmum { get; set; } + /// + /// 低二级报警值 + /// + [SugarColumn(ColumnName="LLmum", ColumnDescription = "低二级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? LLmum { get; set; } + /// + /// 低一级报警值 + /// + [SugarColumn(ColumnName="Lmum", ColumnDescription = "低一级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? Lmum { get; set; } + /// + /// 高一级报警值 + /// + [SugarColumn(ColumnName="Hmum", ColumnDescription = "高一级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? Hmum { get; set; } + /// + /// 高二级报警值 + /// + [SugarColumn(ColumnName="HHmum", ColumnDescription = "高二级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? HHmum { get; set; } + /// + /// 高三级报警值 + /// + [SugarColumn(ColumnName="HHHmum", ColumnDescription = "高三级报警值",ColumnDataType = "real(24)", IsNullable = true)] + public Single? HHHmum { get; set; } + /// + /// 报警级别 + /// + [SugarColumn(ColumnName="Htlevel", ColumnDescription = "报警级别",ColumnDataType = "int(10)", IsNullable = true)] + public int? Htlevel { get; set; } + /// + /// 下限 + /// + [SugarColumn(ColumnName="Lowmum", ColumnDescription = "下限",ColumnDataType = "real(24)", IsNullable = true)] + public Single? Lowmum { get; set; } + /// + /// 上限 + /// + [SugarColumn(ColumnName="Highmum", ColumnDescription = "上限",ColumnDataType = "real(24)", IsNullable = true)] + public Single? Highmum { get; set; } + } +} diff --git a/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs b/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs new file mode 100644 index 0000000..774a34e --- /dev/null +++ b/HT.Cloud.Domain/Entity/ReportManage/MetaTagAlarmEntity.cs @@ -0,0 +1,96 @@ +using System; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace HT.Cloud.Domain.ReportManage +{ + /// + /// 创 建:cdl + /// 日 期:2023-03-16 16:11 + /// 描 述:报警变量表实体类 + /// + [SugarTable("Meta_Tag_Alarm")] + public class MetaTagAlarmEntity + { + /// + /// + /// + [SugarColumn(ColumnName="TagID", ColumnDescription = "",ColumnDataType = "smallint(5)",IsIdentity = true,IsPrimaryKey = true)] + public int TagID { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="TagName", ColumnDescription = "",ColumnDataType = "nvarchar(512)")] + public string TagName { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="DataType", ColumnDescription = "",ColumnDataType = "tinyint(3)")] + public bool DataType { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="DataSize", ColumnDescription = "",ColumnDataType = "smallint(5)")] + public int DataSize { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="Address", ColumnDescription = "",ColumnDataType = "varchar(64)")] + public string Address { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="GroupID", ColumnDescription = "",ColumnDataType = "smallint(5)")] + public int GroupID { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="IsActive", ColumnDescription = "",ColumnDataType = "bit(1)")] + public bool IsActive { get; set; } + /// + /// + /// + [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; } + /// + /// + /// + [SugarColumn(ColumnName="Units", ColumnDescription = "",ColumnDataType = "varchar(20)")] + public string Units { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="WriteAddress", ColumnDescription = "",ColumnDataType = "varchar(64)", IsNullable = true)] + public string WriteAddress { get; set; } + } +} diff --git a/HT.Cloud.Service/DevicesManage/MetaTagScopeService.cs b/HT.Cloud.Service/DevicesManage/MetaTagScopeService.cs new file mode 100644 index 0000000..b1f29e6 --- /dev/null +++ b/HT.Cloud.Service/DevicesManage/MetaTagScopeService.cs @@ -0,0 +1,107 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using System.Collections.Generic; +using HT.Cloud.Code; +using SqlSugar; +using HT.Cloud.DataBase; +using HT.Cloud.Domain.DevicesManage; + +namespace HT.Cloud.Service.DevicesManage +{ + /// + /// 创 建:cdl + /// 日 期:2023-03-16 09:39 + /// 描 述:设备报警信息服务类 + /// + public class MetaTagScopeService : BaseService, IDenpendency + { + public MetaTagScopeService(ISqlSugarClient context) : base(context) + { + } + #region 获取数据 + public async Task> GetList(string keyword = "") + { + var data = repository.IQueryable(); + if (!string.IsNullOrEmpty(keyword)) + { + data = data.Where(a => a.Description.Contains(keyword)); + } + return await data.OrderBy(a => a.TagID).ToListAsync(); + } + + public async Task> GetLookList(string keyword = "") + { + var query = repository.IQueryable(); + if (!string.IsNullOrEmpty(keyword)) + { + //此处需修改 + query = query.Where(a => a.Description.Contains(keyword)); + } + //权限过滤 + query = GetDataPrivilege("a", "", query); + return await query.OrderBy(a => a.TagID).ToListAsync(); + } + + public async Task> GetLookList(SoulPage pagination,string keyword = "",string id="") + { + var query = repository.IQueryable(); + if (!string.IsNullOrEmpty(keyword)) + { + query = query.Where(a => a.Description.Contains(keyword)); + } + if(!string.IsNullOrEmpty(id)) + { + query= query.Where(a=>a.TagID==int.Parse(id)); + } + //权限过滤 + query = GetDataPrivilege("a","",query); + return await query.ToPageListAsync(pagination); + } + + public async Task GetForm(string keyValue) + { + var data = await repository.FindEntity(keyValue); + return data; + } + #endregion + + public async Task GetLookForm(string keyValue) + { + var data = await repository.FindEntity(keyValue); + return GetFieldsFilterData(data); + } + + #region 提交数据 + public async Task SubmitForm(MetaTagScopeEntity entity, string keyValue) + { + /* 模板代码 TagID报错 暂时不使用!!! + //if(string.IsNullOrEmpty(keyValue)) + //{ + // //初始值添加 + // entity.TagID = Utils.GuId(); + // await repository.Insert(entity); + //} + //else + //{ + // //此处需修改 + // entity.TagID = keyValue; + // await repository.Update(entity); + //} + */ + + /* 暂时代码 */ + entity.TagID = int.Parse(keyValue); + await repository.Update(entity); + + } + + public async Task DeleteForm(string keyValue) + { + var ids = keyValue.Split(','); + await repository.Delete(a => ids.Contains(a.TagID.ToString())); + } + #endregion + + } +} diff --git a/HT.Cloud.Service/DevicesManage/MetaTagService.cs b/HT.Cloud.Service/DevicesManage/MetaTagService.cs index 1bf0653..296672c 100644 --- a/HT.Cloud.Service/DevicesManage/MetaTagService.cs +++ b/HT.Cloud.Service/DevicesManage/MetaTagService.cs @@ -100,13 +100,106 @@ namespace HT.Cloud.Service.DevicesManage return metaTagRedata.ToJson(); } - public class MetaTagRedata + public async Task GetGroupVarTreeTable(int groupId) + { + + var reList = new List(); + + var listMetaTag = _context.Queryable().Where(x => x.GroupID == groupId).ToList(); + var treeListMetaTag = new List(); + foreach (var item in listMetaTag) + { + + var tree_MetaTag = PCAutoCopy(item); + treeListMetaTag.Add(tree_MetaTag); + } + + + var listArray = treeListMetaTag.GroupBy(x=>x.Subsystem).ToList(); + + int gi = 1; + foreach(var item in listArray) + { + var f_MetaTagEntity = new Tree_MetaTagEntity + { + TreeId = gi, + F_TreeId = 0, + + Address = item.First().Address, + Subsystem = item.First().Subsystem, + TagID = gi, + }; + reList.Add(f_MetaTagEntity); + foreach(var entity in item) + { + entity.F_TreeId = gi; + entity.TreeId = entity.TagID; + entity.Address = ""; + reList.Add(entity); + } + gi++; + } + + var tree_MetaTagRedata = new Tree_MetaTagRedata + { + code = 0, + msg = "", + count = reList.Count, + data = reList + }; + + return tree_MetaTagRedata.ToJson(); + } + public class MetaTagRedata { public int code { get;set; } public string msg { get; set; } public int count { get; set; } public List data { get; set; } } + public class Tree_MetaTagRedata + { + public int code { get; set; } + public string msg { get; set; } + public int count { get; set; } + public List data { get; set; } + } + + /// + /// 树组件专用继承类 + /// + public class Tree_MetaTagEntity:MetaTagEntity + { + public int F_TreeId { get; set; } + public int TreeId { get; set; } + } + + /// + /// 父类的value赋值给子类 + /// + /// + /// + private Tree_MetaTagEntity PCAutoCopy(MetaTagEntity parent) + { + Tree_MetaTagEntity child = new Tree_MetaTagEntity(); + + + var ParentType = typeof(MetaTagEntity); + + + var Properties = ParentType.GetProperties(); + + + foreach (var Propertie in Properties) + { + if (Propertie.CanRead && Propertie.CanWrite) + { + Propertie.SetValue(child, Propertie.GetValue(parent, null), null); + } + } + + return child; + } } } diff --git a/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs new file mode 100644 index 0000000..4f62a74 --- /dev/null +++ b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs @@ -0,0 +1,124 @@ +using HT.Cloud.Code; +using HT.Cloud.Domain.DevicesManage; +using HT.Cloud.Domain.ReportManage; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HT.Cloud.Service.ReportManage +{ + public class MetaTagAlarmService : BaseService, IDenpendency + { + public MetaTagAlarmService(ISqlSugarClient context) : base(context) + { + } + public async Task GetAllSubsystemTag() + { + List subsystems = new List(); + var grouped = repository.IQueryable().ToList(); + List list_name_two = grouped.Select(t => t.Subsystem).GroupBy(c => c).Select(c => c.First()).ToList(); + int i = 0; + foreach (var Meta_Tag in list_name_two) + { + subsystems.Add(new SubsysytemNameList() { Lable = "a" + i, Value = Meta_Tag }); + i++; + } + return subsystems.ToJson(); + } + public async Task GetSubsystemAllTag(string subsysytemName) + { + + var subsysname = subsysytemName; + var response = repository.IQueryable().Where(x => x.Subsystem == subsysname).Select(x => new { x.TagID, x.Description, x.Units }).ToList(); + var reList = new List(); + foreach (var subsystem in response) + { + reList.Add( + new SubAllTagReturn() + { + TagID = (short)subsystem.TagID, + Description = subsystem.Description + $"({subsystem.Units})", + Units = subsystem.Units + } + ); + } + return reList.ToJson(); + } + + public async Task GetAlarmRecord(short tagid, string startdt, string enddt) + { + + SugarParameter[] sqlParameters = + { + new SugarParameter("@Henddt",enddt), + new SugarParameter("@Hstartdt",startdt), + new SugarParameter("@Htagid",tagid) + + }; + var dt = _context.Ado.UseStoredProcedure().GetDataTable("Query_Tag_Alarm", sqlParameters); + var valuelist = DataTableConvertModel.ConvertDataTableToList(dt); + return valuelist.ToJson(); + + + // var testdata = new List + // { + // new AlarmValue() { + // Description= "测试标题", + // StartTime = "08点37分", + // EndTime = "08点38分" + // }, + // new AlarmValue() { + // Description= "测试标题", + // StartTime = "08点37分", + // EndTime = "08点38分" + // }, + // new AlarmValue() { + // Description= "测试标题", + // StartTime = "08点37分", + // EndTime = "08点38分" + // }, + // new AlarmValue() { + // Description= "测试标题", + // StartTime = "08点37分", + // EndTime = "08点38分" + // } + //}; + // return testdata.ToJson(); + + + + //var resultlist = new List(); + //foreach (var value in valuelist) + //{ + // resultlist.Add(new ChartData() + // { + // name = value.HDATETIME, + // value = value.VALUE + // }); + //} + //return resultlist.ToJson(); + } + + private class AlarmValue + { + public string Description { get; set; } + public string startdt { get; set; } + public string enddt { get; set; } + } + private class SubsysytemNameList + { + public string Lable { get; set; } + public string Value { get; set; } + } + private class SubAllTagReturn + { + //x.TagID, x.Description, x.Units + public short TagID { get; set; } + public string Description { get; set; } + public string Units { get; set; } + } + } +} diff --git a/HT.Cloud.Web/Areas/ChartsManage/Views/HistoryCharts/Index.cshtml b/HT.Cloud.Web/Areas/ChartsManage/Views/HistoryCharts/Index.cshtml index 6ab603c..d7fcd4c 100644 --- a/HT.Cloud.Web/Areas/ChartsManage/Views/HistoryCharts/Index.cshtml +++ b/HT.Cloud.Web/Areas/ChartsManage/Views/HistoryCharts/Index.cshtml @@ -326,6 +326,9 @@ var series = new Array(); for (var si = 0; si < StaticSelectTagList.length; si++) { + debugger; + //bool变量取消平滑采取折线 + let issmooth = !(StaticSelectTagList[si].Units ==='Y/N') let seriesdata = { data: yDataArr[si], // 曲线名 @@ -334,7 +337,7 @@ yAxisIndex: si, type: 'line', // 曲线平滑设置 - smooth: true + smooth: issmooth } series.push(seriesdata); } diff --git a/HT.Cloud.Web/Areas/ChartsManage/Views/Rtcharts/Index.cshtml b/HT.Cloud.Web/Areas/ChartsManage/Views/Rtcharts/Index.cshtml index 30d8cf9..799024f 100644 --- a/HT.Cloud.Web/Areas/ChartsManage/Views/Rtcharts/Index.cshtml +++ b/HT.Cloud.Web/Areas/ChartsManage/Views/Rtcharts/Index.cshtml @@ -282,6 +282,8 @@ var series = new Array(); for (var si = 0; si < StaticSelectTagList.length; si++) { + //bool变量取消平滑采取折线 + let issmooth = !(StaticSelectTagList[si].Units === 'Y/N') let seriesdata = { data: yDataArr[si], // 曲线名 @@ -290,7 +292,7 @@ yAxisIndex: si, type: 'line', // 曲线平滑设置 - smooth: true + smooth: issmooth } series.push(seriesdata); } diff --git a/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagController.cs b/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagController.cs index d4342c3..2466fa3 100644 --- a/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagController.cs +++ b/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagController.cs @@ -58,7 +58,22 @@ namespace HT.Cloud.Web.Areas.DevicesManage.Controllers var data = await _metaTagService.GetGroupVarTable(groupIId); return Content(data); } - [HttpPost] + [HttpPost] + public async Task GetGroupVarTreeTable(string[] groupId) + { + int groupIId = 0; + try + { + groupIId = int.Parse(Regex.Replace(groupId[0], "[a-zA-Z]", "", RegexOptions.IgnoreCase)); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + var data = await _metaTagService.GetGroupVarTreeTable(groupIId); + return Content(data); + } + [HttpPost] public async Task SaveArgument(string driverId, string name, string value) { var data = ""; diff --git a/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagScopeController.cs b/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagScopeController.cs new file mode 100644 index 0000000..ec6902c --- /dev/null +++ b/HT.Cloud.Web/Areas/DevicesManage/Controllers/MetaTagScopeController.cs @@ -0,0 +1,88 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using HT.Cloud.Code; +using HT.Cloud.Domain.DevicesManage; +using HT.Cloud.Service; +using Microsoft.AspNetCore.Authorization; +using HT.Cloud.Service.DevicesManage; + +namespace HT.Cloud.Web.Areas.DevicesManage.Controllers +{ + /// + /// 创 建:cdl + /// 日 期:2023-03-16 09:39 + /// 描 述:设备报警信息控制器类 + /// + [Area("DevicesManage")] + public class MetaTagScopeController : BaseController + { + public MetaTagScopeService _service {get;set;} + + #region 获取数据 + [HandlerAjaxOnly] + [IgnoreAntiforgeryToken] + public async Task GetGridJson(SoulPage pagination, string keyword) + { + if (string.IsNullOrEmpty(pagination.field)) + { + pagination.field = "TagID"; + pagination.order = "asc"; + } + var data = await _service.GetLookList(pagination,keyword); + return Content(pagination.setData(data).ToJson()); + } + + [HttpGet] + [HandlerAjaxOnly] + public async Task GetListJson(string keyword) + { + var data = await _service.GetList(keyword); + return Content(data.ToJson()); + } + + [HttpGet] + [HandlerAjaxOnly] + public async Task GetFormJson(string keyValue) + { + var data = await _service.GetLookForm(keyValue); + return Content(data.ToJson()); + } + #endregion + + #region 提交数据 + [HttpPost] + [HandlerAjaxOnly] + public async Task SubmitForm(MetaTagScopeEntity entity, string keyValue) + { + try + { + await _service.SubmitForm(entity, keyValue); + return await Success("操作成功。", "", keyValue); + } + catch (Exception ex) + { + return await Error(ex.Message, "", keyValue); + } + } + + [HttpPost] + [HandlerAjaxOnly] + [HandlerAuthorize] + public async Task DeleteForm(string keyValue) + { + try + { + await _service.DeleteForm(keyValue); + return await Success("操作成功。", "", keyValue, DbLogType.Delete); + } + catch (Exception ex) + { + return await Error(ex.Message, "", keyValue, DbLogType.Delete); + } + } + #endregion + } +} diff --git a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Index.cshtml b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Index.cshtml index 9d23ed5..d2fd91f 100644 --- a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Index.cshtml +++ b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Index.cshtml @@ -133,48 +133,54 @@ // ]] //}); await $.ajax({ - url: "/DevicesManage/MetaTag/GetGroupVarTable", + url: "/DevicesManage/MetaTag/GetGroupVarTreeTable",//GetGroupVarTable type: "Post", dataType: "json", traditional: true,//这里设置为true data: { groupId: datapa }, success: function (redata) { - table.render({ + var options ={ elem: '#metaTable', height:'full-10', - //defaultToolbar: ['filter', 'print', 'exports', { - //title: '提示' //标题 - //,layEvent: 'LAYTABLE_TIPS' //事件名,用于 toolbar 事件中使用 - //,icon: 'layui-icon-tips' //图标类名 - //}], data: redata.data, editTrigger:'dblclick', + //page:true, + //limit:20, + treeIdName: 'TreeId', + treePidName: 'F_TreeId', cols:[[ { type: 'checkbox' }, - { field: 'TagID', title: 'ID', sort: true }, + { field: 'Subsystem', title: '子系统', edit: 'text'}, { field: 'Description' , title:'变量名称' , edit:'text'}, - { field: 'TagName' , title:'变量编码' , edit:'text'}, - { field: 'DataType' , title:'数值类型' , edit:'text'}, - { field: 'Address' , title:'起始地址' , edit:'text'}, - { field: 'Subsystem' , title:'所属系统' , edit:'text', filter:true}, - //{ field: 'RtValue' , title:'当前值' , edit:'text'}, + //{ field: 'Address', title: '起始地址', edit: 'text' }, + //{ field: 'DataType' , title:'数值类型' , edit:'text'}, { field: 'Units' , title:'变量单位' , edit:'text'}, - + //{ field: 'TagID', title: 'ID' }, ]], - page:true, - limit:20, - // response:{ - // statusName:'code', //规定返回的状态码字段为code - // statusCode:0 //规定成功的状态码味200 - // }, - // parseData:function(res){ - //return { - //"code" : redata.code, //解析接口状态 - //"msg" : redata.msg, //解析提示文本 - // "data" : redata.data //解析数据列表 - //} - //}, - }); + } + commonTable.rendertreetable(options); + //table.render({ + // elem: '#metaTable', + // height:'full-10', + // data: redata.data, + // editTrigger:'dblclick', + // cols:[[ + // { type: 'checkbox' }, + // { field: 'Subsystem', title: '子系统', edit: 'text'}, + + // { field: 'Description' , title:'变量名称' , edit:'text'}, + // //{ field: 'TagName' , title:'变量编码' , edit:'text'}, + // { field: 'Address', title: '起始地址', edit: 'text' }, + // { field: 'DataType' , title:'数值类型' , edit:'text'}, + + // //{ field: 'RtValue' , title:'当前值' , edit:'text'}, + // { field: 'Units' , title:'变量单位' , edit:'text'}, + // { field: 'TagID', title: 'ID', sort: true }, + + // ]], + // page:true, + // limit:20, + //}); } }); } diff --git a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Modfiy.cshtml b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Modfiy.cshtml index a3f0460..6ac9355 100644 --- a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Modfiy.cshtml +++ b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTag/Modfiy.cshtml @@ -71,7 +71,7 @@
- +
@*
diff --git a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Details.cshtml b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Details.cshtml new file mode 100644 index 0000000..072b4e2 --- /dev/null +++ b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Details.cshtml @@ -0,0 +1,127 @@ +@{ + ViewBag.Title = "Details"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + diff --git a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Form.cshtml b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Form.cshtml new file mode 100644 index 0000000..cb974ef --- /dev/null +++ b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Form.cshtml @@ -0,0 +1,144 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+ + diff --git a/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Index.cshtml b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Index.cshtml new file mode 100644 index 0000000..796b4c0 --- /dev/null +++ b/HT.Cloud.Web/Areas/DevicesManage/Views/MetaTagScope/Index.cshtml @@ -0,0 +1,193 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; + } +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+ + + + +
+
+ diff --git a/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs new file mode 100644 index 0000000..dd071bf --- /dev/null +++ b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs @@ -0,0 +1,98 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using HT.Cloud.Code; +using HT.Cloud.Domain.ChartsManage; +using HT.Cloud.Service; +using Microsoft.AspNetCore.Authorization; +using HT.Cloud.Service.ChartsManage; +using HT.Cloud.Service.ReportManage; +using Serenity.Services; + +namespace HT.Cloud.Web.Areas.ReportManage.Controllers +{ + /// + /// 创 建:cdl + /// 日 期:2023-02-23 11:10 + /// 描 述:历史趋势控制器类 + /// + [Area("ReportManage")] + public class MetaTagAlarmController : BaseController + { + public MetaTagAlarmService _metaTagAlarmService { get;set;} + + [HttpGet] + public async Task GetAllSubsystemTag() + { + + var data = await _metaTagAlarmService.GetAllSubsystemTag(); + return Content(data); + } + + [HttpPost] + public async Task GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName) + { + var data = await _metaTagAlarmService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName); + return Content(data); + } + + [HttpPost] + public async Task GetAlarmRecord(Alarm_Params charts_Params) + { + short TagID = short.Parse(charts_Params.TagID); + var StartTime = Gettime(charts_Params.StartTime); + var EndTime = Gettime(charts_Params.EndTime); + + var data = await _metaTagAlarmService.GetAlarmRecord(TagID, StartTime, EndTime); + 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)); // 当地时区 + DateTime dt = startTime.AddMilliseconds(jsTimeStamp); + return (dt.ToString("yyyy/MM/dd HH:mm:ss")); + } + + //public class SubAllTagReturn + //{ + // //x.TagID, x.Description, x.Units + // public short TagID { get; set; } + // public string Description { get; set; } + // public string Units { get; set; } + //} + + //public class SubsysytemNameList + //{ + // public string Lable { get; set; } + // public string Value { get; set; } + //} + + public class ChartSubsysytemName + { + 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 string TagID { get; set; } + public string StartTime { get; set; } + public string EndTime { get; set; } + } + + } +} diff --git a/HT.Cloud.Web/Areas/ReportManage/Views/HistoryReport/Index.cshtml b/HT.Cloud.Web/Areas/ReportManage/Views/HistoryReport/Index.cshtml index 0cf742b..9c429ab 100644 --- a/HT.Cloud.Web/Areas/ReportManage/Views/HistoryReport/Index.cshtml +++ b/HT.Cloud.Web/Areas/ReportManage/Views/HistoryReport/Index.cshtml @@ -207,8 +207,9 @@ // 文件普通操作 var handler = {}; //right_content + var rootpath = window.location.host; //在页面未加载完毕之前显示的loading Html自定义内容 - var _LoadingHtml = ''; + var _LoadingHtml = ''; //呈现loading效果 document.getElementById("workerdiv").innerHTML += _LoadingHtml; //移除loading效果 @@ -229,7 +230,7 @@ window.open(filepath); } - function GetReportView() { + async function GetReportView() { debugger; showLoading(); var datetimestart = $('#dateReStartTime')[0].value; @@ -271,11 +272,11 @@ //var datapa = { "StartTime": datetimestart, "EndTime": datetimeend, "Interval": timeInterval }; debugger; var result = ""; - $.ajax({ + await $.ajax({ url: "/ReportManage/HistoryReport/GetReport", type: "POST", //dataType: "json", - async: false, + //async: false, data:datapa, success: function (redata) { result = redata; diff --git a/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml new file mode 100644 index 0000000..52cdd0b --- /dev/null +++ b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml @@ -0,0 +1,320 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + + + + @**@ +
+
+
+
+ @*
    *@ +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + @*
    +
    +
    +
    +
    *@ + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    +
    @*style="width: 100%; height: 100% "*@ +
    +
    +
    +
    +
    + + diff --git a/HT.Cloud.Web/Views/Home/Default.cshtml b/HT.Cloud.Web/Views/Home/Default.cshtml index 569d8a6..e618da2 100644 --- a/HT.Cloud.Web/Views/Home/Default.cshtml +++ b/HT.Cloud.Web/Views/Home/Default.cshtml @@ -263,13 +263,13 @@
    -
    + @*
    系统公告
    -
    +
    *@ -
    + @*
    版本信息
    @@ -314,7 +314,7 @@

    技术交流QQ群(1065447456):watercloud(加群请备注)

    喜欢此模板的可以给我的Gitee加个Star支持一下

    - + *@ diff --git a/HT.Cloud.Web/Views/Login/Index.cshtml b/HT.Cloud.Web/Views/Login/Index.cshtml index e8ba109..4c5bb63 100644 --- a/HT.Cloud.Web/Views/Login/Index.cshtml +++ b/HT.Cloud.Web/Views/Login/Index.cshtml @@ -61,7 +61,7 @@
    - 测试账号admin,密码0000 + @* 测试账号admin,密码0000*@
    diff --git a/HT.Cloud.Web/WaterCloud.Web.xml b/HT.Cloud.Web/WaterCloud.Web.xml index 42799af..a337be9 100644 --- a/HT.Cloud.Web/WaterCloud.Web.xml +++ b/HT.Cloud.Web/WaterCloud.Web.xml @@ -39,6 +39,13 @@ 描 述:变量信息控制器类 + + + 创 建:cdl + 日 期:2023-03-16 09:39 + 描 述:设备报警信息控制器类 + + 创 建:超级管理员 @@ -88,6 +95,13 @@ 描 述:订单管理控制器类 + + + 创 建:cdl + 日 期:2023-02-23 11:10 + 描 述:历史趋势控制器类 + + 创 建:超级管理员 diff --git a/HT.Cloud.Web/wwwroot/images/bgnew.jpg b/HT.Cloud.Web/wwwroot/images/bgnew.jpg index 11dd79c..1d57cb1 100644 Binary files a/HT.Cloud.Web/wwwroot/images/bgnew.jpg and b/HT.Cloud.Web/wwwroot/images/bgnew.jpg differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320150308.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320150308.xlsx new file mode 100644 index 0000000..e394305 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320150308.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320153457.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320153457.xlsx new file mode 100644 index 0000000..229a0c9 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320153457.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320153752.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320153752.xlsx new file mode 100644 index 0000000..8d1a6c7 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320153752.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320153820.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320153820.xlsx new file mode 100644 index 0000000..e7e7d56 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320153820.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320153843.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320153843.xlsx new file mode 100644 index 0000000..f6708a0 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320153843.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320154653.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320154653.xlsx new file mode 100644 index 0000000..820c6c2 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320154653.xlsx differ diff --git a/HT.Cloud.Web/wwwroot/report/Report20230320154836.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230320154836.xlsx new file mode 100644 index 0000000..00c2ab9 Binary files /dev/null and b/HT.Cloud.Web/wwwroot/report/Report20230320154836.xlsx differ