Exemplo n.º 1
0
        protected void Application_Start()
        {
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);


            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            MessageCenter.Processor.MessageProcessor.Instance.Start();
            SmokeDetectorDayReportServices.BuildDayReportByTimer(1);//生成最近2天的报表。
        }
Exemplo n.º 2
0
        public JsonResult QueryReport(QF_SmokeDayReport qF_SmokeDay)
        {
            if (!CurrUser.IsPMAdmin)
            {
                qF_SmokeDay.CompanySysNo = CurrUser.MasterSysNo.Value;
            }
            ;
            if ((!qF_SmokeDay.EndDayDate.HasValue) || !qF_SmokeDay.StartDayDate.HasValue)
            {
                throw new BusinessException("请输入查询日期");
            }
            var         result      = SmokeDetectorDayReportServices.QueryDayReport(qF_SmokeDay);
            ReportModel reportModel = new ReportModel
            {
                XAxisData      = new List <string>(),
                SeriesTotal    = new List <List <object> >(),
                SeriesOnline   = new List <List <object> >(),
                SeriesLowPower = new  List <List <object> >(),
                SeriesFire     = new List <List <object> >(),
                SeriesOffline  = new List <List <object> >()
            };

            reportModel.XAxisData = result.TotalCount.Select(e => e.DayDate).ToList();

            result.TotalCount.ForEach(e =>
            {
                var ADJ = new List <object>
                {
                    e.DayDate,
                    e.Count,
                    e.Percent
                };
                reportModel.SeriesTotal.Add(ADJ);
            });
            result.OnlineCount.ForEach(e =>
            {
                var ADJ = new List <object>
                {
                    e.DayDate,
                    e.Count,
                    e.Percent
                };
                reportModel.SeriesOnline.Add(ADJ);
            });
            result.LowPowerCount.ForEach(e =>
            {
                var ADJ = new List <object>
                {
                    e.DayDate,
                    e.Count,
                    e.Percent
                };
                reportModel.SeriesLowPower.Add(ADJ);
            });
            result.FireCount.ForEach(e =>
            {
                var ADJ = new List <object>
                {
                    e.DayDate,
                    e.Count,
                    e.Percent
                };
                reportModel.SeriesFire.Add(ADJ);
            });
            result.OffLineCount.ForEach(e =>
            {
                var ADJ = new List <object>
                {
                    e.DayDate,
                    e.Count,
                    e.Percent
                };
                reportModel.SeriesOffline.Add(ADJ);
            });
            return(Json(new AjaxResult {
                Success = true, Data = reportModel
            }));
        }