Exemplo n.º 1
0
        /// <summary>
        /// 返回当日登录用户ID
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="index"></param>
        /// <param name="cnt"></param>
        /// <returns></returns>
        public static string GetLoginAccountId(int pageIndex, int index, string cnt, string order = "")
        {
            string           active      = string.Empty;
            IndexDetailModel detailModel = new IndexDetailModel();

            switch (index)
            {
            case 1:
                active = ">=5";
                break;

            case 2:
                active = "<0";
                break;

            case 3:
                active = "in (0,1)";
                break;
            }

            int[] accId = DashBoardAnalyzeBLL.GetLoginAccountId(pageIndex, active);

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId, order, pageIndex);
            detailModel.rowCount = int.Parse(cnt);
            detailModel.maxPage  = detailModel.rowCount / 15 + 1;

            return(CommonLib.Helper.JsonSerializeObject(detailModel, ""));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 返回不同留存条件下的用户详情
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="type"></param>
        /// <param name="accids"></param>
        /// <returns></returns>
        public static string GetGeneralAccountId(int pageIndex, string type, List <int> accids)
        {
            IndexDetailModel detailModel = new IndexDetailModel();

            int bgNumber = ((pageIndex - 1) * 15);
            int count    = accids.Count;

            if (accids.Count - bgNumber > 15)
            {
                accids = accids.GetRange(bgNumber, 15);
            }
            else if (accids.Count > bgNumber && accids.Count < (bgNumber + 15))
            {
                accids = accids.GetRange(bgNumber, accids.Count - bgNumber);
            }


            int[] accId = accids.ToArray();

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId);
            detailModel.rowCount = count;
            detailModel.maxPage  = detailModel.rowCount / 15 + 1;

            return(CommonLib.Helper.JsonSerializeObject(detailModel, ""));
        }
