增加箱号返回

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

@@ -3531,6 +3531,11 @@
箱Id 箱Id
</summary> </summary>
</member> </member>
<member name="P:WMS.Web.Core.Dto.MaterialResponse.BoxBillNo">
<summary>
箱号
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.MaterialResponse.SubStockId"> <member name="P:WMS.Web.Core.Dto.MaterialResponse.SubStockId">
<summary> <summary>
仓位Id(序列号不存在库存的话仓位是0) 仓位Id(序列号不存在库存的话仓位是0)

View File

@@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto
/// </summary> /// </summary>
public int BoxId { get; set; } = 0; public int BoxId { get; set; } = 0;
/// <summary> /// <summary>
/// 箱号
/// </summary>
public string BoxBillNo { get; set; }
/// <summary>
/// 仓位Id(序列号不存在库存的话仓位是0) /// 仓位Id(序列号不存在库存的话仓位是0)
/// </summary> /// </summary>
public int SubStockId { get; set; } = 0; public int SubStockId { get; set; } = 0;

View File

@@ -200,12 +200,15 @@ namespace WMS.Web.Repositories
return response; return response;
} }
var entity = await _context.SerialNumbers var entity = await _context.SerialNumbers
.GroupJoin(_context.BoxInventory, serial => serial.BoxId, box => box.BoxId, (serial, box) => new { serial, box }) .GroupJoin(_context.BoxInventory, serial => serial.BoxId, boxInventory => boxInventory.BoxId, (serial, boxInventory) => new { serial, boxInventory })
.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, box }) .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)); .FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
if (entity == null || 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.BoxBillNo = entity.box.BoxBillNo;
response.SubStockId = entity.boxInventory?.SubStockId ?? 0;
response.SerialNumber = entity.serial.SerialNumber; response.SerialNumber = entity.serial.SerialNumber;
response.MaterialId = entity.serial.MaterialId; response.MaterialId = entity.serial.MaterialId;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialId); response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialId);