Esempio n. 1
0
        public ActionResult DrillplanStat()
        {
            var curUser = new OperatorProvider().Current(); //当前用户

            var deptCode = Request["deptCode"] ?? "";

            var starttime = Request["starttime"] ?? "";
            var endtime   = Request["endtime"] ?? "";
            var isCompany = false;

            //当前用户是厂级
            if (curUser.RoleName.Contains("厂级") || curUser.RoleName.Contains("公司级"))
            {
                isCompany = true;
            }
            else
            {
                isCompany = false;
            }
            deptCode = deptCode == "" ? curUser.DeptCode : deptCode;
            //x 轴Title
            List <dseries> xdata = new List <dseries>();

            //x 轴Title
            List <dseries> sdata = new List <dseries>();

            var DirllMode = new DataItemDetailBLL().GetDataItemListByItemCode("'MAE_DirllMode'").ToList();

            for (int i = 0; i < DirllMode.Count; i++)
            {
                var dt = drillplanrecordbll.DrillplanStat(DirllMode[i].ItemName, isCompany, deptCode, starttime, endtime);

                List <dseries_child> mode = new List <dseries_child>();

                dseries s1 = new dseries();

                s1.name = DirllMode[i].ItemName;
                s1.id   = DirllMode[i].ItemValue;
                //图表分析
                foreach (DataRow row in dt.Rows)
                {
                    dseries_child ybyh = new dseries_child();
                    ybyh.name      = row["fullname"].ToString();
                    ybyh.y         = Convert.ToInt32(row["recordnum"].ToString());
                    ybyh.drilldown = DirllMode[i].ItemDetailId + row["encode"].ToString();//部门编码
                    mode.Add(ybyh);
                    List <dseries_child> cyblist = new List <dseries_child>();
                    var cdeptCode = row["encode"].ToString();
                    var dept      = new DepartmentBLL().GetEntityByCode(cdeptCode);
                    if (dept != null)
                    {
                        if (dept.Nature == "厂级")
                        {
                            continue;
                        }
                    }
                    var dtChild = drillplanrecordbll.DrillplanStatDetail(DirllMode[i].ItemName, false, cdeptCode, "", "");
                    foreach (DataRow childRow in dtChild.Rows)
                    {
                        dseries_child cybmodel = new dseries_child();
                        cybmodel.name = childRow["fullname"].ToString();
                        cybmodel.y    = Convert.ToInt32(childRow["recordnum"].ToString());
                        cyblist.Add(cybmodel);
                    }
                    dseries cybdseries = new dseries();
                    cybdseries.name = DirllMode[i].ItemName;
                    cybdseries.id   = DirllMode[i].ItemDetailId + row["encode"].ToString();
                    cybdseries.data = cyblist;
                    sdata.Add(cybdseries);
                }
                s1.data = mode;
                xdata.Add(s1);
            }
            var jsonData = new { xdata = xdata, sdata = sdata };

            return(Content(jsonData.ToJson()));
        }
Esempio n. 2
0
        /// <summary>
        /// 旁站监管数量对比图
        /// </summary>
        /// <param name="queryJson"></param>
        /// <returns></returns>
        public ActionResult QuerySupervisonNumberComparison(string queryJson)
        {
            try
            {
                var queryParam = queryJson.ToJObject();

                string deptCode  = queryParam["deptCode"].ToString();                                         //部门
                string startDate = queryJson.Contains("startDate") ? queryParam["startDate"].ToString() : ""; //起始日期
                string endDate   = queryJson.Contains("endDate") ? queryParam["endDate"].ToString() : "";     //截止日期
                var    curUser   = new OperatorProvider().Current();                                          //当前用户

                StatisticsEntity hentity = new StatisticsEntity();
                hentity.sDeptCode = string.IsNullOrEmpty(deptCode) ? curUser.DeptCode : deptCode;
                hentity.startDate = startDate;
                hentity.endDate   = endDate;
                hentity.sAction   = "2"; //对比图分析
                hentity.sMark     = 0;

                //当前用户是厂级
                if (curUser.RoleName.Contains("厂级") || curUser.RoleName.Contains("公司级"))
                {
                    hentity.isCompany = true;
                }
                else
                {
                    hentity.isCompany = false;
                }
                //列表
                var dt = tasksharebll.QueryStatisticsByAction(hentity);

                //x 轴Title
                List <dseries> xdata = new List <dseries>();

                //x 轴Title
                List <dseries> sdata = new List <dseries>();
                //未监督
                List <dseries_child> yblist = new List <dseries_child>();
                //已监督
                List <dseries_child> zdlist = new List <dseries_child>();

                dseries s1 = new dseries();
                s1.name = "需监管";
                s1.id   = "ybyh";
                dseries s2 = new dseries();
                s2.name = "已监管";
                s2.id   = "zdyh";
                //图表分析
                foreach (DataRow row in dt.Rows)
                {
                    string dname   = row["fullname"].ToString();
                    string drillId = row["createuserdeptcode"].ToString();
                    //需监管
                    dseries_child ybyh = new dseries_child();
                    ybyh.name      = dname;
                    ybyh.y         = Convert.ToInt32(row["ordinaryhid"].ToString());
                    ybyh.drilldown = "yb" + drillId;//部门编码
                    yblist.Add(ybyh);

                    //已监管
                    dseries_child zdyh = new dseries_child();
                    zdyh.name      = row["fullname"].ToString();
                    zdyh.y         = Convert.ToInt32(row["ImportanHid"].ToString());
                    zdyh.drilldown = "zd" + drillId;//部门编码
                    zdlist.Add(zdyh);
                }
                s1.data = yblist; //需监管
                xdata.Add(s1);
                s2.data = zdlist; //已监管
                xdata.Add(s2);
                //结果集合
                var jsonData = new { tdata = dt, xdata = xdata, sdata = sdata, iscompany = hentity.isCompany ? 1 : 0 };

                return(Content(jsonData.ToJson()));
            }
            catch (Exception ex)
            {
                throw;
            }
        }