添加项目文件。
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using HT.Cloud.Service.ChartsManage;
|
||||
using HT.Cloud.Service.ReportManage;
|
||||
|
||||
namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
{
|
||||
[Area("ReportManage")]
|
||||
public class HistoryReportController : BaseController
|
||||
{
|
||||
public HistoryReportService _historyReportService { get; set; }
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetReport(Reportparam reportparam)
|
||||
{
|
||||
//var StartTime = reportparam.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//var EndTime = reportparam.EndTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
var StartTime = Gettime( reportparam.StartTime.ToString());
|
||||
var EndTime = Gettime( reportparam.EndTime.ToString());
|
||||
var Interval = int.Parse(reportparam.Interval);
|
||||
var data = await _historyReportService.GetReportFileName(StartTime, EndTime, Interval);
|
||||
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 Reportparam
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
public string Interval { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user