增加箱号返回

This commit is contained in:
18942506660
2023-12-06 16:30:15 +08:00
parent f1dba1cfcc
commit a39a1b2556
3 changed files with 15 additions and 3 deletions

View File

@@ -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);