示例#1
0
        protected override List <List <T> > GetData <T>(HttpContext context, bool isfortable = false)
        {
            DateTime begintime     = Convert.ToDateTime(context.Request["begintime"]);
            DateTime endtime       = Convert.ToDateTime(context.Request["endtime"]);
            int      softs         = Convert.ToInt32(context.Request["softs"]);
            int      platform      = Convert.ToInt32(context.Request["plat"]);
            int      restype       = Convert.ToInt32(context.Request["restype"]);
            int      version       = Convert.ToInt32(context.Request["version"]);
            int      areaid        = int.Parse(context.Request["areaid"]);
            int      projectsource = Convert.ToInt32(context.Request["projectsource"]);
            int      areatype      = Convert.ToInt32(context.Request["areatype"]);
            int      resselecttype = Convert.ToInt32(context.Request["resselecttype"]);
            string   rescontext    = context.Request["rescontext"];


            isbrowsecount = 0;
            if (projectsource == (int)ProjectOption.OP_REDIRECT_STAT)
            {
                isbrowsecount = 1;
            }

            List <List <D_StatDownPositionDistribution> > lists = new List <List <D_StatDownPositionDistribution> >();

            List <D_StatDownPositionDistribution> result;

            List <int> lstresid;

            if (resselecttype != 3)
            {
                lstresid = new List <int>()
                {
                    int.Parse(rescontext)
                };
            }
            else
            {
                List <B_ResInfo> resInfos = new B_BaseTool_DataAccess().GetResInfo(rescontext, restype, areatype);
                lstresid = resInfos.Select(p => p.ResId).ToList();
            }

            result = D_StatDownPositionDistribution_Service.Instance.GetD_StatDownPositionByResIDCacheDetailCache(restype, softs,
                                                                                                                  platform, projectsource,
                                                                                                                  version, begintime, endtime,
                                                                                                                  areatype, areaid, lstresid);

            var result2 =
                B_BaseDownPositionService.Instance.GetB_DownPositionListByCache((ProjectSourceTypeOptions)areatype,
                                                                                restype, projectsource);

            var res = (from r1 in result
                       join r2 in result2 on new { Position = r1.PositionId }
                       equals new { Position = r2.Position }
                       into tt
                       from t in tt.DefaultIfEmpty()
                       select new D_StatDownPositionDistribution
            {
                PositionId = r1.PositionId,
                PositionName = t != null ? t.Name : "",
                PageName = t != null ? t.PageName : "",
                DownCount = r1.DownCount,
                BrowseCount = r1.BrowseCount
            }).ToList();


            if (res.Count != 0)
            {
                lists.Add(res);
            }

            return(lists as List <List <T> >);
        }
        protected override List <List <T> > GetData <T>(System.Web.HttpContext context, bool flag = false)
        {
            supdetaileqchart = false;

            DateTime   begintime  = Convert.ToDateTime(context.Request["begintime"]);
            DateTime   endtime    = Convert.ToDateTime(context.Request["endtime"]);
            int        sourceid   = Convert.ToInt32(context.Request["projectsource"]);
            string     versions   = context.Request["version"];
            List <int> lstversion = versions.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(p => Convert.ToInt32(p)).ToList();
            int        softid     = Convert.ToInt32(context.Request["softid"]);
            int        platform   = Convert.ToInt32(context.Request["platform"]);
            int        restype    = Convert.ToInt32(context.Request["restype"]);
            int        resid      = Convert.ToInt32(context.Request["resid"]);
            int        areaid     = Convert.ToInt32(context.Request["areaid"]);
            string     position   = context.Request["position"] == "" ? "0" : context.Request["position"];

            position = Regex.Replace(position, "[\r\n ]", "");
            string[]   sts        = position.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            List <int> lstpositon = GetPositionList(sts);

            //下面三个字段主要是为了获取明细位置提供参数
            resselecttype = context.Request["resselecttype"];
            string resname = context.Request["resname"];

            areatype = Convert.ToInt32(context.Request["areatype"]);


            if (sourceid == -1 || sourceid == 2)
            {
                showdetailposition = 0;
            }
            else
            {
                showdetailposition = 1;
            }
            var        list = new List <List <ResourceDownLoad> >();
            List <int> lstresid;

            if (resid > 0)
            {
                lstresid = new List <int>()
                {
                    resid
                };
                rescontext = resid + "";
            }
            else
            {
                List <B_ResInfo> resInfos = new B_BaseTool_DataAccess().GetResInfo(resname, restype, areatype);
                lstresid   = resInfos.Select(p => p.ResId).ToList();
                rescontext = resname;
            }

            List <List <D_StatDownCountsBySoft_SUM> > lists = new List <List <D_StatDownCountsBySoft_SUM> >();

            foreach (int version in lstversion)
            {
                var result = D_StatDownCountSum_Service.Instance.GetD_StatDownCountSumByResIDCache(softid, platform, lstresid, restype,
                                                                                                   begintime, endtime, lstpositon, version,
                                                                                                   sourceid, areaid, areatype);
                if (result.Count != 0)
                {
                    lists.Add(result);
                }
                LogHelper.WriteInfo("result.count:" + result.Count);
            }

            return(lists as List <List <T> >);
        }