更新 评测前bug修复
This commit is contained in:
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 创 建:cdl
|
||||
/// 日 期:2023-02-23 11:10
|
||||
/// 描 述:历史趋势控制器类
|
||||
/// </summary>
|
||||
[Area("ReportManage")]
|
||||
public class MetaTagAlarmController : BaseController
|
||||
{
|
||||
public MetaTagAlarmService _metaTagAlarmService { get;set;}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetAllSubsystemTag()
|
||||
{
|
||||
|
||||
var data = await _metaTagAlarmService.GetAllSubsystemTag();
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
|
||||
{
|
||||
var data = await _metaTagAlarmService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> 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; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user