Beispiel #1
0
        /// <summary>
        /// 创建月订单报表
        /// </summary>
        /// <param name="monthnum"></param>
        public void CreateMonthReport(int monthnum, int year)
        {
            //foreach (var item in ProductStatisticServerOptSet)
            //{
            //    var result = item.CreateMonthReport(monthnum, year);
            //}
            //foreach (var item in OrderStatisticServerOptSet)
            //{
            //    var result = item.CreateMonthReport(monthnum, year);
            //}
            //foreach (var item in DistrictStatisticServerOptSet)
            //{
            //    var result = item.CreateDistrictMonthReport(monthnum, year);
            //}
            //foreach (var item in CustomerStatisticServerOptSet)
            //{
            //    var result = item.CreateMonthReport(monthnum, year);
            //}
            #region 动态方式加载

            foreach (var item in AppServer.Instance.ConfigDictionary.Values.Where(i => i.CreateReport != false))
            {
                ProductStatisticServerCommon pcomm = new ProductStatisticServerCommon(item.Name, item.Tag);
                pcomm.CreateMonthReport(monthnum, year);
                OrderStatisticServerCommon ocomm = new OrderStatisticServerCommon(item.Name, item.Tag);
                ocomm.CreateMonthReport(monthnum, year);
                DistrictStatisticServerCommon dcomm = new DistrictStatisticServerCommon(item.Name, item.Tag);
                dcomm.CreateDistrictMonthReport(monthnum, year);
                CustomerStatisticServerCommon ccomm = new CustomerStatisticServerCommon(item.Name, item.Tag);
                ccomm.CreateMonthReport(monthnum, year);
            }
            #endregion
        }
Beispiel #2
0
        public bool CreateYearReport(int year)
        {
            #region 动态方式加载

            try
            {
                foreach (var item in AppServer.Instance.ConfigDictionary.Values.Where(i => i.CreateReport != false))
                {
                    ProductStatisticServerCommon pcomm = new ProductStatisticServerCommon(item.Name, item.Tag);
                    pcomm.CreateYearReport(year);
                    OrderStatisticServerCommon ocomm = new OrderStatisticServerCommon(item.Name, item.Tag);
                    ocomm.CreateYearReport(year);
                    DistrictStatisticServerCommon dcomm = new DistrictStatisticServerCommon(item.Name, item.Tag);
                    dcomm.CreateDistrictYearReport(year);
                    CustomerStatisticServerCommon ccomm = new CustomerStatisticServerCommon(item.Name, item.Tag);
                    ccomm.CreateYearReport(year);
                }
                Util.Logs.Log.GetLog(nameof(StatisticServer)).Info($"{year}创建年报表任务已提交");
                return(true);
            }
            catch (Exception ex)
            {
                Util.Logs.Log.GetLog(nameof(Statistic)).Error($"历史报表{year}年生成失败。/r/n{ex.Message}");
                return(false);
            }


            #endregion
        }
Beispiel #3
0
        /// <summary>
        /// 生成日报表
        /// </summary>
        public void CreateDailyReport(DateTime dateTime)
        {
            /*生成昨日报表
             */
            #region 静态实现


            //foreach (var item in ProductStatisticServerOptSet)
            //{
            //    var result = item.CreateDailyReport(dateTime);
            //}
            //foreach (var item in OrderStatisticServerOptSet)
            //{
            //    var result = item.CreateDailyReport(dateTime);
            //}
            //foreach (var item in DistrictStatisticServerOptSet)
            //{
            //    var result = item.CreateDistrictDailyReport(dateTime);
            //}
            #endregion
            #region 动态方式加载
            //加载所有渠道

            foreach (var item in AppServer.Instance.ConfigDictionary.Values.Where(i => i.CreateReport != false))
            {
                ProductStatisticServerCommon pcomm = new ProductStatisticServerCommon(item.Name, item.Tag);
                pcomm.CreateDailyReport(dateTime);
                OrderStatisticServerCommon ocomm = new OrderStatisticServerCommon(item.Name, item.Tag);
                ocomm.CreateDailyReport(dateTime);
                DistrictStatisticServerCommon dcomm = new DistrictStatisticServerCommon(item.Name, item.Tag);
                dcomm.CreateDistrictDailyReport(dateTime);
                CustomerStatisticServerCommon ccomm = new CustomerStatisticServerCommon(item.Name, item.Tag);
                ccomm.CreateDailyReport(dateTime);
            }
            #endregion
        }