예제 #1
0
        public ActionResult AnalysisEffectShop()
        {
            DateTime date     = DateTime.Now.AddDays(-1).Date;
            DateTime dateTime = date.AddDays(1).AddMilliseconds(-1);

            ShopInfo.ShopVistis shopVistiInfo = ServiceHelper.Create <IShopService>().GetShopVistiInfo(date, dateTime, base.CurrentSellerManager.ShopId);
            IList <EchartsData> echartsDatas  = new List <EchartsData>();

            if (shopVistiInfo == null)
            {
                string      str          = (new decimal(0)).ToString();
                EchartsData echartsDatum = new EchartsData()
                {
                    name   = "访问次数",
                    @value = str
                };
                echartsDatas.Add(echartsDatum);
                EchartsData echartsDatum1 = new EchartsData()
                {
                    name   = "下单次数",
                    @value = str
                };
                echartsDatas.Add(echartsDatum1);
                EchartsData echartsDatum2 = new EchartsData()
                {
                    name   = "支付金额",
                    @value = str
                };
                echartsDatas.Add(echartsDatum2);
            }
            else
            {
                EchartsData echartsDatum3 = new EchartsData()
                {
                    name   = "访问次数",
                    @value = shopVistiInfo.VistiCounts.ToString()
                };
                echartsDatas.Add(echartsDatum3);
                EchartsData echartsDatum4 = new EchartsData()
                {
                    name   = "下单次数",
                    @value = shopVistiInfo.OrderCounts.ToString()
                };
                echartsDatas.Add(echartsDatum4);
                EchartsData echartsDatum5 = new EchartsData()
                {
                    name   = "支付金额",
                    @value = shopVistiInfo.SaleAmounts.ToString()
                };
                echartsDatas.Add(echartsDatum5);
            }
            return(Json(new { successful = true, chart = echartsDatas }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
 public ShopInfo.ShopVistis GetShopVistiInfo(DateTime startDate, DateTime endDate, long shopId)
 {
     ShopInfo.ShopVistis shopVisti = (
         from p in context.ShopVistiInfo
         where p.ShopId == shopId && (p.Date >= startDate) && (p.Date <= endDate)
         group p by p.ShopId into g
         select new ShopInfo.ShopVistis()
     {
         SaleAmounts = g.Sum <ShopVistiInfo>((ShopVistiInfo c) => c.SaleAmounts),
         SaleCounts = g.Sum <ShopVistiInfo>((ShopVistiInfo c) => c.SaleCounts),
         VistiCounts = g.Sum <ShopVistiInfo>((ShopVistiInfo c) => c.VistiCounts),
         OrderCounts = new decimal(0)
     }).FirstOrDefault <ShopInfo.ShopVistis>();
     if (shopVisti != null)
     {
         shopVisti.OrderCounts = (
             from c in context.OrderInfo
             where (c.OrderDate >= startDate) && (c.OrderDate <= endDate) && c.ShopId == shopId
             select c).Count();
     }
     return(shopVisti);
 }
예제 #3
0
        public ActionResult AnalysisEffectShop()
        {
            DateTime startDate = DateTime.Now.AddDays(-1).Date;
            DateTime endDate   = startDate.AddDays(1).AddMilliseconds(-1);

            ShopInfo.ShopVistis shopVistis     = _iShopService.GetShopVistiInfo(startDate, endDate, CurrentSellerManager.ShopId);
            IList <EchartsData> lstEchartsData = new List <EchartsData>();

            if (shopVistis != null)
            {
                lstEchartsData.Add(new EchartsData {
                    name = "访问次数", value = shopVistis.VistiCounts.ToString()
                });
                lstEchartsData.Add(new EchartsData {
                    name = "下单次数", value = shopVistis.OrderCounts.ToString()
                });
                lstEchartsData.Add(new EchartsData {
                    name = "成交笔数", value = shopVistis.OrderPayCount.ToString()
                });
            }
            else
            {
                string zero = decimal.Zero.ToString();
                lstEchartsData.Add(new EchartsData {
                    name = "访问次数", value = zero
                });
                lstEchartsData.Add(new EchartsData {
                    name = "下单次数", value = zero
                });
                lstEchartsData.Add(new EchartsData {
                    name = "成交笔数", value = zero
                });
            }

            return(Json(new { success = true, chart = lstEchartsData }, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        public ActionResult Console()
        {
            ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO();
            ViewBag.sortpayid = _orderBO.GenerateOrderNumber();

            HomeModel homeModel = new HomeModel()
            {
                SellerConsoleModel = ServiceHelper.Create <IShopService>().GetSellerConsoleModel(base.CurrentSellerManager.ShopId, base.CurrentUser.Id),
                Articles           = ServiceHelper.Create <IArticleService>().GetTopNArticle <ArticleInfo>(6, 4, null, false)
            };
            ShopInfo shop = ServiceHelper.Create <IShopService>().GetShop(base.CurrentSellerManager.ShopId, false);

            if (shop != null)
            {
                ViewBag.UserType      = base.CurrentUser.UserType;
                ViewBag.SortType      = shop.SortType;
                ViewBag.Logo          = base.CurrentSiteSetting.MemberLogo;
                homeModel.ShopId      = shop.Id;
                homeModel.ShopLogo    = shop.Logo;
                homeModel.ShopName    = shop.ShopName;
                homeModel.ShopEndDate = (shop.EndDate.HasValue ? shop.EndDate.Value.ToString("yyyy-MM-dd") : string.Empty);
                ShopGradeInfo shopGradeInfo = (
                    from c in ServiceHelper.Create <IShopService>().GetShopGrades()
                    where c.Id == shop.GradeId
                    select c).FirstOrDefault();

                homeModel.ShopGradeName = (shopGradeInfo != null ? shopGradeInfo.Name : string.Empty);


                IQueryable <StatisticOrderCommentsInfo> shopStatisticOrderComments =
                    ServiceHelper.Create <IShopService>().GetShopStatisticOrderComments(base.CurrentSellerManager.ShopId);
                StatisticOrderCommentsInfo statisticOrderCommentsInfo = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 13
                    select c).FirstOrDefault(); //质量与描述满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo1 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 14
                    select c).FirstOrDefault();//发货速度满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo2 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 15
                    select c).FirstOrDefault();//服务态度满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo3 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 16 //包装质量满意度
                    select c).FirstOrDefault();
                string str = "5";                 //如果无评价数据,默认为5分
                homeModel.ProductAndDescription = (statisticOrderCommentsInfo != null ? string.Format("{0:F}", statisticOrderCommentsInfo.CommentValue) : str);
                homeModel.SellerServiceAttitude = (statisticOrderCommentsInfo1 != null ? string.Format("{0:F}", statisticOrderCommentsInfo1.CommentValue) : str);
                homeModel.SellerDeliverySpeed   = (statisticOrderCommentsInfo2 != null ? string.Format("{0:F}", statisticOrderCommentsInfo2.CommentValue) : str);
                homeModel.PackingQuality        = (statisticOrderCommentsInfo3 != null ? string.Format("{0:F}", statisticOrderCommentsInfo3.CommentValue) : str);

                homeModel.ProductsNumberIng        = homeModel.SellerConsoleModel.ProductLimit.ToString();
                homeModel.ProductsNumber           = homeModel.SellerConsoleModel.ProductsCount.ToString();
                homeModel.UseSpace                 = homeModel.SellerConsoleModel.ImageLimit.ToString();
                homeModel.UseSpaceing              = homeModel.SellerConsoleModel.ProductImages.ToString();
                homeModel.OrderProductConsultation = homeModel.SellerConsoleModel.ProductConsultations.ToString();
                homeModel.OrderCounts              = homeModel.SellerConsoleModel.OrderCounts.ToString();
                homeModel.OrderWaitPay             = homeModel.SellerConsoleModel.WaitPayTrades.ToString();
                homeModel.OrderWaitDelivery        = homeModel.SellerConsoleModel.WaitDeliveryTrades.ToString();
                ICommentService commentService = ServiceHelper.Create <ICommentService>();
                CommentQuery    commentQuery   = new CommentQuery()
                {
                    PageNo   = 1,
                    PageSize = 2147483647,
                    IsReply  = new bool?(false),
                    ShopID   = base.CurrentSellerManager.ShopId
                };
                int total = commentService.GetComments(commentQuery).Total;
                homeModel.OrderReplyComments      = total.ToString();
                homeModel.OrderHandlingComplaints = homeModel.SellerConsoleModel.Complaints.ToString();

                homeModel.OrderWithRefund          = homeModel.SellerConsoleModel.RefundTrades.ToString();
                homeModel.OrderWithRefundAndRGoods = homeModel.SellerConsoleModel.RefundAndRGoodsTrades.ToString();

                homeModel.ProductsEvaluation = homeModel.SellerConsoleModel.ProductComments.ToString();
                int num = (
                    from c in ServiceHelper.Create <IBrandService>().GetShopBrandApplys(base.CurrentSellerManager.ShopId)
                    where c.AuditStatus == 1
                    select c).Count();
                homeModel.ProductsBrands = num.ToString();
                homeModel.ProductsOnSale = homeModel.SellerConsoleModel.OnSaleProducts.ToString();
                IProductService productService = ServiceHelper.Create <IProductService>();
                ProductQuery    productQuery   = new ProductQuery()
                {
                    PageNo     = 1,
                    PageSize   = 2147483647,
                    ShopId     = new long?(base.CurrentSellerManager.ShopId),
                    SaleStatus = new ProductInfo.ProductSaleStatus?(ProductInfo.ProductSaleStatus.InDraft)
                };
                int total1 = productService.GetProducts(productQuery).Total;
                homeModel.ProductsInDraft           = total1.ToString();
                homeModel.ProductsWaitForAuditing   = homeModel.SellerConsoleModel.WaitForAuditingProducts.ToString();
                homeModel.ProductsAuditFailed       = homeModel.SellerConsoleModel.AuditFailureProducts.ToString();
                homeModel.ProductsInfractionSaleOff = homeModel.SellerConsoleModel.InfractionSaleOffProducts.ToString();
                homeModel.ProductsInStock           = homeModel.SellerConsoleModel.InStockProducts.ToString();
                DateTime            date          = DateTime.Now.AddDays(-1).Date;
                DateTime            dateTime      = date.AddDays(1).AddMilliseconds(-1);
                ShopInfo.ShopVistis shopVistiInfo = ServiceHelper.Create <IShopService>().GetShopVistiInfo(date, dateTime, base.CurrentSellerManager.ShopId);
                List <EchartsData>  echartsDatas  = new List <EchartsData>();
                if (shopVistiInfo == null)
                {
                    string str1 = (new decimal(0)).ToString();
                    ViewBag.VistiCounts = str1;
                    ViewBag.OrderCounts = str1;
                    ViewBag.SaleAmounts = str1;
                }
                else
                {
                    ViewBag.VistiCounts = shopVistiInfo.VistiCounts;
                    ViewBag.OrderCounts = shopVistiInfo.OrderCounts;
                    ViewBag.SaleAmounts = shopVistiInfo.SaleAmounts;
                }
            }
            return(View(homeModel));
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult ShopStore(long shopId)
        {
            ShopStore homeModel = new ShopStore();

            ShopInfo shop = ServiceHelper.Create <IShopService>().GetShop(shopId, false);

            if (shop != null)
            {
                ViewBag.SortType                          = shop.SortType;
                ViewBag.Logo                              = base.CurrentSiteSetting.MemberLogo;
                homeModel.ShopId                          = shop.Id;
                homeModel.ShopLogo                        = shop.Logo;
                homeModel.CompanyAddress                  = shop.CompanyAddress; // +"/" + shop.ECompanyAddress + "</span>";
                homeModel.ShopName                        = shop.ShopName;       // +"/" + shop.ECompanyName;
                homeModel.ContactsEmail                   = shop.ContactsEmail;
                homeModel.ContactsPhone                   = shop.ContactsPhone;
                homeModel.CompanyFoundingDate             = shop.CompanyFoundingDate.HasValue ? shop.CompanyFoundingDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                homeModel.URL                             = shop.URL;
                homeModel.CompanyFoundingDate             = shop.CreateDate.ToShortDateString();
                homeModel.GMPPhoto                        = shop.GMPPhoto;
                homeModel.ISOPhoto                        = shop.ISOPhoto;
                homeModel.FDAPhoto                        = shop.FDAPhoto;
                homeModel.Fax                             = shop.Fax;
                homeModel.OrganizationCodePhoto           = shop.OrganizationCodePhoto;
                homeModel.TaxRegistrationCertificatePhoto = shop.TaxRegistrationCertificatePhoto;
                homeModel.BusinessLicenceNumberPhoto      = shop.BusinessLicenceNumberPhoto;
                homeModel.ShopAccount                     = shop.ShopAccount;
                homeModel.ContactsName                    = shop.ContactsName;// +"/" + shop.EContactsName;
                homeModel.BankName                        = shop.BankName;
                homeModel.BankAccountNumber               = shop.BankAccountNumber;
                // homeModel.Price=
                homeModel.ShopEndDate = (shop.EndDate.HasValue ? shop.EndDate.Value.ToString("yyyy-MM-dd") : string.Empty);
                ShopGradeInfo shopGradeInfo = (
                    from c in ServiceHelper.Create <IShopService>().GetShopGrades()
                    where c.Id == shop.GradeId
                    select c).FirstOrDefault();
                homeModel.ShopGradeName = (shopGradeInfo != null ? shopGradeInfo.Name : string.Empty);


                IQueryable <StatisticOrderCommentsInfo> shopStatisticOrderComments = ServiceHelper.Create <IShopService>().GetShopStatisticOrderComments(shopId);
                StatisticOrderCommentsInfo statisticOrderCommentsInfo = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 13
                    select c).FirstOrDefault(); //质量与描述满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo1 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 14
                    select c).FirstOrDefault();//发货速度满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo2 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 15
                    select c).FirstOrDefault();//服务态度满意度
                StatisticOrderCommentsInfo statisticOrderCommentsInfo3 = (
                    from c in shopStatisticOrderComments
                    where (int)c.CommentKey == 16 //包装质量满意度
                    select c).FirstOrDefault();
                string str = "5";                 //如果无评价数据,默认为5分
                homeModel.ProductAndDescription = (statisticOrderCommentsInfo != null ? string.Format("{0:F}", statisticOrderCommentsInfo.CommentValue) : str);
                homeModel.SellerServiceAttitude = (statisticOrderCommentsInfo1 != null ? string.Format("{0:F}", statisticOrderCommentsInfo1.CommentValue) : str);
                homeModel.SellerDeliverySpeed   = (statisticOrderCommentsInfo2 != null ? string.Format("{0:F}", statisticOrderCommentsInfo2.CommentValue) : str);
                homeModel.PackingQuality        = (statisticOrderCommentsInfo3 != null ? string.Format("{0:F}", statisticOrderCommentsInfo3.CommentValue) : str);


                DateTime            date          = DateTime.Now.AddDays(-1).Date;
                DateTime            dateTime      = date.AddDays(1).AddMilliseconds(-1);
                ShopInfo.ShopVistis shopVistiInfo = ServiceHelper.Create <IShopService>().GetShopVistiInfo(date, dateTime, shopId);
                List <EchartsData>  echartsDatas  = new List <EchartsData>();
                if (shopVistiInfo == null)
                {
                    string str1 = (new decimal(0)).ToString();
                    ViewBag.VistiCounts = str1;
                    ViewBag.OrderCounts = str1;
                    ViewBag.SaleAmounts = str1;
                }
                else
                {
                    ViewBag.VistiCounts = shopVistiInfo.VistiCounts;
                    ViewBag.OrderCounts = shopVistiInfo.OrderCounts;
                    ViewBag.SaleAmounts = shopVistiInfo.SaleAmounts;
                }
            }

            return(View(homeModel));
        }