From 89116e663e7ea6a212f4aaa165eb5c5cd9e63b33 Mon Sep 17 00:00:00 2001 From: 18942506660 <18942506660@A18942506660> Date: Mon, 4 Dec 2023 17:05:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Domain/Entitys/OutStockTask.cs | 12 ++++++++++-- src/WMS.Web.Domain/Services/OutStockTaskService.cs | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/WMS.Web.Domain/Entitys/OutStockTask.cs b/src/WMS.Web.Domain/Entitys/OutStockTask.cs index a8af4f89..62157118 100644 --- a/src/WMS.Web.Domain/Entitys/OutStockTask.cs +++ b/src/WMS.Web.Domain/Entitys/OutStockTask.cs @@ -131,13 +131,21 @@ namespace WMS.Web.Domain.Entitys detail.RealityQty = detail.RealityQty + qty; + GenerateStatus(); + + return Result>.ReSuccess(resList); + } + /// + /// 自动验证出库状态 + /// + public void GenerateStatus() + { if (this.Details.Where(w => w.RealityQty >= w.AccruedQty).Count() == this.Details.Count()) this.Status = OutStockStatus.Already; else this.Status = OutStockStatus.Part; - - return Result>.ReSuccess(resList); } + /// /// 生成单据号 /// diff --git a/src/WMS.Web.Domain/Services/OutStockTaskService.cs b/src/WMS.Web.Domain/Services/OutStockTaskService.cs index 897c009b..1d8f46e1 100644 --- a/src/WMS.Web.Domain/Services/OutStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/OutStockTaskService.cs @@ -137,7 +137,8 @@ namespace WMS.Web.Domain.Services //操作完后剔除 erp_removeList.Add(erp); } - + //执行完后重新计算一下状态 + outStockTask.GenerateStatus(); } } //2.2.提交修改