コード例 #1
0
        /// <summary>
        /// 品牌每天分布
        /// </summary>
        public void GetBrandDetailLine()
        {
            string   brandname = GetQueryString("brandname");
            DateTime begintime = Convert.ToDateTime(GetQueryString("sdate"));
            DateTime endtime   = Convert.ToDateTime(GetQueryString("edate"));

            if (begintime <= endtime.AddDays(-90))
            {
                begintime = endtime.AddDays(-90);
            }
            MobileOption plat = (MobileOption)Convert.ToInt32(GetQueryString("plat"));
            int          soft = Convert.ToInt32(GetQueryString("soft"));

            List <Sjqd_StatUsersBySbxh> list = StatUsersBySbxhService.GetInStance().GetBrandByDates
                                                   (begintime, endtime, soft, (int)plat, brandname);
            List <DateTime> datelist       = list.Select(p => p.StatDate).ToList();
            string          AxisJsonStr1   = string.Empty;
            string          SeriesJsonStr1 = string.Empty;

            if (list.Count != 0)
            {
                SetxAxisJson(datelist, ref AxisJsonStr1);
                SeriesJsonStr1 = JsonConvert.SerializeObject(GetDataJsonListByBrand(datelist, list));
            }
            else
            {
                AxisJsonStr1   = "{}";
                SeriesJsonStr1 = "[]";
            }
            string result = "{ x:" + AxisJsonStr1 + "," + "y:" + SeriesJsonStr1 + "}";

            HttpContext.Current.Response.Write(result);
        }
コード例 #2
0
        /// </summary>获取数据加上绑定数据
        protected void BindData()
        {
            int[] arr = new int[] { 68, 69, -9, 58, 9, 57, 60, 61 };
            if (arr.Contains <int>(softsid))
            {
                string otherKeyString = softsid == 51 ? "SoftID51_" : "";
                maxTime = UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistributionForPC, CacheTimeOption.TenMinutes, otherKeyString);
            }
            else
            {
                string otherKeyString = softsid == 51 ? "SoftID51_" : "";
                maxTime = UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes, otherKeyString);
            }
            startTime = DateTime.Now;
            switch (Period)
            {
            case net91com.Stat.Core.PeriodOptions.LatestOneMonth:
                startTime = maxTime.AddMonths(-1).AddDays(1);
                break;

            case net91com.Stat.Core.PeriodOptions.LatestOneWeek:
                startTime = maxTime.AddDays(-6);
                break;

            case net91com.Stat.Core.PeriodOptions.LatestThreeMonths:
                startTime = maxTime.AddMonths(-3).AddDays(1);
                break;

            case net91com.Stat.Core.PeriodOptions.LatestTwoWeeks:
                startTime = maxTime.AddDays(-13);
                break;

            case net91com.Stat.Core.PeriodOptions.All:
                startTime = DateTime.MinValue;
                break;
            }
            reportTitle  = Period == net91com.Stat.Core.PeriodOptions.All ? "品牌分布(" + maxTime.ToString("yyyy-MM-dd") + "之前)" : "品牌分布(" + startTime.ToString("yyyy-MM-dd") + "至" + maxTime.ToString("yyyy-MM-dd") + ")";
            allSoftBrand = StatUsersBySbxhService.GetInStance().GetSoftBrandTransverse(Period,
                                                                                       Convert.ToInt32(maxTime.ToString("yyyyMMdd")),
                                                                                       softsid, (MobileOption)platformsid);
            ///一条线都的不出来
            if (allSoftBrand.Count == 0)
            {
                SeriesJsonStr = "[]";
                reportTitle   = "无数据";
            }
            else
            {
                SeriesJsonStr = GetYlineJson(allSoftBrand);
            }
            tableStr = GetTableString();
        }
コード例 #3
0
        /// <summary>
        /// 下载设备型号分布数据
        /// </summary>
        private void DownloadSBXH()
        {
            net91com.Stat.Core.PeriodOptions Period = GetQueryString("zhouqi").ToEnum <net91com.Stat.Core.PeriodOptions>(net91com.Stat.Core.PeriodOptions.LatestOneWeek);
            int excelsoft     = Convert.ToInt32(GetQueryString("soft"));
            int excelplatform = Convert.ToInt32(GetQueryString("platform"));

            CheckHasRight(excelsoft, "Reports/TransverseReports/SoftXhTransverse.aspx");
            List <Sjqd_StatUsersBySbxh> list = StatUsersBySbxhService.GetInStance().GetSoftSBXHTransverse(Period,
                                                                                                          Convert.ToInt32(UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes).ToString("yyyyMMdd")),
                                                                                                          excelsoft, (MobileOption)excelplatform);

            ThisResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GBK");
            AddHead("机型分布.xls");
            ThisResponse.Write("机型\t用户数\t百分比\t\n");
            string temp     = string.Empty;
            int    allcount = list.Sum(p => p.UseCount);

            list.ForEach(gjbb =>
            {
                ThisResponse.Write((string.IsNullOrEmpty(gjbb.Sbxh) ? "未知" : gjbb.Sbxh) + "\t" + gjbb.UseCount + "\t" + (Convert.ToDecimal(gjbb.UseCount) / allcount * 100).ToString("0.00") + "\t\n");
            });
            ThisResponse.End();
        }