public BaseApiResponse ListPage([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var thirdCurrencys = _thirdCurrencyQueryService.ThirdCurrencys(); var total = thirdCurrencys.Count(); //筛选 if (!request.Name.IsNullOrEmpty()) { thirdCurrencys = thirdCurrencys.Where(x => x.Name.Contains(request.Name)); } //分页 thirdCurrencys = thirdCurrencys.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListResponse { Total = total, ThirdCurrencys = thirdCurrencys.Select(x => new ThirdCurrency { Id = x.Id, Name = x.Name, Icon = x.Icon, CompanyName = x.CompanyName, Conversion = x.Conversion, ImportedAmount = x.ImportedAmount, MaxImportAmount = x.MaxImportAmount, CreatedOn = x.CreatedOn.GetTimeSpan(), Remark = x.Remark, IsLocked = x.IsLocked }).ToList() }); }
public ListPageResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var wallets = _walletQueryService.ListPage(); var pageSize = 20; var total = wallets.Count(); //筛选 if (!request.Mobile.IsNullOrEmpty()) { wallets = wallets.Where(x => x.OwnerMobile.Contains(request.Mobile)); } total = wallets.Count(); //分页 wallets = wallets.Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListPageResponse { Total = total, Wallets = wallets.Select(x => new Wallet { Id = x.Id, OwnerMobile = x.OwnerMobile, Cash = x.Cash, Benevolence = x.Benevolence, BenevolenceTotal = x.BenevolenceTotal, TodayBenevolenceAdded = x.TodayBenevolenceAdded, YesterdayEarnings = x.YesterdayEarnings, Earnings = x.Earnings, AccessCode = x.AccessCode, YesterdayIndex = x.YesterdayIndex }).ToList() }); }
public ListPageResponse ListPage([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var storeOrders = _storeOrderQueryService.StoreOrderList(); var total = storeOrders.Count(); //筛选 if (request.Status != StoreOrderStatus.All) { storeOrders = storeOrders.Where(x => x.Status == request.Status); } if (!request.Number.IsNullOrEmpty()) { storeOrders = storeOrders.Where(x => x.Number.Contains(request.Number)); } if (!request.Mobile.IsNullOrEmpty()) { storeOrders = storeOrders.Where(x => x.Mobile.Contains(request.Mobile)); } if (!request.StoreName.IsNullOrEmpty()) { storeOrders = storeOrders.Where(x => x.Name.Contains(request.StoreName)); } total = storeOrders.Count(); //分页 storeOrders = storeOrders.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListPageResponse { Total = total, StoreOrders = storeOrders.Select(x => new StoreOrderWithInfo { Id = x.Id, StoreId = x.StoreId, Name = x.Name, Mobile = x.Mobile, NickName = x.NickName, UserId = x.UserId, Region = x.Region, Number = x.Number, Remark = x.Remark, ExpressRegion = x.ExpressRegion, ExpressAddress = x.ExpressAddress, ExpressName = x.ExpressName, ExpressMobile = x.ExpressMobile, ExpressZip = x.ExpressZip, CreatedOn = x.CreatedOn, Total = x.Total, ShopCash = x.ShopCash, StoreTotal = x.StoreTotal, DeliverExpressName = x.DeliverExpressName, DeliverExpressCode = x.DeliverExpressCode, DeliverExpressNumber = x.DeliverExpressNumber, Status = x.Status.ToString() }).ToList() }); }
public ListPageResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var stores = _storeQueryService.StoreList(); var total = stores.Count(); //筛选 if (request.Type != StoreType.All) { stores = stores.Where(x => x.Type == request.Type); } if (request.Status != StoreStatus.All) { stores = stores.Where(x => x.Status == request.Status); } if (!request.Name.IsNullOrEmpty()) { stores = stores.Where(x => x.Name.Contains(request.Name)); } if (!request.Region.IsNullOrEmpty()) { stores = stores.Where(x => x.Region.Contains(request.Region)); } total = stores.Count(); //分页 stores = stores.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListPageResponse { Total = total, Stores = stores.Select(x => new Store { Id = x.Id, UserId = x.UserId, Mobile = x.Mobile, Name = x.Name, Region = x.Region, Address = x.Address, TodayOrder = x.TodayOrder, OnSaleGoodsCount = x.OnSaleGoodsCount, TodaySale = x.TodaySale, Description = x.Description, TotalOrder = x.TotalOrder, TotalSale = x.TotalSale, SubjectName = x.SubjectName, SubjectNumber = x.SubjectNumber, SubjectPic = x.SubjectPic, Type = x.Type.ToString(), IsLocked = x.IsLocked, Status = x.Status.ToString() }).ToList() }); }
public BaseApiResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var goodses = _goodsQueryService.Goodses(); var pageSize = 20; var total = goodses.Count(); //筛选 if (request.Status != GoodsStatus.All) { goodses = goodses.Where(x => x.Status == request.Status); } if (request.IsPublished != -1) { goodses = goodses.Where(x => x.IsPublished == Convert.ToBoolean(request.IsPublished)); } if (!request.Name.IsNullOrEmpty()) { goodses = goodses.Where(x => x.Name.Contains(request.Name)); } if (!request.StoreName.IsNullOrEmpty()) { goodses = goodses.Where(x => x.StoreName.Contains(request.StoreName)); } total = goodses.Count(); //分页 goodses = goodses.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new GoodsesResponse { Total = total, Goodses = goodses.Select(x => new GoodsDetails { Id = x.Id, StoreId = x.StoreId, Pics = x.Pics.Split("|", true).ToList(), StoreName = x.StoreName, Name = x.Name, Description = x.Description, Price = x.Price, Stock = x.Stock, OriginalPrice = x.OriginalPrice, Benevolence = x.Benevolence, Is7SalesReturn = x.Is7SalesReturn, IsInvoice = x.IsInvoice, IsPayOnDelivery = x.IsPayOnDelivery, CreatedOn = x.CreatedOn, SellOut = x.SellOut, Sort = x.Sort, IsPublished = x.IsPublished, Status = x.Status.ToString(), RefusedReason = x.RefusedReason }).ToList() }); }
public BaseApiResponse AllGoodses([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var currentAccount = _contextService.GetCurrentAccount(HttpContext); var storeInfo = _storeQueryService.InfoByUserId(currentAccount.UserId.ToGuid()); var goodses = _goodsQueryService.GetStoreGoodses(storeInfo.Id); var pageSize = 20; var total = goodses.Count(); //筛选 if (request.Status != GoodsStatus.All) { goodses = goodses.Where(x => x.Status == request.Status); } if (!request.Name.IsNullOrEmpty()) { goodses = goodses.Where(x => x.Name.Contains(request.Name)).OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); total = goodses.Count(); } total = goodses.Count(); //分页 goodses = goodses.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new AllGoodsResponse { Total = total, Goodses = goodses.Select(x => new GoodsDetails { Id = x.Id, StoreId = x.StoreId, Pics = x.Pics.Split("|", true).ToList(), Name = x.Name, Description = x.Description, Price = x.Price, Stock = x.Stock, OriginalPrice = x.OriginalPrice, Benevolence = x.Benevolence, Is7SalesReturn = x.Is7SalesReturn, IsInvoice = x.IsInvoice, IsPayOnDelivery = x.IsPayOnDelivery, CreatedOn = x.CreatedOn, Sort = x.Sort, IsPublished = x.IsPublished, Status = x.Status.ToString(), RefusedReason = x.RefusedReason }).ToList() }); }
public BaseApiResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var partners = _partnerQueryService.Partners(); var total = partners.Count(); //筛选 if (request.Level != PartnerLevel.All) { partners = partners.Where(x => x.Level == request.Level); } if (!request.Mobile.IsNullOrEmpty()) { partners = partners.Where(x => x.Mobile.Contains(request.Mobile)); } if (!request.Region.IsNullOrEmpty()) { partners = partners.Where(x => x.Region.Contains(request.Region)); } //分页 partners = partners.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListResponse { Total = total, Partners = partners.Select(x => new Partner { Id = x.Id, UserId = x.UserId, WalletId = x.WalletId, Mobile = x.Mobile, Region = x.Region, Level = x.Level.ToString(), Persent = x.Persent, CashPersent = x.CashPersent, BalanceInterval = x.BalanceInterval, LastBalancedAmount = x.LastBalancedAmount, TotalBalancedAmount = x.TotalBalancedAmount, BalancedDate = x.BalancedDate.ToShortDateString(), NextBalancedDate = x.BalancedDate.AddDays(x.BalanceInterval).ToShortDateString(), CreatedOn = x.CreatedOn.GetTimeSpan(), Remark = x.Remark, IsLocked = x.IsLocked }).ToList() }); }
public ListPageResponse ListPage([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var stores = _offlineStoreQueryService.StoreList(); var total = stores.Count(); //筛选 if (!request.Name.IsNullOrEmpty()) { stores = stores.Where(x => x.Name.Contains(request.Name)); } if (!request.Region.IsNullOrEmpty()) { stores = stores.Where(x => x.Region.Contains(request.Region)); } total = stores.Count(); //分页 stores = stores.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListPageResponse { Total = total, OfflineStores = stores.Select(x => new OfflineStore { Id = x.Id, UserId = x.UserId, Name = x.Name, Thumb = x.Thumb, Phone = x.Phone, Region = x.Region, Address = x.Address, TodaySale = x.TodaySale, Description = x.Description, Labels = x.Labels.Split("|", true), TotalSale = x.TotalSale, Persent = x.Persent, Longitude = x.Longitude, Latitude = x.Latitude, CreatedOn = x.CreatedOn.GetTimeSpan(), IsLocked = x.IsLocked }).ToList() }); }
public ListPageResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var categorys = _pubCategoryQueryService.RootCategorys(); return(new ListPageResponse { Total = categorys.Count(), Categorys = categorys.Select(x => new Category { Id = x.Id, Name = x.Name, Thumb = x.Thumb, IsShow = x.IsShow, Sort = x.Sort }).ToList() }); }
public BaseApiResponse ListPage([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var goodsBlocks = _goodsBlockQueryService.All(); var total = goodsBlocks.Count(); try { goodsBlocks = goodsBlocks.OrderByDescending(x => x.Sort).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListResponse { Total = total, GoodsBlocks = goodsBlocks.Select(x => new GoodsBlock { Id = x.Id, Name = x.Name, Thumb = x.Thumb, Banner = x.Banner, Layout = x.Layout.ToString(), IsShow = x.IsShow, Goodses = x.Goodses.Select(z => new Goods { Id = z.Id, Name = z.Name, Price = z.Price, OriginalPrice = z.OriginalPrice, Benevolence = z.Benevolence, Pics = z.Pics.IsNullOrEmpty() ? null : z.Pics.Split("|", true), CreatedOn = z.CreatedOn, Rate = z.Rate, SellOut = z.SellOut }).ToList(), Sort = x.Sort }).ToList() }); } catch (Exception e) { return(new BaseApiResponse { Code = 400, Message = e.Source + e.StackTrace + e.Message }); } }
public ListPageResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var users = _userQueryService.UserList(); var total = users.Count(); //筛选 if (request.Role != UserRole.All) { users = users.Where(x => x.Role == request.Role); } if (!request.Mobile.IsNullOrEmpty()) { users = users.Where(x => x.Mobile.Contains(request.Mobile)); } if (!request.NickName.IsNullOrEmpty()) { users = users.Where(x => x.NickName.Contains(request.NickName)); } total = users.Count(); //分页 users = users.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListPageResponse { Total = total, Users = users.Select(x => new User { Id = x.Id, ParentId = x.ParentId, NickName = x.NickName, Mobile = x.Mobile, Gender = x.Gender, Region = x.Region, Role = x.Role.ToString(), IsLocked = x.IsLocked, IsFreeze = x.IsFreeze }).ToList() }); }
public BaseApiResponse List(ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var announcements = _announcementQueryService.ListPage(); var total = announcements.Count(); announcements = announcements.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListResponse { Total = total, Announcements = announcements.Select(x => new Announcement { Id = x.Id, Title = x.Title, Body = x.Body }).ToList() }); }
public BaseApiResponse ListPage(ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var goodsBlockWarps = _goodsBlockWarpQueryService.All(); var total = goodsBlockWarps.Count(); goodsBlockWarps = goodsBlockWarps.OrderByDescending(x => x.Sort).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new Api.Models.Response.GoodsBlockWarps.ListResponse { Total = total, GoodsBlockWarps = goodsBlockWarps.Select(x => new GoodsBlockWarp { Id = x.Id, Name = x.Name, Style = x.Style.ToString(), IsShow = x.IsShow, Sort = x.Sort }).ToList() }); }
public BaseApiResponse ListPage([FromBody] ListPageRequest request) { request.CheckNotNull(nameof(request)); var pageSize = 20; var admins = _adminQueryService.Admins(); var total = admins.Count(); admins = admins.OrderByDescending(x => x.CreatedOn).Skip(pageSize * (request.Page - 1)).Take(pageSize); return(new ListResponse { Total = total, Admins = admins.Select(x => new Admin { Id = x.Id, Name = x.Name, LoginName = x.LoginName, Portrait = x.Portrait, Role = x.Role.ToString(), IsLocked = x.IsLocked, CreatedOn = x.CreatedOn }).ToList() }); }