From 4e1a74943805f29d7108afa9cd4d6cd0ae099959 Mon Sep 17 00:00:00 2001 From: "liulb@mesnac.com" Date: Tue, 23 Apr 2024 20:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=87=8D=E5=A4=8D=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E4=B8=8B=E5=8F=91=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AucamSheetMetalTaskService.cs | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Aucma.Core.SheetMetalTasks/AucamSheetMetalTaskService.cs b/Aucma.Core.SheetMetalTasks/AucamSheetMetalTaskService.cs index a76c564..af5574d 100644 --- a/Aucma.Core.SheetMetalTasks/AucamSheetMetalTaskService.cs +++ b/Aucma.Core.SheetMetalTasks/AucamSheetMetalTaskService.cs @@ -1198,9 +1198,22 @@ namespace Aucma.Core.SheetMetalTasks lastComplateAmount = sidePanelComplates.First().CompleteAmount; sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount; + //判断是否重新下发的计划 + { + + if (sidePanelComplate.OutPutAmount<0)//默认重新开始 + { + sidePanelComplate.CompleteAmount = 0; + sidePanelComplate.OutPutAmount = 0; + sidePanelComplate.OffLineAmount = 0; + _ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result; + continue; + } + } sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount; - // sumComplateAmount = complateAmount; // 改为plc读取的数量 + + // sumComplateAmount = complateAmount; // 改为plc读取的数量 if (sidePanelComplate.OutPutAmount == 0) { Thread.Sleep(5000); @@ -1231,10 +1244,11 @@ namespace Aucma.Core.SheetMetalTasks { planInfo.CompleteAmount = sumComplateAmount; + RefreshExecInfoEvent?.Invoke($"前板计划执行完成,:{planInfo.CompleteAmount}", "White"); var r = _executePlanInfoServices.UpdateAsync(planInfo).Result; - + _ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result; @@ -1472,6 +1486,20 @@ namespace Aucma.Core.SheetMetalTasks lastComplateAmount = backPanelComplates.First().CompleteAmount;//最新的完工数量 backPanelComplate.OutPutAmount = complateAmount - lastComplateAmount;//实际产量 + + //判断是否重新下发的计划 + { + + if (backPanelComplate.OutPutAmount < 0)//默认重新开始 + { + backPanelComplate.CompleteAmount = 0; + backPanelComplate.OutPutAmount = 0; + backPanelComplate.OffLineAmount = 0; + _ = _backPanelComplateServices.InsertBackPanelCimplate(backPanelComplate).Result; + continue; + } + } + sumComplateAmount = backPanelComplates.Sum(x => x.OutPutAmount) + backPanelComplate.OutPutAmount; //计划总产量 //sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;