修复bug

This commit is contained in:
18942506660
2023-12-09 16:40:47 +08:00
parent a10f588271
commit 4fc45a66a0

View File

@@ -196,7 +196,7 @@ namespace WMS.Web.Repositories
return response;
}
var entity = await _context.SerialNumbers
.GroupJoin(_context.BoxInventory, serial => serial.BoxId, boxInventory => boxInventory.BoxId, (serial, boxInventory) => new { serial, boxInventory })
.GroupJoin(_context.BoxInventory.Include(x=>x.Details), 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 })
@@ -211,7 +211,7 @@ namespace WMS.Web.Repositories
response.MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, entity.serial.MaterialId);
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.serial.MaterialId);
if (entity.boxInventory != null)
response.IsBoxInventory = entity.boxInventory.Details.SelectMany(s => s.SerialNumbers).Any(w => serialNumber.Contains(w));
response.IsBoxInventory = entity.boxInventory.Details.SelectMany(s => s.SerialNumbers).Where(w => serialNumber.Contains(w)).Count() >= 1 ? true : false;
return response;