判断重复重新下发计划

main
liulb@mesnac.com 9 months ago
parent ce3b47230e
commit 4e1a749438

@ -1198,8 +1198,21 @@ 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读取的数量
if (sidePanelComplate.OutPutAmount == 0)
{
@ -1231,6 +1244,7 @@ namespace Aucma.Core.SheetMetalTasks
{
planInfo.CompleteAmount = sumComplateAmount;
RefreshExecInfoEvent?.Invoke($"前板计划执行完成,:{planInfo.CompleteAmount}", "White");
var r = _executePlanInfoServices.UpdateAsync(planInfo).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;

Loading…
Cancel
Save