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; }