2023-03-03 16:07:50 +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;
|
|
|
|
|
|
|
|
|
|
namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创 建:cdl
|
|
|
|
|
/// 日 期:2023-03-01 15:05
|
|
|
|
|
/// 描 述:实时趋势控制器类
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Area("ChartsManage")]
|
|
|
|
|
public class RtchartsController : BaseController
|
|
|
|
|
{
|
|
|
|
|
public RtchartsService _rtchartsService { get;set;}
|
2023-09-07 17:21:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据仓库的数据库ID
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string groupDescription = GlobalContext.SystemConfig.GroupDescription;
|
|
|
|
|
[HttpGet]
|
2023-07-27 15:19:54 +08:00
|
|
|
|
public async Task<ActionResult> GetDriverGroupList()
|
|
|
|
|
{
|
|
|
|
|
var data = await _rtchartsService.GetDriverGroupList();
|
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
2023-03-03 16:07:50 +08:00
|
|
|
|
public async Task<ActionResult> GetAllSubsystemTag()
|
|
|
|
|
{
|
2023-09-07 17:21:02 +08:00
|
|
|
|
var data = await _rtchartsService.GetAllSubsystemTag(groupDescription);
|
2023-03-03 16:07:50 +08:00
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
|
|
|
|
|
{
|
2023-09-07 17:21:02 +08:00
|
|
|
|
var data = await _rtchartsService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName, groupDescription);
|
2023-03-03 16:07:50 +08:00
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetChartsTagValueInit(string[] charts_TagIDs)
|
|
|
|
|
{
|
2023-09-07 17:21:02 +08:00
|
|
|
|
var data = await _rtchartsService.GetChartsTagValueInit(charts_TagIDs, groupDescription);
|
2023-03-03 16:07:50 +08:00
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetChartsTagValue(string[] charts_TagIDs)
|
|
|
|
|
{
|
2023-09-07 17:21:02 +08:00
|
|
|
|
var data = await _rtchartsService.GetChartsTagValue(charts_TagIDs, groupDescription);
|
2023-03-03 16:07:50 +08:00
|
|
|
|
return Content(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Charts_Params
|
|
|
|
|
{
|
|
|
|
|
public string TagID { get; set; }
|
|
|
|
|
public string StartTime { get; set; }
|
|
|
|
|
public string EndTime { get; set; }
|
|
|
|
|
public string Interval { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|