using LeaRun.Application.Busines.PipeNetworkManage; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using LeaRun.Util.WebControl; using LeaRun.Util; using Newtonsoft.Json; namespace LeaRun.Application.Web.Areas.PipeNetworkManage.Controllers { public class StatisticalController : MvcControllerBase { private AnalysisBLL ipmAnalysisBll = new AnalysisBLL(); #region 试图功能 /// /// 用水分析 /// /// public ActionResult WaterAnalysis() { return View(); } #endregion #region 获取数据 /// /// 月统计 /// /// /// /// /// public ActionResult GetMonthReport(string DeviceID, string time,Pagination pagination) { if (string.IsNullOrEmpty(DeviceID) && string.IsNullOrEmpty(time)) { return Content(""); } else { var data = ipmAnalysisBll.GetMonthAnalysis(DeviceID, time, pagination); var watch = CommonHelper.TimerStart(); var JsonData = new { rows = JsonConvert.DeserializeObject(data), total = pagination.total, page = pagination.page, records = pagination.records, costtime = CommonHelper.TimerEnd(watch) }; return Content(JsonData.ToJson()); } } /// /// 年统计 /// /// /// /// /// /// public ActionResult GetYearReport(string DeviceID, string time, Pagination pagination) { if (string.IsNullOrEmpty(DeviceID) && string.IsNullOrEmpty(time)) { return Content(""); } else { var data = ipmAnalysisBll.GetYearAnalysis(DeviceID, time, pagination); var watch = CommonHelper.TimerStart(); var JsonData = new { rows = JsonConvert.DeserializeObject(data), total = pagination.total, page = pagination.page, records = pagination.records, costtime = CommonHelper.TimerEnd(watch) }; return Content(JsonData.ToJson()); } } #endregion } }