导出接口

This commit is contained in:
tongfei
2023-11-15 15:02:19 +08:00
parent 9840fb93fb
commit 2cbc496e1f
17 changed files with 327 additions and 64 deletions

View File

@@ -19,7 +19,7 @@ namespace WMS.Web.Repositories
/// <summary>
/// 箱库存-仓储
/// </summary>
public class BoxInventoryRepositories: IBoxInventoryRepositories
public class BoxInventoryRepositories: IAllFielRepositories<BoxInventoryQueryRequest>, IBoxInventoryRepositories
{
private readonly IMapper _mapper;
private readonly IServiceProvider _serviceProvider;
@@ -52,12 +52,12 @@ namespace WMS.Web.Repositories
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
public async Task<ResultPagedList<BoxInventoryQueryResponse>> GetPagedList(BoxInventoryQueryRequest dto)
public async Task<(List<BoxInventoryQueryResponse> list, int total)> GetPagedList(BoxInventoryQueryRequest dto)
{
//1.获取物料集合和组织集合
var materials_result = await _erpService.BillQueryForMaterial();
if (!materials_result.IsSuccess)
return ResultPagedList<BoxInventoryQueryResponse>.ReFailure(materials_result);
return (new List<BoxInventoryQueryResponse>(), 0);
var materials = materials_result.Data.ToList();
//物料集合;模糊查询后的物料集合
@@ -80,10 +80,7 @@ namespace WMS.Web.Repositories
if (dto.SubStockId.HasValue)
query = query.Where(w => w.order.SubStockId == dto.SubStockId.Value);
var response = new ResultPagedList<BoxInventoryQueryResponse>();
int total = await query.CountAsync();
response.TotalCount = total;
var list = await query.Select(s => new BoxInventoryQueryResponse()
{
Id = s.order.Id,
@@ -96,9 +93,7 @@ namespace WMS.Web.Repositories
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.order.SubStockId),
Qty = s.detail.Qty,
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
response.Data = list;
return response;
return (list,total);
}
/// <summary>
@@ -236,5 +231,16 @@ namespace WMS.Web.Repositories
}
return true;
}
/// <summary>
/// 导出
/// </summary>
/// <param name="dto"></param>
/// <param name="companyId"></param>
/// <returns></returns>
public async Task<(object obj, int total)> GetListField(BoxInventoryQueryRequest dto, int companyId)
{
return await GetPagedList(dto);
}
}
}