Exemplo n.º 3
0
        public static string GetFunnelData(string timeType, string sourceType, DateTime stDate, DateTime edDate)
        {
            ConversionFunnel funnelModel = new ConversionFunnel();
            DateTime         bgTime      = new DateTime();
            DateTime         edTime      = new DateTime();

            switch (timeType)
            {
            case "1m":
                edTime = DateTime.Now;
                bgTime = DateTime.Now.AddMonths(-1);
                break;

            case "3m":
                edTime = DateTime.Now;
                bgTime = DateTime.Now.AddMonths(-3);
                break;

            case "custom":
                bgTime = stDate;
                edTime = edDate;
                break;
            }

            //funnelModel = DashBoardAnalyzeBLL.GetConversionFunnel(sourceType,bgTime, edTime);

            return(CommonLib.Helper.JsonSerializeObject(DashBoardAnalyzeBLL.GetConversionFunnel(sourceType, bgTime, edTime)));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 返回KPI数据和区分用户活跃类型后的数据
        /// </summary>
        /// <param name="nowDay"></param>
        /// <returns></returns>
        public static string GetStatusType(DateTime nowDay)
        {
            List <DashBoardModel> modelList = DashBoardAnalyzeBLL.GetStatusType(nowDay);

            PanelShowModel.SomedayDataCount todayModel = SysRpt_WebDayInfoBLL.GetNowDataCount();
            foreach (DashBoardModel model in modelList)
            {
                switch (model.Name)
                {
                case "销售笔数":
                    model.Total = todayModel.saleNum;
                    break;

                case "会员数量":
                    model.Total = todayModel.userNum;
                    break;

                case "商品数量":
                    model.Total = todayModel.goodsNum;
                    break;

                case "短信数量":
                    model.Total = todayModel.smsNum;
                    break;
                }
            }

            return(CommonLib.Helper.JsonSerializeObject(modelList));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 返回今日所有付费用户ID
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="index"></param>
        /// <param name="cnt"></param>
        /// <returns></returns>
        public static string GetPaidAllAccountId(int pageIndex, int index, string cnt, string order = "")
        {
            IndexDetailModel detailModel = new IndexDetailModel();

            int[] accId = DashBoardAnalyzeBLL.GetPaidAllAccountId(pageIndex, index);

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId, order, pageIndex);
            detailModel.rowCount = int.Parse(cnt);
            detailModel.maxPage  = detailModel.rowCount / 15 + 1;

            return(CommonLib.Helper.JsonSerializeObject(detailModel, ""));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取漏斗详情用户
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="keyword"></param>
        /// <param name="activeList"></param>
        /// <returns></returns>
        public static string GetFunnelDetail(int pageIndex, string keyword, string activeList, string cnt)
        {
            IndexDetailModel detailModel = new IndexDetailModel();

            int[] accId = DashBoardAnalyzeBLL.GetFunnelDetailUser(pageIndex, keyword, activeList);

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId, "", pageIndex);
            detailModel.rowCount = int.Parse(cnt);
            detailModel.maxPage  = detailModel.rowCount / 15 + 1;

            return(CommonLib.Helper.JsonSerializeObject(detailModel, ""));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 获取某个区域用户列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="location"></param>
        /// <returns></returns>
        public static string GetLocationUsr(int pageIndex, string location, string order = "")
        {
            IndexDetailModel detailModel = new IndexDetailModel();

            int[] accId = DashBoardAnalyzeBLL.GetLocationAccId(pageIndex, location);

            //int[] accId = CommonLib.Helper.JsonDeserializeObject<List<int>>(dic["accidList"]).ToArray();

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId, order, pageIndex);
            detailModel.rowCount = accId.Length;
            //int.Parse(dic["rowCount"]);
            detailModel.maxPage = accId.Length % 15 == 0 ? accId.Length / 15 : (accId.Length / 15 + 1);
            //int.Parse(dic["maxPage"]);

            return(CommonLib.Helper.JsonSerializeObject(detailModel, ""));
        }
Exemplo n.º 8
0
        public static string GetFilterUsr(int pageIndex, string verif, string order, int uid)
        {
            IndexDetailModel detailModel = new IndexDetailModel();
            List <string>    accIdStr    = SynthesisIFilterLogBLL.GetAccountList(uid, verif).Split(',').ToList();

            accIdStr.RemoveAt(0);

            string[] accIdStrTemp = accIdStr.ToArray();

            int[] accId = Array.ConvertAll <string, int>(accIdStrTemp, delegate(string s) { return(int.Parse(s)); });

            detailModel.listData = DashBoardAnalyzeBLL.GetGeneralList(accId, order, pageIndex);
            detailModel.rowCount = accId.Length;
            //int.Parse(dic["rowCount"]);
            detailModel.maxPage = accId.Length % 15 == 0 ? accId.Length / 15 : (accId.Length / 15 + 1);
            //int.Parse(dic["maxPage"]);

            return(CommonLib.Helper.JsonSerializeObject(detailModel, "yyyy-MM-dd HH:mm:ss"));
        }
Exemplo n.º 9
0
        public static string GetLoginType(DateTime date)
        {
            var model       = new LoginTypeDiff();
            var cacheKey    = "GetLoginTypeDiffData:" + date.ToString("yyyyMMdd");
            var cacheResult = "";

            //Cache Redis
            cacheResult = RedisHelper.GetKey(cacheKey);
            if (cacheResult != null && cacheResult != "")
            {
                model = CommonLib.Helper.JsonDeserializeObject <LoginTypeDiff>(cacheResult);
            }
            else
            {
                model = DashBoardAnalyzeBLL.GetLoginTypeDiff(date);
                var cacheExpire = 60 * 5;
                RedisHelper.SetKey(cacheKey, CommonLib.Helper.JsonSerializeObject(model), cacheExpire);
            }

            return(CommonLib.Helper.JsonSerializeObject(model));
        }
Exemplo n.º 10
0
        /// <summary>
        /// 返回当天活跃用户数据
        /// </summary>
        /// <param name="nowDay"></param>
        /// <returns></returns>
        public static string GetActiveDashBoardData(DateTime nowDay)
        {
            var model       = new DashBoardModel();
            var cacheKey    = "GetActiveDashBoardData:" + nowDay.ToString("yyyyMMdd");
            var cacheResult = "";

            //Cache Redis
            cacheResult = RedisHelper.GetKey(cacheKey);
            if (cacheResult != null && cacheResult != "")
            {
                model = CommonLib.Helper.JsonDeserializeObject <DashBoardModel>(cacheResult);
            }
            else
            {
                model = DashBoardAnalyzeBLL.GetActiveDashBoardData(nowDay);
                var cacheExpire = 60 * 60 * 6;
                RedisHelper.SetKey(cacheKey, CommonLib.Helper.JsonSerializeObject(model), cacheExpire);
            }

            return(CommonLib.Helper.JsonSerializeObject(model));
        }
Exemplo n.º 11
0
        public static string GetLocationUsrStatus(string location)
        {
            int[] accId = DashBoardAnalyzeBLL.GetLocationAccId(1, location);

            return(CommonLib.Helper.JsonSerializeObject(DashBoardAnalyzeBLL.GetLocationUsrStatus(accId)));
        }
Exemplo n.º 12
0
        public static string GetVennData(string type, DateTime stDate, DateTime edDate)
        {
            ActiveUsrList accidListModel = DashBoardAnalyzeBLL.GetVennUsrList(type, stDate, edDate);
            VennSetsModel setsModel      = new VennSetsModel();
            VennSet       vennSet        = new VennSet();
            List <int>    tempAccidList  = new List <int>();

            int comCount = 0;

            List <string> strList  = new List <string>();
            DateTime      iterDate = stDate;

            while (iterDate < edDate)
            {
                strList.Add(iterDate.ToShortDateString());
                iterDate = iterDate.AddDays(1);
            }

            Dictionary <string, int> dic = new Dictionary <string, int>();

            for (int i = 0; i < strList.Count; i++)
            {
                SetEnumList.Add(strList[i]);
                dic.Add(strList[i], i);
            }

            //递归获取所有日期组合的集合
            Combination(dic, strList);

            //初始化日期组合的集合
            foreach (string str in SetEnumList)
            {
                vennSet.SetsElements = str.Split(',').ToList();
                comCount             = vennSet.SetsElements.Count;
                if (comCount == 1)
                {
                    try
                    {
                        vennSet.SetsCount  = accidListModel.ActiveAccids.Find(x => x.DayDate.ToShortDateString() == vennSet.SetsElements[0]).AccidList.Count;
                        vennSet.SetsDetail = accidListModel.ActiveAccids.Find(x => x.DayDate.ToShortDateString() == vennSet.SetsElements[0]).AccidList;
                    }
                    catch (Exception ex)
                    {
                        vennSet.SetsCount  = 0;
                        vennSet.SetsDetail = new List <int>();
                    }
                }
                else
                {
                    try
                    {
                        tempAccidList = accidListModel.ActiveAccids.Find(x => x.DayDate.ToShortDateString() == vennSet.SetsElements[0]).AccidList;
                        for (int i = 1; i < comCount; i++)
                        {
                            tempAccidList = tempAccidList.Intersect(accidListModel.ActiveAccids.Find(x => x.DayDate.ToShortDateString() == vennSet.SetsElements[i]).AccidList).ToList();
                        }
                        vennSet.SetsCount  = tempAccidList.Count;
                        vennSet.SetsDetail = tempAccidList;
                    }
                    catch (Exception ex)
                    {
                        vennSet.SetsDetail = new List <int>();
                        vennSet.SetsCount  = 0;
                    }
                }

                setsModel.SetsList.Add(new VennSet(vennSet.SetsElements, vennSet.SetsCount, vennSet.SetsDetail));
            }

            SetEnumList = new List <string>();
            return(CommonLib.Helper.JsonSerializeObject(setsModel));
        }
Exemplo n.º 13
0
 public static string GetFunnelDataEx(string activeList)
 {
     return(CommonLib.Helper.JsonSerializeObject(DashBoardAnalyzeBLL.GetConversionFunnelEx(activeList)));
 }
Exemplo n.º 14
0
 /// <summary>
 /// 返回当日新增用户的来源渠道
 /// </summary>
 /// <returns></returns>
 public static string GetRegUsr(DateTime date)
 {
     return(CommonLib.Helper.JsonSerializeObject(DashBoardAnalyzeBLL.GetRegUsrDiff(date)));
 }
Exemplo n.º 15
0
        public static string GetNewUsrDashBoardDataDetail(DateTime nowDay)
        {
            DashBoardModel model = DashBoardAnalyzeBLL.GetNewUsrDashBoardDataDetail(nowDay);

            return(CommonLib.Helper.JsonSerializeObject(model));
        }