修复bug

This commit is contained in:
18942506660
2023-12-04 11:06:22 +08:00
parent a38f2a6ad2
commit 79ea6b5076

View File

@@ -153,7 +153,7 @@ namespace WMS.Web.Repositories
.GroupJoin(_context.BoxInventory, serial => serial.BoxId, box => box.BoxId, (serial, box) => new { serial, box }) .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 }) .SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, box })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber)); .FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
if (entity.serial == null) return null; if (entity == null || entity.serial == null) return null;
response.BoxId = entity.serial.BoxId; response.BoxId = entity.serial.BoxId;
response.SubStockId = entity.box?.SubStockId ?? 0; response.SubStockId = entity.box?.SubStockId ?? 0;
response.SerialNumber = entity.serial.SerialNumber; response.SerialNumber = entity.serial.SerialNumber;