Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -3531,6 +3531,11 @@
|
||||
箱Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialResponse.BoxBillNo">
|
||||
<summary>
|
||||
箱号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialResponse.SubStockId">
|
||||
<summary>
|
||||
仓位Id(序列号不存在库存的话仓位是0)
|
||||
|
||||
@@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto
|
||||
/// </summary>
|
||||
public int BoxId { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 箱号
|
||||
/// </summary>
|
||||
public string BoxBillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 仓位Id(序列号不存在库存的话仓位是0)
|
||||
/// </summary>
|
||||
public int SubStockId { get; set; } = 0;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user