예제 #1
0
        /// <summary>
        /// 获取完成指标百分比
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string GetMonthlyData(DateTime dt)
        {
            List <dynamic>    list       = SysRpt_WebDayInfoBLL.GetMonthlyData(dt);
            List <MonthlyKPI> listPreset = Sys_PresetKPIBLL.GetList(1, true, dt);

            List <KPICompareModel> modelList = new List <KPICompareModel>();

            if (list != null && list.Count > 0 && listPreset != null && listPreset.Count > 0)
            {
                modelList.Add(new KPICompareModel("注册量", Convert.ToInt32(list[0].Account), listPreset[0].RegNum,
                                                  (Convert.ToInt32(list[0].Account) * 100 / listPreset[0].RegNum).ToString("#0.00")));

                modelList.Add(new KPICompareModel("销售笔数", Convert.ToInt32(list[0].Sale), listPreset[0].SellCount,
                                                  (Convert.ToInt32(list[0].Sale) * 100 / listPreset[0].SellCount).ToString("#0.00")));

                modelList.Add(new KPICompareModel("新增会员", Convert.ToInt32(list[0].Usr), listPreset[0].UsrAdd,
                                                  (Convert.ToInt32(list[0].Usr) * 100 / listPreset[0].UsrAdd).ToString("#0.00")));

                modelList.Add(new KPICompareModel("新增商品", Convert.ToInt32(list[0].Goods), listPreset[0].Sku,
                                                  (Convert.ToInt32(list[0].Goods) * 100 / listPreset[0].Sku).ToString("#0.00")));

                modelList.Add(new KPICompareModel("短信量", Convert.ToInt32(list[0].Sms), listPreset[0].Sms,
                                                  (Convert.ToInt32(list[0].Sms) * 100 / listPreset[0].Sms).ToString("#0.00")));

                //modelList.Add(new KPICompareModel("订单笔数", Convert.ToInt32(list[0].Ord), listPreset[0].OrderCount,
                //(Convert.ToInt32(list[0].Ord) * 100 / listPreset[0].OrderCount).ToString("#0.00")));
                modelList.Add(new KPICompareModel("订单金额", Convert.ToInt32(list[0].ordMon), listPreset[0].OrderCount,
                                                  (Convert.ToInt32(list[0].ordMon) * 100 / listPreset[0].OrderCount).ToString("#0.00")));
            }


            return(CommonLib.Helper.JsonSerializeObject(modelList));
        }
예제 #2
0
        public static string GetMonthlyReview()
        {
            List <MonReviewModel> monthList = new List <MonReviewModel>();
            List <MonthlyKPI>     kpiModel  = Sys_PresetKPIBLL.GetList(1, false, DateTime.Now);

            foreach (MonthlyKPI kpi in kpiModel)
            {
                MonReviewModel monthReview = new MonReviewModel();
                monthReview.Month       = kpi.MDate.ToString("yyyy-MM");
                monthReview.MonthlyData =
                    CommonLib.Helper.JsonDeserializeObject <List <KPICompareModel> >(GetMonthlyData(kpi.MDate));

                monthList.Add(monthReview);
            }

            return(CommonLib.Helper.JsonSerializeObject(monthList));
        }
예제 #3
0
 /// <summary>
 /// 获取KPI列表,默认参数为只获取列表
 /// </summary>
 /// <param name="page"></param>
 /// <returns></returns>
 public static List <MonthlyKPI> GetKpiList(int page)
 {
     return(Sys_PresetKPIBLL.GetList(page, false, DateTime.Now));
 }