public ActionResult Index(int?typeq, int?lvlq, string orgid, DateTime?start, DateTime?end, int pageIndex = 1, int pageSize = 20) { if (null != start) { ViewBag.Start = start.Value.ToString("yyyy-MM-dd"); } if (null != end) { ViewBag.End = end.Value.ToString("yyyy-MM-dd"); } var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID); ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", orgid); var selectlist = EnumHelper.GetCategorySelectList(typeof(WARN_INFO_DETAIL.WARN_TYP_ENUM)); if (null != typeq) { selectlist.Find(obj => obj.Value == typeq.Value.ToString()).Selected = true; } ViewBag.WARN_TYP_SELECTLIST = selectlist; var selectlist2 = EnumHelper.GetCategorySelectList(typeof(WARN_INFO_DETAIL.WARN_LVL_ENUM)); if (null != lvlq) { selectlist2.Find(obj => obj.Value == lvlq.Value.ToString()).Selected = true; } ViewBag.WARN_LVL_SELECTLIST = selectlist2; var orgs = orgall.Select(obj => obj.ORG_ID); if (!string.IsNullOrEmpty(orgid)) { orgs = orgs.Where(obj => obj == orgid); if (null == orgs || orgs.Count() == 0) { orgs = new List <string> { "-1" }; } } var halllist = DaoHall.FindList("", "ORG_ID in", orgs); var data = dao.GetList(pageIndex, pageSize, "CREATE_DTIME desc", "WARN_TYP", typeq, "WARN_LEVEL", lvlq, "HALL_NO in", null == halllist ? null : halllist.Select(obj => obj.HALL_NO), "CREATE_DTIME>=", start == null ? "'1970-01-01'" : "'" + start.Value + "'", "CREATE_DTIME<", end == null ? ("'" + DateTime.MaxValue.ToShortDateString() + "'") : ("'" + end.Value.AddDays(1) + "'")); foreach (var item in data.Items) { var h = halllist.FirstOrDefault(obj => obj.HALL_NO == item.HALL_NO); if (null != h) { item.HALL_NAM = h.HALL_NAM; } } return(View(data)); }
public ActionResult Index(string snam, string orgid, string orgnam, int pageIndex = 1, int pageSize = 20) { ViewBag.SNAM = snam; ViewBag.ORGID = orgid; ViewBag.ORGNAM = orgnam; var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID); if (string.IsNullOrEmpty(orgid) && orgall != null) { orgid = orgall.FirstOrDefault(obj => obj.ORG_LEVEL == 4).ORG_ID; } ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", orgid); var orgs = orgall.Select(obj => obj.ORG_ID); if (!string.IsNullOrEmpty(orgid)) { orgs = orgs.Where(obj => obj == orgid); if (null == orgs || orgs.Count() == 0) { orgs = new List <string> { "-1" }; } } var halllist = DaoHall.FindList("", "ORG_ID in", orgs); var data = dao.GetList(pageIndex, pageSize, "Q_ID desc", "Q_SERIALNAME like", snam, "Q_SYSNO in", null == halllist ? null : halllist.Select(obj => obj.HALL_NO)); if (data != null && data.Items != null) { halllist = DaoHall.FindList(); var orglist = DaoOrganize.FindList(); foreach (var item in data.Items) { item.Hall = halllist.FirstOrDefault(obj => obj.HALL_NO == item.Q_SYSNO); item.Org = orglist.FirstOrDefault(obj => obj.ORG_ID == item.Hall.ORG_ID); } } return(View(data)); }
public ActionResult Index(string nam, string orgid, string orgnam, int?stafftype, int pageIndex = 1, int pageSize = 20) { ViewBag.NAM = nam; ViewBag.ORGID = orgid; ViewBag.ORGNAM = orgnam; ViewBag.STAFFTYP = stafftype; var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID); if (string.IsNullOrEmpty(orgid) && orgall != null) { orgid = orgall.FirstOrDefault(obj => obj.ORG_LEVEL == 4).ORG_ID; } ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", orgid); GetCreateDT(orgid); var orgs = orgall.Select(obj => obj.ORG_ID); if (!string.IsNullOrEmpty(orgid)) { orgs = orgs.Where(obj => obj == orgid); if (null == orgs || orgs.Count() == 0) { orgs = new List <string> { "-1" }; } } var data = dao.GetList(pageIndex, pageSize, "", "STAFF_NAM like", nam , "ORG_ID in", orgs, "STAFF_TYP", stafftype); var orglist = DaoOrganize.FindList(); foreach (var item in data.Items) { item.ORG = orglist.FirstOrDefault(obj => obj.ORG_ID == item.ORG_ID); } return(View(data)); }
public ActionResult Index(DateTime?beginTime, DateTime?endTime, int pageIndex = 1, int pageSize = 20, bool export = false) { base.DateTimeInit(ref beginTime, ref endTime); // 初始化日期 var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID); ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", ""); var orgs = orgall.Select(obj => obj.ORG_ID); var mainTielt = GetOrgName(null, null); ViewBag.MainTitle = GetTitleName(mainTielt, "排队业务分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault()); var subtitle = GetTitleName(mainTielt, "", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault(), false); var exceltitle = GetTitleName(mainTielt, "排队业务分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault(), false); var halllist = base.UserHall.Select(x => x.HALL_NO).ToArray(); var data = new STAT_STAFF_QUEUE_BUSI_D_DAL().GetStatsInfo(pageIndex, int.MaxValue, halllist, beginTime, endTime); if (export)//导出 { var index = 0; var temp = data.Select(x => new { 序号 = ++index, 业务编码 = x.QUEUE_BUSI_CD, 业务名称 = x.Q_SERIALNAME, 呼叫量 = x.CALL_CNT, 呼叫率 = CommonHelper.DivisionOfPercent(x.CALL_CNT, data.Sum(obj => obj.CALL_CNT)), 超时等待量 = x.OVERTIME_WAIT_CNT, 超时等待率 = CommonHelper.DivisionOfTimeString(x.OVERTIME_WAIT_CNT, data.Sum(obj => obj.OVERTIME_WAIT_CNT)), 办理量 = x.HANDLE_CNT, 办理率 = CommonHelper.DivisionOfPercent(x.HANDLE_CNT, data.Sum(obj => obj.HANDLE_CNT)), 弃号量 = x.ABANDON_CNT, 弃号率 = CommonHelper.DivisionOfPercent(x.ABANDON_CNT, data.Sum(obj => obj.ABANDON_CNT)), 平均办理时间 = CommonHelper.DivisionOfTimeString(x.HANDLE_DUR, x.HANDLE_CNT), 平均等待时间 = CommonHelper.DivisionOfTimeString(x.WAIT_DUR, x.TOT_TICKET_CNT), 最长等待时间 = x.MAX_WAIT_DUR, 最长办理时间 = x.MAX_HANDLE_DUR, 超时办理量 = x.OVERTIME_HANDLE_CNT, 超时办理率 = CommonHelper.DivisionOfPercent(x.OVERTIME_HANDLE_CNT, x.TOT_TICKET_CNT), 人流量 = x.TOT_TICKET_CNT }).ToList().ToDataTable(); return(AsposeExcelHelper.OutFileToRespone(temp, exceltitle)); } else { DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds.Tables.Add(dt); dt.Columns.Add("Q_SERIALNAME", typeof(string)); dt.Columns.Add("呼叫量", typeof(int)); dt.Columns.Add("办理量", typeof(int)); dt.Columns.Add("弃号量", typeof(int)); foreach (var item in data) { DataRow r = dt.NewRow(); r["Q_SERIALNAME"] = item.Q_SERIALNAME; r["呼叫量"] = item.CALL_CNT; r["办理量"] = item.HANDLE_CNT; r["弃号量"] = item.ABANDON_CNT; dt.Rows.Add(r); } ViewBag.ChartColumn3DXML = CreateMSColumn3DChart("排队业务分析", ds.Tables[0], 430, subtitle); ViewBag.ChartSplineXML = CreateMSSplineChart("排队业务报分析", ds, 430, null, null, subtitle); return(View(data)); } }
public ActionResult Index(DateTime?beginTime, DateTime?endTime, string orgid, int pageIndex = 1, int pageSize = 20, bool export = false) { base.DateTimeInit(ref beginTime, ref endTime); // 初始化日期 var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID); ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4) , "ORG_ID", "ORG_NAM", orgid); var orgs = orgall.Select(obj => obj.ORG_ID); //var mainTielt = GetOrgName(null, null); //ViewBag.MainTitle = GetTitleName(mainTielt, "业务大类分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault()); //var title = GetTitleName(mainTielt,"业务大类分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault(), false); var mainTielt = GetOrgName(null, null); ViewBag.MainTitle = GetTitleName(mainTielt, "业务大类分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault()); var subtitle = GetTitleName(mainTielt, "", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault(), false); var exceltitle = GetTitleName(mainTielt, "业务大类分析", beginTime.GetValueOrDefault(), endTime.GetValueOrDefault(), false); var halllist = base.UserHall.Select(x => x.HALL_NO).ToArray(); var data = new STAT_STAFF_LARGE_BUSI_D_DAL().GetStatsInfo(halllist, beginTime, endTime); if (export)//导出 { var index = 0; var temp = data.Select(x => new { 序号 = ++index, 业务大类 = x.DLS_SERIALNAME, 业务笔数 = x.BUSI_CNT, 业务折合量 = x.CONVERT_BUSI_CNT, 平均版办理时间 = (((int)(x.BUSI_CNT == 0 ? 0 : (x.HANDLE_DUR / x.BUSI_CNT))).ToTimeString()) + "%", 超时办理时间 = x.OVERTIME_HANDLE_CNT, 超时率 = ((x.BUSI_CNT == 0 ? 0 : (x.OVERTIME_HANDLE_CNT / x.BUSI_CNT)).ToString("P")) + "%", 城业务笔数 = x.LOCAL_CNT, 城办理率 = ((x.LOCAL_CNT * 100.0 / x.BUSI_CNT)).ToString("f2") + "%", }).ToList().ToDataTable(); return(AsposeExcelHelper.OutFileToRespone(temp, exceltitle)); } else { DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds.Tables.Add(dt); dt.Columns.Add("NAME", typeof(string)); dt.Columns.Add("业务笔数", typeof(int)); dt.Columns.Add("业务折合量", typeof(int)); dt.Columns.Add("总办理时长", typeof(int)); dt.Columns.Add("超时办理量", typeof(int)); dt.Columns.Add("同城业务量", typeof(int)); foreach (var item in data) { var r = dt.NewRow(); r["NAME"] = item.DLS_SERIALNAME; r["业务笔数"] = item.BUSI_CNT; r["业务折合量"] = item.CONVERT_BUSI_CNT; r["总办理时长"] = item.HANDLE_DUR; r["超时办理量"] = item.OVERTIME_HANDLE_CNT; r["同城业务量"] = item.LOCAL_CNT; dt.Rows.Add(r); } ViewBag.ChartColumn3DXML = CreateMSColumn3DChart("业务大类分析", ds.Tables[0], 430, subtitle); ViewBag.ChartSplineXML = CreateMSSplineChart("业务大类分析", ds, 430, null, null, subtitle); return(View(data)); } }