diff --git a/Admin.Core.Repository/BASE/BaseRepository.cs b/Admin.Core.Repository/BASE/BaseRepository.cs index 0192de86..b19060c2 100644 --- a/Admin.Core.Repository/BASE/BaseRepository.cs +++ b/Admin.Core.Repository/BASE/BaseRepository.cs @@ -60,6 +60,8 @@ namespace Admin.Core.Repository { if (_db.CopyNew().Ado.IsValidConnection()) { + _db.Close(); + _db.Open(); return true; } else diff --git a/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs index d8b0e915..411e44fb 100644 --- a/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/MainWindowViewModel.cs @@ -21,7 +21,13 @@ namespace Aucma.Core.BoxFoam.ViewModels private IndexPageView firstPage = new IndexPageView();//首页 CollectionFoamLine line=new CollectionFoamLine(); CollectionFoamMachine machine = new CollectionFoamMachine(); - + RealTimeInventoryPageView realTimeInventoryPage = new RealTimeInventoryPageView(); + EnterWarehouseStatisticsPageView enterWarehouseStatisticsPage = new EnterWarehouseStatisticsPageView(); + FoamPlanPageView foamPlanPageView = new FoamPlanPageView(); + FoamMonitorPageView foamMonitorPageView = new FoamMonitorPageView(); + MonitorPageView monitorPage = new MonitorPageView();//任务监控 + FoamMachinesPageView foamMachinesPageView = new FoamMachinesPageView(); + public MainWindowViewModel() { UserContent = firstPage; @@ -199,27 +205,27 @@ namespace Aucma.Core.BoxFoam.ViewModels UserContent = firstPage; break; case "RealTimeInventoryPage": - RealTimeInventoryPageView realTimeInventoryPage = new RealTimeInventoryPageView(); + UserContent = realTimeInventoryPage; break; case "StatisticsPage": - EnterWarehouseStatisticsPageView enterWarehouseStatisticsPage = new EnterWarehouseStatisticsPageView(); + UserContent = enterWarehouseStatisticsPage; break; case "MonitorPage": - MonitorPageView monitorPage = new MonitorPageView();//任务监控 + UserContent = monitorPage; break; case "FoamPlanPage": - FoamPlanPageView foamPlanPageView = new FoamPlanPageView(); + UserContent = foamPlanPageView; break; case "FoamMonitorPage": - FoamMonitorPageView foamMonitorPageView = new FoamMonitorPageView(); + UserContent = foamMonitorPageView; break; case "FoamMachinesPage": - FoamMachinesPageView foamMachinesPageView = new FoamMachinesPageView(); + UserContent = foamMachinesPageView; break; default: diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs index 890c269b..05dd5ba9 100644 --- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs @@ -33,6 +33,7 @@ namespace Aucma.Core.SheetMetal.ViewModels protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices; protected readonly IBaseBomInfoServices _baseBomInfoServices; private readonly ISysUserInfoServices _sysUserInfoServices; + private readonly IRecordInStoreServices _recordInstoreServices; private AppConfigHelper appConfig = new AppConfigHelper(); List list = new List() { new SelectModel() { @@ -55,6 +56,7 @@ namespace Aucma.Core.SheetMetal.ViewModels _recordSidePanelComplateServices = App.ServiceProvider.GetService(); _baseBomInfoServices = App.ServiceProvider.GetService(); _sysUserInfoServices = App.ServiceProvider.GetService(); + _recordInstoreServices = App.ServiceProvider.GetService(); //Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod; //Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示 //WeakReferenceMessenger.Default.Register(this, Recive); @@ -63,7 +65,7 @@ namespace Aucma.Core.SheetMetal.ViewModels RefreshHourAmount();//小时产量 RefreshMaterialStats();//型号产量 SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo; - + QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData; } #endregion @@ -192,15 +194,18 @@ namespace Aucma.Core.SheetMetal.ViewModels #region 计划列表 #region 加载DataGrid数据 - private Task LoadData() + private Task LoadData() { string stationCode = Appsettings.app("StationInfo", "StationCode"); - - var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode).Result; + CurrentTeamTimeView view = GetTeamHour(); + + var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode&& x.CreatedTime> view.StartTime && x.CreatedTime d.ExecuteOrder); int i = 1; string planType = string.Empty; + PlanInfoDataGrid.Clear(); foreach (var item in execList) { TaskExecModel task = new TaskExecModel(); diff --git a/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs index 1d49f12b..dcb6c024 100644 --- a/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs @@ -23,6 +23,14 @@ namespace Aucma.Core.SheetMetal.ViewModels { public partial class QuantityIssuedViewModel : ObservableObject { + #region 刷新创建计划 + /// + /// 刷新创建计划 + /// + public delegate Task RefreshCretaePlanInfo(); + public static event RefreshCretaePlanInfo RefreshCretaePlanInfoEvent; + #endregion + private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(QuantityIssuedViewModel)); private IBaseBomInfoServices _bomInfoServices; private IBaseSpaceDetailServices _spaceDetailServices; @@ -34,7 +42,7 @@ namespace Aucma.Core.SheetMetal.ViewModels _bomInfoServices = App.ServiceProvider.GetService(); _spaceDetailServices = App.ServiceProvider.GetService(); _executePlanInfoServices = App.ServiceProvider.GetService(); - + PlanInfo = productPlanInfo; } #endregion @@ -94,7 +102,8 @@ namespace Aucma.Core.SheetMetal.ViewModels if (result > 0) { MessageBox.Show("计划拆分成功!", "系统提醒"); - WeakReferenceMessenger.Default.Send("Refresh");//刷新窗口 + //WeakReferenceMessenger.Default.Send("Refresh");//刷新窗口 + RefreshCretaePlanInfoEvent?.Invoke(); } else { diff --git a/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs index f2e801ee..194f73a5 100644 --- a/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/SplitPlanViewModel.cs @@ -26,7 +26,10 @@ namespace Aucma.Core.SheetMetal.ViewModels { public partial class SplitPlanViewModel : ObservableObject { + + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SplitPlanViewModel)); + protected readonly IProductPlanInfoServices? _productPlanInfoServices; //protected readonly ISmTaskExecutionServices? _smTaskExecutionServices; protected readonly IExecutePlanInfoServices? _executePlanInfoServices; @@ -137,7 +140,8 @@ namespace Aucma.Core.SheetMetal.ViewModels /// /// 创建任务 /// - [RelayCommand] + + private async Task CreateTask(string obj) { if (string.IsNullOrEmpty(obj)) @@ -176,8 +180,7 @@ namespace Aucma.Core.SheetMetal.ViewModels if (result>0) { MessageBox.Show("计划拆分成功!","系统提醒"); - WeakReferenceMessenger.Default.Send("Refresh");//刷新窗口 - CloseWindow(); + //WeakReferenceMessenger.Default.Send("Refresh");//刷新窗口 } else {