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;