Exemplo n.º 1
0
        public void GetBusinessReport(HttpContext context)
        {
            string        strWhere  = "";
            List <object> values    = new List <object>();
            string        pageIndex = context.Request["page"];
            string        pageSize  = context.Request["pagesize"];

            string unit        = context.Request["unit"];      //承办单位
            string timebegin   = context.Request["timebegin"]; //开始日期
            string timeend     = context.Request["timeend"];   //结束日期
            string count_start = context.Request["count_start"];
            string count_end   = context.Request["count_end"];

            if (!string.IsNullOrEmpty(unit))
            {
                strWhere += " AND CBDW_MC LIKE '%" + unit + "%'";
            }
            if (!string.IsNullOrEmpty(timebegin))
            {
                strWhere += " and CJSJ >= to_date('" + Convert.ToDateTime(timebegin).ToShortDateString() + "','yyyy-mm-dd')";
            }
            if (!string.IsNullOrEmpty(timeend))
            {
                strWhere += " and CJSJ <= to_date('" + Convert.ToDateTime(timeend).AddDays(1).ToShortDateString() + "','yyyy-mm-dd')";
            }
            string havingWhere = " HAVING 1=1 ";

            if (Convert.ToInt32(count_start) > 0)
            {
                havingWhere += " AND SUM(CASE WHEN ISREGARD > 0 THEN 1 ELSE 0 END) >=" + count_start;
            }
            if (Convert.ToInt32(count_end) > 0)
            {
                havingWhere += " AND SUM(CASE WHEN ISREGARD > 0 THEN 1 ELSE 0 END) <=" + count_end;
            }
            string qxWhere = " AND trim(DWBM) = '" + UserInfo.DWBM + "' AND JSBM in (" + Jsbms + ") AND BMBM in (" + Bmbms + ") AND QXLX = 0";

            EDRS.BLL.EDRS_Report bll = new EDRS.BLL.EDRS_Report(context.Request);
            int     count            = 0;
            DataSet ds = bll.GetCaseBusinessReport(strWhere, havingWhere, qxWhere, Convert.ToInt32(pageSize), Convert.ToInt32(pageIndex), "", out count, values.ToArray());

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                OperateLog.AddLog(OperateLog.LogType.卷宗业务情况统计Web, "查询卷宗业务情况统计成功!", UserInfo, UserRole, context.Request);
                //获取json数据
                string json = "{\"Rows\":" + ds.Tables[0].ToDatagridJson() + ",\"Total\":" + count + "}";// EDRS.Common.JsonHelper.JsonString(ds.Tables[0]);
                context.Response.Write(json);
            }
            else
            {
                OperateLog.AddLog(OperateLog.LogType.卷宗业务情况统计Web, "查询卷宗业务情况统计失败!", UserInfo, UserRole, context.Request);
                //获取json数据
                string json = "{\"Rows\":" + "[]" + ",\"Total\":" + count + "}";// EDRS.Common.JsonHelper.JsonString(ds.Tables[0]);
                context.Response.Write(json);
            }
        }
Exemplo n.º 2
0
        private DataSet GetBusinessReport()
        {
            string        strWhere    = "";
            List <object> values      = new List <object>();
            string        pageIndex   = Request["page"];
            string        pageSize    = Request["pagesize"];
            string        unit        = Request["unit"];      //承办单位
            string        timebegin   = Request["timebegin"]; //开始日期
            string        timeend     = Request["timeend"];   //结束日期
            string        count_start = Request["count_start"];
            string        count_end   = Request["count_end"];

            if (!string.IsNullOrEmpty(unit))
            {
                strWhere += " AND CBDW_MC LIKE '%" + unit + "%'";
            }
            if (!string.IsNullOrEmpty(timebegin))
            {
                strWhere += " and CJSJ >= to_date('" + Convert.ToDateTime(timebegin).ToShortDateString() + "','yyyy-mm-dd')";
            }
            if (!string.IsNullOrEmpty(timeend))
            {
                strWhere += " and CJSJ <= to_date('" + Convert.ToDateTime(timeend).AddDays(1).ToShortDateString() + "','yyyy-mm-dd')";
            }
            string qxWhere     = " AND DWBM = '" + UserInfo.DWBM + "' AND JSBM in (" + Jsbms + ") AND BMBM in (" + Bmbms + ") AND QXLX = 0";
            string havingWhere = " HAVING 1=1 ";

            if (Convert.ToInt32(count_start) > 0)
            {
                havingWhere += " AND SUM(CASE WHEN ISREGARD > 0 THEN 1 ELSE 0 END) >=" + count_start;
            }
            if (Convert.ToInt32(count_end) > 0)
            {
                havingWhere += " AND SUM(CASE WHEN ISREGARD > 0 THEN 1 ELSE 0 END) <=" + count_end;
            }
            EDRS.BLL.EDRS_Report bll = new EDRS.BLL.EDRS_Report(Request);
            int     count            = 0;
            DataSet ds = bll.GetCaseBusinessReport(strWhere, havingWhere, qxWhere, Convert.ToInt32(pageSize), Convert.ToInt32(pageIndex), "", out count, values.ToArray());

            if (ds == null)
            {
                OperateLog.AddLog(OperateLog.LogType.卷宗业务情况统计Web, "查询卷宗业务情况统计图表数据失败!", UserInfo, UserRole, Request);
            }
            else
            {
                OperateLog.AddLog(OperateLog.LogType.卷宗业务情况统计Web, "查询卷宗业务情况统计图表数据成功!", UserInfo, UserRole, Request);
            }
            return(ds);
        }