/// <summary>
 ///遥测明细数据导出Excel
 /// </summary>
 /// <param name="context"></param>
 public void PileTelemetryQueryOutExcel(HttpContext context)
 {
     try
     {
         string   pileno = context.Request["pileno"].ToString();
         DateTime sdt    = new DateTime();
         string   sj     = context.Request["sdt"] ?? "";
         if (sj.Length > 0)
         {
             sdt = DateTime.Parse(sj);
         }
         DateTime edt = new DateTime();
         string   ej  = context.Request["edt"] ?? "";
         if (ej.Length > 0)
         {
             edt = DateTime.Parse(ej);
         }
         string itemname            = context.Request["itemname"].ToString();
         string strUrl              = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
         RequestHandling_BLL gdrBll = new RequestHandling_BLL();
         DataTable           dt     = gdrBll.PileTelemetryQueryOutExcel(pileno, sdt, edt, itemname, strUrl);
         if (dt.Rows.Count > 0)
         {
             DataTableExcel(context, dt, "查询导出" + DateTime.Now.ToString("yyyy年MM月dd日HH时mm分ss秒"));
         }
         else
         {
             context.Response.Write("<script type='javascript'>alert('当前没有数据要导出!');<script>");
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
 /// <summary>
 /// 获取充电站
 /// </summary>
 /// <param name="context"></param>
 private void GetChargStation(HttpContext context)
 {
     try
     {
         int    page = 1, rows = 10, total = 0;
         string tmp = context.Request["page"].ToString();
         if (!string.IsNullOrEmpty(tmp))
         {
             page = int.Parse(tmp);
         }
         tmp = context.Request["rows"].ToString();
         if (!string.IsNullOrEmpty(tmp))
         {
             rows = int.Parse(tmp);
         }
         RequestHandling_BLL gdrBll = new RequestHandling_BLL();
         DataTable           dt     = gdrBll.GetChargStationQuery(page, rows, ref total);
         string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
         context.Response.Write(strJson);
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
 /// <summary>
 /// 充电卡统计数据导出Excel
 /// </summary>
 /// <param name="context"></param>
 private void CardTotalOutExcel(HttpContext context)
 {
     try
     {
         string   zhanid = context.Request["zhanid"].ToString();
         DateTime sdt    = new DateTime();
         string   sj     = context.Request["sdt"] ?? "";
         if (sj.Length > 0)
         {
             sdt = DateTime.Parse(sj);
         }
         DateTime edt = new DateTime();
         string   ej  = context.Request["edt"] ?? "";
         if (ej.Length > 0)
         {
             edt = DateTime.Parse(ej).AddDays(1);
         }
         RequestHandling_BLL gdrBll = new RequestHandling_BLL();
         DataTable           dt     = gdrBll.CardTotalOutExcel(zhanid, sdt, edt);
         if (dt.Rows.Count > 0)
         {
             DataTableExcel(context, dt, "查询导出" + DateTime.Now.ToString("yyyy年MM月dd日HH时mm分ss秒"));
         }
         else
         {
             context.Response.Write("<script type='javascript'>alert('当前没有数据要导出!');<script>");
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
        /// <summary>
        ///获取死锁的充电桩数据
        /// </summary>
        /// <param name="context"></param>
        public void GetPileLockQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string strUrl = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetPileLockQuery(page, rows, ref total, strUrl);
                string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Exemple #5
0
        /// <summary>
        /// 充电卡明细记录查询
        /// </summary>
        /// <param name="context"></param>
        private void GetListQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string   cardno = context.Request["cardno"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej).AddDays(1);
                }
                string zhanid = "";
                try {
                    zhanid = context.Request["zhanid"].ToString();
                }
                catch (Exception ex)
                {
                    zhanid = "";
                }
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetDataTableQuery(cardno, sdt, edt, zhanid, page, rows, ref total);

                //List<GatDataRecord> list = ConvertHelper<GatDataRecord>.ConvertToList(dt);
                //PageObject<GatDataRecord> pageO = new PageObject<GatDataRecord>();
                //pageO.total = list.Count;
                //pageO.rows = list;
                //var strJson = jss.Serialize(pageO);

                string strJson = JSonHandle.ToJson(dt, total, "yyyy-MM-dd HH:mm");


                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        /// <summary>
        ///设置监视配置点
        /// </summary>
        /// <param name="context"></param>
        public void SetView(HttpContext context)
        {
            int zhanid = int.Parse(context.Request["zhanid"]);
            int sort   = int.Parse(context.Request["sort"]);
            RequestHandling_BLL gdrBll = new RequestHandling_BLL();
            int intCt = gdrBll.SetView(zhanid, sort);

            if (intCt > 0)
            {
                context.Response.Write("{\"success\":true,\"msg\":\"设置成功!\"}");
            }
            else
            {
                context.Response.Write("{\"success\":false,\"msg\":\"设置失败!\"}");
            }
        }
        /// <summary>
        ///获取遥测明细数据
        /// </summary>
        /// <param name="context"></param>
        public void GetPileTelemetryQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }
                string   pileno = context.Request["pileno"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej);
                }
                string itemname            = context.Request["itemname"].ToString();
                string strUrl              = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetPileTelemetryQuery(pileno, sdt, edt, itemname, page, rows, ref total, strUrl);

                string strJson = JSonHandle.ToJson(dt, total, "yyyy-MM-dd HH:mm:ss");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
 /// <summary>
 ///死锁的充电桩数据导出Excel
 /// </summary>
 /// <param name="context"></param>
 public void PileLockQueryOutExcel(HttpContext context)
 {
     try
     {
         string strUrl = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
         RequestHandling_BLL gdrBll = new RequestHandling_BLL();
         DataTable           dt     = gdrBll.PileLockQueryOutExcel(strUrl);
         if (dt.Rows.Count > 0)
         {
             DataTableExcel(context, dt, "查询导出" + DateTime.Now.ToString("yyyy年MM月dd日HH时mm分ss秒"));
         }
         else
         {
             context.Response.Write("<script type='javascript'>alert('当前没有数据要导出!');<script>");
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
        /// <summary>
        /// 充电卡数据汇总
        /// </summary>
        /// <param name="context"></param>
        private void GetListTotal(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string   zhanid = context.Request["zhanid"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej).AddDays(1);
                }
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetDataTableTotal(zhanid, sdt, edt, page, rows, ref total);
                string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }