From da98c72771e6e236b992d6dcee54f9e7af68350d Mon Sep 17 00:00:00 2001 From: liuwf Date: Thu, 12 Sep 2024 18:09:07 +0800 Subject: [PATCH] =?UTF-8?q?change-=E6=9C=89=E4=BB=BB=E5=8A=A1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E5=88=87=E6=8D=A2=E4=BB=BB=E5=8A=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Business/ProdMgmtBusiness.cs | 1 + SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs | 1 - SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/SlnMesnac.Business/ProdMgmtBusiness.cs b/SlnMesnac.Business/ProdMgmtBusiness.cs index e1e8e6c..f3ba5ea 100644 --- a/SlnMesnac.Business/ProdMgmtBusiness.cs +++ b/SlnMesnac.Business/ProdMgmtBusiness.cs @@ -186,6 +186,7 @@ namespace SlnMesnac.Business /// private void ProdPlanExecHandle() { + RefreshMesProdList(); //每5秒执行一次,获取是否有已开始的计划,获取已开始的计划下发给WCS进行叫料,获取货架到位信息进行投料校验,持续获取设备要料信号 while (true) { diff --git a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs index 68f5545..8f5c31c 100644 --- a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs +++ b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs @@ -166,7 +166,6 @@ namespace SlnMesnac.WPF.Page //报警采集 machineStatusDtos.ForEach(x => MachineWarnCollection(x)); - realtimeStatusList.ForEach(x => x.UpdateTime = DateTime.Now); dmsRealtimeStatusService.Update(realtimeStatusList); diff --git a/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs b/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs index a4cd616..0aabc31 100644 --- a/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs @@ -273,6 +273,21 @@ namespace SlnMesnac.WPF.ViewModel { try { + //先检查是否有正在执行的计划 + var hasPlan = planInfoDataGrid.Where(x=>x.PlanStatus== PlanStatusEnum.已开始).FirstOrDefault(); + if(hasPlan != null) + { + var result = MessageBox.Show("有正在执行的计划,是否确认切换计划!","确认", MessageBoxButton.YesNo); + if(result == MessageBoxResult.Yes) + { + hasPlan.PlanStatus = PlanStatusEnum.待执行; + _prodMgmtBusiness.UpdateProdPlan(hasPlan); + } + else + { + return; + } + } _logger.LogInformation($"开始执行{obj}计划"); var info = planInfoDataGrid.Where(x => x.PlanCode == obj).First(); if (info != null)