diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml index e795baae..6a5aa918 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml @@ -3531,6 +3531,11 @@ 箱Id + + + 箱号 + + 仓位Id(序列号不存在库存的话仓位是0) diff --git a/src/WMS.Web.Core/Dto/MaterialResponse.cs b/src/WMS.Web.Core/Dto/MaterialResponse.cs index c313ddad..220dd924 100644 --- a/src/WMS.Web.Core/Dto/MaterialResponse.cs +++ b/src/WMS.Web.Core/Dto/MaterialResponse.cs @@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto /// public int BoxId { get; set; } = 0; /// + /// 箱号 + /// + public string BoxBillNo { get; set; } + /// /// 仓位Id(序列号不存在库存的话仓位是0) /// public int SubStockId { get; set; } = 0; diff --git a/src/WMS.Web.Repositories/SerialNumbersRepositories.cs b/src/WMS.Web.Repositories/SerialNumbersRepositories.cs index 7a4cb11a..1e02ddb7 100644 --- a/src/WMS.Web.Repositories/SerialNumbersRepositories.cs +++ b/src/WMS.Web.Repositories/SerialNumbersRepositories.cs @@ -200,12 +200,15 @@ namespace WMS.Web.Repositories return response; } var entity = await _context.SerialNumbers - .GroupJoin(_context.BoxInventory, serial => serial.BoxId, box => box.BoxId, (serial, box) => new { serial, box }) - .SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, box }) + .GroupJoin(_context.BoxInventory, serial => serial.BoxId, boxInventory => boxInventory.BoxId, (serial, boxInventory) => new { serial, boxInventory }) + .SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory }) + .GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial,s.boxInventory, box }) + .SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial,p.boxInventory, box }) .FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber)); if (entity == null || entity.serial == null) return null; response.BoxId = entity.serial.BoxId; - response.SubStockId = entity.box?.SubStockId ?? 0; + response.BoxBillNo = entity.box.BoxBillNo; + response.SubStockId = entity.boxInventory?.SubStockId ?? 0; response.SerialNumber = entity.serial.SerialNumber; response.MaterialId = entity.serial.MaterialId; response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialId);