From a39a1b25569ba70da131800027d7340e66157116 Mon Sep 17 00:00:00 2001
From: 18942506660 <18942506660@A18942506660>
Date: Wed, 6 Dec 2023 16:30:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AE=B1=E5=8F=B7=E8=BF=94?=
=?UTF-8?q?=E5=9B=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml | 5 +++++
src/WMS.Web.Core/Dto/MaterialResponse.cs | 4 ++++
src/WMS.Web.Repositories/SerialNumbersRepositories.cs | 9 ++++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
index e795baae..6a5aa918 100644
--- a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
+++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml
@@ -3531,6 +3531,11 @@
箱Id
+
+
+ 箱号
+
+
仓位Id(序列号不存在库存的话仓位是0)
diff --git a/src/WMS.Web.Core/Dto/MaterialResponse.cs b/src/WMS.Web.Core/Dto/MaterialResponse.cs
index c313ddad..220dd924 100644
--- a/src/WMS.Web.Core/Dto/MaterialResponse.cs
+++ b/src/WMS.Web.Core/Dto/MaterialResponse.cs
@@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto
///
public int BoxId { get; set; } = 0;
///
+ /// 箱号
+ ///
+ public string BoxBillNo { get; set; }
+ ///
/// 仓位Id(序列号不存在库存的话仓位是0)
///
public int SubStockId { get; set; } = 0;
diff --git a/src/WMS.Web.Repositories/SerialNumbersRepositories.cs b/src/WMS.Web.Repositories/SerialNumbersRepositories.cs
index 7a4cb11a..1e02ddb7 100644
--- a/src/WMS.Web.Repositories/SerialNumbersRepositories.cs
+++ b/src/WMS.Web.Repositories/SerialNumbersRepositories.cs
@@ -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);