From 3241e4f1a8303247509e86e83a088573cd130041 Mon Sep 17 00:00:00 2001 From: liuwf Date: Tue, 3 Dec 2024 13:44:14 +0800 Subject: [PATCH] =?UTF-8?q?change-=E4=BC=98=E5=8C=96=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Model/dto/MesProductPlanDto.cs | 2 +- .../service/Impl/MesProductPlanServiceImpl.cs | 2 +- SlnMesnac.WPF/Page/ProdMgmtPage.xaml | 2 +- SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs | 9 +++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/SlnMesnac.Model/dto/MesProductPlanDto.cs b/SlnMesnac.Model/dto/MesProductPlanDto.cs index 812d7dc..b1fe153 100644 --- a/SlnMesnac.Model/dto/MesProductPlanDto.cs +++ b/SlnMesnac.Model/dto/MesProductPlanDto.cs @@ -107,7 +107,7 @@ namespace SlnMesnac.Model.dto /// 开始时间 /// [SugarColumn(ColumnName = "real_begin_time")] - public DateTime RealBeginTime { get; set; } + public DateTime? RealBeginTime { get; set; } /// /// 完成时间 diff --git a/SlnMesnac.Repository/service/Impl/MesProductPlanServiceImpl.cs b/SlnMesnac.Repository/service/Impl/MesProductPlanServiceImpl.cs index ee3a9c0..3e6872b 100644 --- a/SlnMesnac.Repository/service/Impl/MesProductPlanServiceImpl.cs +++ b/SlnMesnac.Repository/service/Impl/MesProductPlanServiceImpl.cs @@ -188,7 +188,7 @@ namespace SlnMesnac.Repository.service.Impl PlanCode = plan.PlanCode, MaterialId = plan.MaterialId, PlanAmount = plan.PlanAmount, - CompleteAmount = plan.CompleteAmount, + CompleteAmount = plan.CompleteAmount, PlanBeginTime = plan.PlanBeginTime, PlanEndTime = plan.PlanEndTime, RealBeginTime = plan.RealBeginTime, diff --git a/SlnMesnac.WPF/Page/ProdMgmtPage.xaml b/SlnMesnac.WPF/Page/ProdMgmtPage.xaml index ff75267..fd86bce 100644 --- a/SlnMesnac.WPF/Page/ProdMgmtPage.xaml +++ b/SlnMesnac.WPF/Page/ProdMgmtPage.xaml @@ -239,7 +239,7 @@ - + diff --git a/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs b/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs index 2ee5e8c..7b0baf2 100644 --- a/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/ProdMgmtViewModel.cs @@ -272,7 +272,7 @@ namespace SlnMesnac.WPF.ViewModel OrderCode = prodPlan.OrderCode; PlanCode = prodPlan.PlanCode; ProductModel = prodPlan.MaterialName; - BeginTime = prodPlan.RealBeginTime.ToString("yyyy-MM-dd HH:mm:ss"); + BeginTime = prodPlan.RealBeginTime==null?"": prodPlan.RealBeginTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); PlanAmount = Convert.ToInt32(prodPlan.PlanAmount); ComplateAmout = Convert.ToInt32(prodPlan.CompleteAmount); DiffAmount = Convert.ToInt32(prodPlan.PlanAmount) - Convert.ToInt32(prodPlan.CompleteAmount); @@ -333,11 +333,15 @@ namespace SlnMesnac.WPF.ViewModel } #endregion - + list.OrderByDescending(x => x.PlanStatus); list.ForEach( arg => { + if (arg.RealBeginTime!=null && arg.RealBeginTime.Value.Year<2000) + { + arg.RealBeginTime = null; + } PlanInfoDataGrid.Add(arg); }); @@ -386,6 +390,7 @@ namespace SlnMesnac.WPF.ViewModel if (info != null) { info.PlanStatus = PlanStatusEnum.已开始; + info.RealBeginTime = DateTime.Now; info.PlanBeginTime = DateTime.Now; }