导出接口
This commit is contained in:
@@ -20,7 +20,7 @@ namespace WMS.Web.Repositories
|
||||
/// <summary>
|
||||
/// 物料收发明细-仓储
|
||||
/// </summary>
|
||||
public class InventoryInOutDetailsRepositories: IInventoryInOutDetailsRepositories
|
||||
public class InventoryInOutDetailsRepositories : IAllFielRepositories<InventoryInOutDetailsQueryRequest>, IInventoryInOutDetailsRepositories
|
||||
{
|
||||
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<InventoryInOutDetailsQueryResponse>> GetPagedList(InventoryInOutDetailsQueryRequest dto)
|
||||
public async Task<(List<InventoryInOutDetailsQueryResponse> list, int total)> GetPagedList(InventoryInOutDetailsQueryRequest dto)
|
||||
{
|
||||
//1.获取物料集合和组织集合
|
||||
var materials_result = await _erpService.BillQueryForMaterial();
|
||||
if (!materials_result.IsSuccess)
|
||||
return ResultPagedList<InventoryInOutDetailsQueryResponse>.ReFailure(materials_result);
|
||||
return (new List<InventoryInOutDetailsQueryResponse>(), 0);
|
||||
var materials = materials_result.Data.ToList();
|
||||
|
||||
//物料集合;模糊查询后的物料集合
|
||||
@@ -85,10 +85,8 @@ namespace WMS.Web.Repositories
|
||||
if (dto.CreateEndDate != null)
|
||||
query = query.Where(w => w.CreateTime <= dto.CreateEndDate.Value);
|
||||
|
||||
var response = new ResultPagedList<InventoryInOutDetailsQueryResponse>();
|
||||
|
||||
int total = await query.CountAsync();
|
||||
response.TotalCount = total;
|
||||
|
||||
var list = await query.Select(s => new InventoryInOutDetailsQueryResponse()
|
||||
{
|
||||
Id = s.Id,
|
||||
@@ -104,8 +102,7 @@ namespace WMS.Web.Repositories
|
||||
CreateTime = s.CreateTime
|
||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
response.Data = list;
|
||||
return response;
|
||||
return (list,total);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -137,5 +134,16 @@ namespace WMS.Web.Repositories
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(object obj, int total)> GetListField(InventoryInOutDetailsQueryRequest dto, int companyId)
|
||||
{
|
||||
return await GetPagedList(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user