/// <summary> /// 固件版本每一天的曲线 /// </summary> public void GetGjBBDetailLine() { string gjbb = GetQueryString("gjbbname"); 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_StatUsersByGjbb> list = StatUsersByGjbbService.GetInstance(). GetGjbbByDates(begintime, endtime, soft, (int)plat, gjbb); 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(GetDataJsonListByGjbb(datelist, list)); } else { AxisJsonStr1 = "{}"; SeriesJsonStr1 = "[]"; } string result = "{ x:" + AxisJsonStr1 + "," + "y:" + SeriesJsonStr1 + "}"; HttpContext.Current.Response.Write(result); }
/// </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") + ")"; allSoftlan = StatUsersByGjbbService.GetInstance().GetSoftGJBBTransverse(Period, Convert.ToInt32(maxTime.ToString("yyyyMMdd")), softsid, (MobileOption)platformsid); ///一条线都的不出来 if (allSoftlan.Count == 0) { SeriesJsonStr = "[]"; reportTitle = "无数据"; } else { SeriesJsonStr = GetYlineJson(allSoftlan); } tableStr = GetTableString(); }
/// <summary> /// 下载固件版本分布数据 /// </summary> private void DownloadGJBB() { 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/SoftGJBBTransverse.aspx"); List <Sjqd_StatUsersByGjbb> list = StatUsersByGjbbService.GetInstance().GetSoftGJBBTransverse(Period, Convert.ToInt32(UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes).ToString("yyyyMMdd")), excelsoft, (MobileOption)excelplatform); int all = list.Sum(p => p.UseCount); ThisResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GBK"); AddHead("固件版本分布.xls"); ThisResponse.Write("固件版本\t用户数\t百分比\t\n"); string temp = string.Empty; list.ForEach(gjbb => { ThisResponse.Write((string.IsNullOrEmpty(gjbb.Gjbb) ? "未知" : gjbb.Gjbb) + "\t" + gjbb.UseCount + "\t" + (Convert.ToDecimal(gjbb.UseCount) / all * 100).ToString("0.00") + "\t\n"); }); ThisResponse.End(); }