public async override Task <PagedResultDto <TEntityDto> > GetAll(PagedResultRequestInput input) { CheckGetAllPermission(); var query = _repository.DynamicQuery(input); var tasksCount = await query.CountAsync(); var taskList = query.PageBy(input).ToList(); return(new PagedResultDto <TEntityDto>(tasksCount, ObjectMapper.Map <List <TEntityDto> >(taskList))); }
public async override Task <PagedResultDto <ReelMoveMethodDto> > GetAll(PagedResultRequestInput input) { CheckGetAllPermission(); var query = _repository.DynamicQuery(input).Include(r => r.OutStorages); var tasksCount = await query.CountAsync(); var taskList = query.PageBy(input).ToList(); return(new PagedResultDto <ReelMoveMethodDto>(tasksCount, ObjectMapper.Map <List <ReelMoveMethodDto> >(taskList))); }
public async Task <PagedResultDto <GroupReelDto> > GetGroupReel(PagedResultRequestInput input) { // 先按参数查询数据 var query = _repository.DynamicQuery(input); var res = query.GroupBy(r => new { r.PartNoId, r.StorageId }).Select(r => new GroupReelDto() { PartNoId = r.Key.PartNoId, StorageId = r.Key.StorageId, ReelCount = r.Count(), TotalQty = r.Sum(reel => reel.Qty) }); var tasksCount = await res.CountAsync(); var taskList = res.PageBy(input).ToList(); return(new PagedResultDto <GroupReelDto>(tasksCount, taskList)); }
public async override Task <PagedResultDto <ProductDto> > GetAll(PagedResultRequestInput input) { // 查询 添加组件查询 // var query = _repositoryMPN.GetAll().Where(m => m.MPNHierarchy == MPNHierarchy.组件); input.RequestWMSDtos.Add(new RequestWMSDto() { LinkOperation = LinkOperation.And, Operation = Operation.Equal, PropertyName = "MPNHierarchy", QueryValue = 0 }); //获取总数 var query = _repositoryMPN.DynamicQuery(input); var tasksCount = await query.CountAsync(); //默认的分页方式 //var taskList = query.Skip(input.SkipCount).Take(input.MaxResultCount).ToList(); //ABP提供了扩展方法PageBy分页方式 var taskList = query.PageBy(input).ToList(); return(new PagedResultDto <ProductDto>(tasksCount, config.CreateMapper().Map <List <MPN>, List <ProductDto> >(taskList))); }