From 7fea8372dd9624201f23344c5a84370058239b01 Mon Sep 17 00:00:00 2001 From: liuwf Date: Mon, 13 Nov 2023 17:50:16 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/IndexPageViewModel.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs index 445eccff..597f2066 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs @@ -251,7 +251,8 @@ namespace Aucma.Core.ProductOffLine.ViewModels //4.1截取订单号去查询更新BASE_ORDERINFO,全放到service处理 string orderCode = "11215484"; - BaseOrderInfo order = _baseOrderInfoServices.Query(x => x.OrderCode == orderCode).FirstOrDefault(); + List orders = await _baseOrderInfoServices.QueryAsync(x => x.OrderCode == orderCode); + BaseOrderInfo order = orders.FirstOrDefault(); if (order.CompleteAmount == 0) { order.CompleteAmount++; @@ -264,18 +265,19 @@ namespace Aucma.Core.ProductOffLine.ViewModels order.UpdatedTime = DateTime.Now; _baseOrderInfoServices.UpdateAsync(order); //4.2根据订单号去更新PRODUCT_PLANINFO - ProductPlanInfo productIndo =_productPlanInfoServices.Query(x => x.OrderCode == orderCode).FirstOrDefault(); - if (productIndo.CompleteAmount == 0) + List productInfos =await _productPlanInfoServices.QueryAsync(x => x.OrderCode == orderCode); + ProductPlanInfo productInfo = productInfos.FirstOrDefault(); + if (productInfo.CompleteAmount == 0) { - productIndo.CompleteAmount++; - productIndo.BeginTime = DateTime.Now; + productInfo.CompleteAmount++; + productInfo.BeginTime = DateTime.Now; } - if(productIndo.CompleteAmount==productIndo.PlanAmount) + if(productInfo.CompleteAmount==productInfo.PlanAmount) { - productIndo.EndTime = DateTime.Now; + productInfo.EndTime = DateTime.Now; } - productIndo.UpdatedTime = DateTime.Now; - _productPlanInfoServices.UpdateAsync(productIndo); + productInfo.UpdatedTime = DateTime.Now; + await _productPlanInfoServices.UpdateAsync(productInfo); //5.分垛A,B库逻辑(先左边读到的条码分A库,右边读到的B库==>预留分库逻辑)