2023-08-11 16:04:39 +08:00
|
|
|
|
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;
|
|
|
|
|
using HT.Cloud.Domain.DevicesManage;
|
|
|
|
|
|
|
|
|
|
namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创 建:cdl
|
|
|
|
|
/// 日 期:2023-02-23 11:10
|
|
|
|
|
/// 描 述:历史趋势控制器类
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Area("PenMeiChartsManage")]
|
|
|
|
|
public class PenMeiRtTechChartsController : BaseController
|
|
|
|
|
{
|
|
|
|
|
public RtTechChartsService _rtTechChartsService { get;set;}
|
2023-09-07 17:21:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据仓库的数据库ID
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string groupDescription = GlobalContext.SystemConfig.GroupDescription;
|
|
|
|
|
[HttpPost]
|
2023-08-11 16:04:39 +08:00
|
|
|
|
public async Task<ActionResult> GetAllTagList(ChartTagType chartTagType)
|
|
|
|
|
{
|
|
|
|
|
var systemName = "喷煤系统";
|
|
|
|
|
|
|
|
|
|
var data = await _rtTechChartsService.GetAllTagList(systemName, chartTagType.ChartTagTypeName);
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetDriverGroupList()
|
|
|
|
|
{
|
|
|
|
|
var data = await _rtTechChartsService.GetDriverGroupList();
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetGroupSubsystemTag(ChartGroupDescription chartGroupDescription)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var data = await _rtTechChartsService.GetGroupSubsystemTag(chartGroupDescription.GroupDescription);
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetAllSubsystemTag()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var data = await _rtTechChartsService.GetAllSubsystemTag();
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
|
|
|
|
|
{
|
|
|
|
|
var data = await _rtTechChartsService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName, chartSubsysytemName.GroupDescription);
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetChartsTagValueInit(string[] charts_TagNames)
|
|
|
|
|
{
|
|
|
|
|
var systemName = "喷煤系统";
|
|
|
|
|
var data = await _rtTechChartsService.GetChartsTagValueInit(charts_TagNames, systemName);
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetChartsTagValue(string[] charts_TagNames)
|
|
|
|
|
{
|
|
|
|
|
var systemName = "喷煤系统";
|
|
|
|
|
var data = await _rtTechChartsService.GetChartsTagValue(charts_TagNames, systemName);
|
|
|
|
|
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 ChartTagType
|
|
|
|
|
{
|
|
|
|
|
public string ChartTagTypeName { get;set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 GroupDescription { get; set; }
|
|
|
|
|
public string SubsysytemName { get; set; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public class ChartGroupDescription
|
|
|
|
|
{
|
|
|
|
|
public string GroupDescription { 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 Charts_Params
|
|
|
|
|
{
|
|
|
|
|
public string Table { get; set; }
|
|
|
|
|
public string TagName { get; set; }
|
|
|
|
|
public string StartTime { get; set; }
|
|
|
|
|
public string EndTime { get; set; }
|
|
|
|
|
public string Interval { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|