修复bug

This commit is contained in:
18942506660
2024-03-29 15:42:01 +08:00
parent e326bfaf3c
commit 11ce2365c1
2 changed files with 13 additions and 13 deletions

View File

@@ -285,21 +285,21 @@ namespace WMS.Web.Repositories
var materials = materials_result.Data.ToList();
var entity = await _context.SerialNumbers_Ops
.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 })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
if (entity == null || entity.serial == null) return null;
//.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 })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.SerialNumber));
if (entity == null) return null;
response.IsOldOps = true;
response.IsBoxInventory = true;//如果是老ops序列号 默认有库存
response.BoxId = entity.serial.BoxId;
response.BoxBillNo = entity?.box?.BoxBillNo ?? "";
response.SubStockCode = entity?.boxInventory?.SubStockCode ?? "";
response.SerialNumber = entity.serial.SerialNumber;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialNumber);
response.MaterialNumber = entity.serial.MaterialNumber;
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.serial.MaterialNumber);
response.BoxId = 0;
response.BoxBillNo = "";
response.SubStockCode = "";
response.SerialNumber = entity.SerialNumber;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.MaterialNumber);
response.MaterialNumber = entity.MaterialNumber;
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.MaterialNumber);
//if (entity.boxInventory != null)
// response.IsBoxInventory = entity.boxInventory.Details.SelectMany(s => s.SerialNumbers).Where(w => serialNumber.Equals(w)).Count() >= 1 ? true : false;