Himall商城OrderAndSaleStatisticsApplicationc最近三个月订单统计数据、 获得店铺下门店销售汇总、 店铺下的所有门店销售排行

 private static IOrderAndSaleStatisticsService _iOrderAndSaleStatisticsService = ObjectContainer.Current.Resolve();


        ///


        /// c最近三个月订单统计数据
        ///

        /// 会员编号
        ///
        public static OrderBasicStatistics GetLastThreeMonthOrderStatisticsByUser(long userId)
        {
            return _iOrderAndSaleStatisticsService.GetLastThreeMonthOrderStatisticsByUser(userId);
        }


        ///


        /// 获得店铺销售汇总
        ///

        ///
        ///
        public static SaleStatistics GetShopSaleStatistics(long shopId, DateTime? start, DateTime? end)
        {
            return _iOrderAndSaleStatisticsService.GetSaleStatisticsByShop(shopId, start, end);
        }

        ///


        /// 获得店铺下门店销售汇总
        ///

        ///
        ///
        public static SaleStatistics GetBranchShopSaleStatistics(long branchShopId, DateTime? start, DateTime? end)
        {
            return _iOrderAndSaleStatisticsService.GetBranchShopSaleStatistics(branchShopId, start, end);
        }

        ///


        /// 店铺下的所有门店销售排行
        ///

        ///
        ///
        public static QueryPageModel GetBranchShopFeat(BranchShopFeatsQuery query)
        {
            var model = _iOrderAndSaleStatisticsService.GetBranchShopFeat(query);

            var ids = model.Models.Select(a => a.BranchShopId).ToList();

            if (ids != null && ids.Count() > 0)
            {
                var branchShop = ShopBranchApplication.GetShopBranchByIds(ids);
                foreach (var m in model.Models)
                {
                    var branch = branchShop.Where(a => a.Id == m.BranchShopId).FirstOrDefault();
                    if (branch != null)
                    {
                        m.BranchShopName = branch.ShopBranchName;
                    }
                }
            }
            return model;
        }
        ///


        /// 店铺下某个门店每天的销售排行及销量
        ///

        ///
        ///
        public static QueryPageModel GetDayAmountSale(BranchShopDayFeatsQuery query)
        {
            var list = _iOrderAndSaleStatisticsService.GetDayAmountSale(query.StartDate, query.EndDate, query.BranchShopId);
            var pageList = list.Skip((query.PageNo - 1) * query.PageSize).Take(query.PageSize).ToList();
            foreach (var m in pageList)
            {
                m.Rank = _iOrderAndSaleStatisticsService.GetRank(m.Day, query.ShopId, m.SaleAmount);
            }
            QueryPageModel result = new QueryPageModel();
            result.Total = list.Count();
            result.Models = pageList;
            return result;
        }

你可能感兴趣的:(java,c#,单例模式)