155 lines
4.6 KiB
C#
155 lines
4.6 KiB
C#
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
|
||
{
|
||
/// <summary>
|
||
/// 创 建:cdl
|
||
/// 日 期:2023-02-23 11:10
|
||
/// 描 述:历史趋势控制器类
|
||
/// </summary>
|
||
[Area("PenMeiReportManage")]
|
||
public class PenMeiHistoryAlarmController : BaseController
|
||
{
|
||
public HistoryAlarmService _historyAlarmService { get;set;}
|
||
|
||
[HttpGet]
|
||
public async Task<ActionResult> GetDriverGroupList()
|
||
{
|
||
var data = await _historyAlarmService.GetDriverGroupList();
|
||
return Content(data);
|
||
}
|
||
|
||
[HttpGet]
|
||
public async Task<ActionResult> GetAllSubsystemTag()
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
var data = await _historyAlarmService.GetAllSubsystemTag(systemName);
|
||
return Content(data);
|
||
}
|
||
|
||
[HttpPost]
|
||
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
var data = await _historyAlarmService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName, systemName);
|
||
return Content(data);
|
||
}
|
||
|
||
[HttpPost]
|
||
public async Task<ActionResult> GetAlarmRecord(Alarm_Params charts_Params)
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
short TagID = short.Parse(charts_Params.TagID);
|
||
var StartTime = Gettime(charts_Params.StartTime);
|
||
var EndTime = Gettime(charts_Params.EndTime);
|
||
|
||
var data = await _historyAlarmService.GetAlarmRecord(TagID, StartTime, EndTime, systemName);
|
||
return Content(data);
|
||
}
|
||
[HttpPost]
|
||
public async Task<ActionResult> GetAlarmRecordQuick(Alarm_Quick_Params alarm_Quick_Params)
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
var Alarmtype = alarm_Quick_Params.Alarmtype;
|
||
var StartTime = Gettime(alarm_Quick_Params.StartTime);
|
||
var EndTime = Gettime(alarm_Quick_Params.EndTime);
|
||
|
||
var data = await _historyAlarmService.GetAlarmRecordQuick(Alarmtype, StartTime, EndTime, systemName);
|
||
return Content(data);
|
||
}
|
||
[HttpPost]
|
||
public async Task<ActionResult> GetAlarmRecordQuickDesc(Alarm_Quick_Desc_Params alarm_Quick_Desc_Params)
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
var hhour = alarm_Quick_Desc_Params.Hhour;
|
||
|
||
var data = await _historyAlarmService.GetAlarmRecordQuickDesc(hhour, systemName);
|
||
return Content(data);
|
||
}
|
||
[HttpPost]
|
||
public async Task<ActionResult> GetAlarmSubSystem(SubSystem_Params subSystem_Params)
|
||
{
|
||
string systemName = "喷煤系统";
|
||
|
||
var AlarmName = subSystem_Params.AlarmName;
|
||
var data = await _historyAlarmService.GetAlarmSubSystem(AlarmName,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 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 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; }
|
||
}
|
||
public class Alarm_Quick_Desc_Params
|
||
{
|
||
public string Hhour { get; set; }
|
||
}
|
||
|
||
}
|
||
}
|