From 2a6f74f00b79c760f6600ce61e012a783471aa4e Mon Sep 17 00:00:00 2001 From: tongfei <244188119@qq.com> Date: Fri, 15 Mar 2024 11:53:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Domain/Services/InStockTaskService.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/WMS.Web.Domain/Services/InStockTaskService.cs b/src/WMS.Web.Domain/Services/InStockTaskService.cs index b13ee9d7..c257ea4c 100644 --- a/src/WMS.Web.Domain/Services/InStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/InStockTaskService.cs @@ -560,13 +560,18 @@ namespace WMS.Web.Domain.Services { MaterialId = x.Key, AccruedQtyTotal = x.Sum(t => t.AccruedQty), - RealityQtyTotal=x.Sum(t=>t.RealityQty) + ReceiveQtyTotal=x.Sum(t=>t.ReceiveQty), + RealityQtyTotal =x.Sum(t=>t.RealityQty) }).ToList(); - - bool IsAny = details_Groups.Any(d => d.AccruedQtyTotal > d.RealityQtyTotal); - if(IsAny) + + bool IsAny = details_Groups.Any(d => d.RealityQtyTotal != 0 && d.AccruedQtyTotal > d.RealityQtyTotal); + if (IsAny) order.Status = InstockStatus.Part; - else + else if (details_Groups.Sum(x => x.ReceiveQtyTotal) <= 0) + order.Status = InstockStatus.Wait; + else if (details_Groups.Sum(x => x.RealityQtyTotal) <= 0) + order.Status = InstockStatus.WaitInStock; + else if(details_Groups.Sum(x => x.RealityQtyTotal) >= details_Groups.Sum(x => x.AccruedQtyTotal)) order.Status = InstockStatus.Already;