获取箱库存明细-根据箱号-pad

This commit is contained in:
tongfei
2023-11-13 17:19:14 +08:00
parent 1deb28b28d
commit aee5ba78a2
9 changed files with 156 additions and 1 deletions

View File

@@ -101,6 +101,33 @@ namespace WMS.Web.Repositories
return response;
}
/// <summary>
/// 明细集合-根据箱号
/// </summary>
/// <param name="boxBillNo"></param>
/// <returns></returns>
public async Task<List<BoxInventoryDetailsDto>> GetListDetailsBy(string boxBillNo)
{
var query=_context.BoxInventoryDetails
.GroupJoin(_context.BoxInventory, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
.GroupJoin(_context.Box, p => p.order.BoxId, t => t.Id, (p, ts) => new { p.detail, p.order, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order, box })
.Where(x => 1 == 1 && x.box.BoxBillNo==boxBillNo);
var list = await query.Select(x => new BoxInventoryDetailsDto()
{
DetailsId=x.detail.Id,
BoxId=x.box.Id,
BoxInventoryId=x.order.Id,
MaterialId=x.detail.MaterialId,
Qty=x.detail.Qty,
SerialNumbers=x.detail.SerialNumbers
}).ToListAsync();
return list;
}
/// <summary>
/// 批量添加
/// </summary>

View File

@@ -211,6 +211,9 @@ namespace WMS.Web.Repositories.Configuration
{
ent.ToTable("t_wms_box_inventory_details");
ent.HasKey(x => x.Id);
ent.Property(f => f.SerialNumbers).HasConversion(
v => JsonConvert.SerializeObject(v),
v => JsonConvert.DeserializeObject<List<string>>(v));
});
# endregion