列表物料填充
This commit is contained in:
@@ -25,16 +25,18 @@ namespace WMS.Web.Repositories
|
||||
private readonly RepositoryDbContext _context;
|
||||
private readonly ISingleDataService _singleDataService;
|
||||
private readonly ILoginRepositories _loginRepositories;
|
||||
private readonly IErpService _erpService;
|
||||
|
||||
|
||||
public TakeStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories)
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories, IErpService erpService)
|
||||
{
|
||||
_context = context;
|
||||
_mapper = mapper;
|
||||
_serviceProvider = serviceProvider;
|
||||
_singleDataService = singleDataService;
|
||||
_loginRepositories = loginRepositories;
|
||||
_erpService = erpService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增
|
||||
@@ -157,9 +159,15 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(List<TakeStockQueryInfoResponse> list, int total)> GetListAsync(TakeStockQueryRequest dto)
|
||||
{
|
||||
//1.获取物料集合
|
||||
var materials_result = await _erpService.BillQueryForMaterial();
|
||||
if (!materials_result.IsSuccess)
|
||||
return (new List<TakeStockQueryInfoResponse>(), 0);
|
||||
var materials = materials_result.Data.ToList();
|
||||
|
||||
var query = _context.TakeStock
|
||||
//.GroupJoin(_context.TakeStock, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
//.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
//.GroupJoin(_context.TakeStock, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
//.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.OrderByDescending(o => o.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
@@ -180,7 +188,7 @@ namespace WMS.Web.Repositories
|
||||
#region dto组装
|
||||
Id = s.Id,
|
||||
BillNo = s.BillNo,
|
||||
Unit = "",//物料带出来
|
||||
Unit = materials.FirstOrDefault(f => f.MaterialId == s.MaterialId).BaseUnitName ?? "",
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.StockId),
|
||||
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.SubStockId),
|
||||
BeforeQty = s.BeforeQty,
|
||||
|
||||
Reference in New Issue
Block a user