增加仓位
This commit is contained in:
@@ -3291,6 +3291,11 @@
|
||||
箱Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialResponse.SubStockId">
|
||||
<summary>
|
||||
仓位Id(序列号不存在库存的话仓位是0)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialResponse.SerialNumber">
|
||||
<summary>
|
||||
序列号
|
||||
|
||||
@@ -12,7 +12,11 @@ namespace WMS.Web.Core.Dto
|
||||
/// <summary>
|
||||
/// 箱Id
|
||||
/// </summary>
|
||||
public int BoxId { get; set; }
|
||||
public int BoxId { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 仓位Id(序列号不存在库存的话仓位是0)
|
||||
/// </summary>
|
||||
public int SubStockId { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 序列号
|
||||
/// </summary>
|
||||
|
||||
@@ -149,14 +149,18 @@ namespace WMS.Web.Repositories
|
||||
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, material.MaterialId);
|
||||
return response;
|
||||
}
|
||||
var entity = await _context.SerialNumbers.FirstOrDefaultAsync(w => serialNumber.Equals(w.SerialNumber));
|
||||
if (entity == null) return null;
|
||||
response.BoxId = entity.BoxId;
|
||||
response.SerialNumber = entity.SerialNumber;
|
||||
response.MaterialId = entity.MaterialId;
|
||||
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.MaterialId);
|
||||
response.MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, entity.MaterialId);
|
||||
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.MaterialId);
|
||||
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 })
|
||||
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
|
||||
if (entity.serial == null) return null;
|
||||
response.BoxId = entity.serial.BoxId;
|
||||
response.SubStockId = entity.box?.SubStockId ?? 0;
|
||||
response.SerialNumber = entity.serial.SerialNumber;
|
||||
response.MaterialId = entity.serial.MaterialId;
|
||||
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialId);
|
||||
response.MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, entity.serial.MaterialId);
|
||||
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.serial.MaterialId);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user