From c919b1a94b78eb5ad26707ad27312aa5cefac85b Mon Sep 17 00:00:00 2001
From: 18942506660 <18942506660@A18942506660>
Date: Wed, 22 Nov 2023 11:50:39 +0800
Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=A2=9E=E5=8A=A0=E7=AE=B1?=
=?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E4=BB=93=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs | 5 +++++
src/WMS.Web.Domain/Services/OutStockService.cs | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs b/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
index ff690802..34743998 100644
--- a/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
+++ b/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
@@ -41,6 +41,11 @@ namespace WMS.Web.Core.Dto.OutStock
[Required(ErrorMessage = "箱不能为空")]
public int BoxId { get; set; }
///
+ /// 仓位不能为空
+ ///
+ [Required(ErrorMessage = "箱不能为空")]
+ public int SubStockId { get; set; }
+ ///
/// 序列号集
///
public List SerialNumbers { get; set; } = new List();
diff --git a/src/WMS.Web.Domain/Services/OutStockService.cs b/src/WMS.Web.Domain/Services/OutStockService.cs
index d47bbed5..f6942c4d 100644
--- a/src/WMS.Web.Domain/Services/OutStockService.cs
+++ b/src/WMS.Web.Domain/Services/OutStockService.cs
@@ -115,7 +115,7 @@ namespace WMS.Web.Domain.Services
BoxId = boxId,
InventoryInOutMethod = dto.Method,
StockCode = outStockTask.StockCode,
- SubStockId = 0,// outStockTask.Details.First().SubStockId,
+ SubStockId = dto.Details.FirstOrDefault(f => f.BoxId == boxId)?.SubStockId ?? 0,// outStockTask.Details.First().SubStockId,
Details = inventoryDetail
};
inventoryList.Add(inventory);