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.提交修改