liuwf 1 year ago
commit 77fa41eba6

@ -60,6 +60,8 @@ namespace Admin.Core.Repository
{ {
if (_db.CopyNew().Ado.IsValidConnection()) if (_db.CopyNew().Ado.IsValidConnection())
{ {
_db.Close();
_db.Open();
return true; return true;
} }
else else

@ -21,7 +21,13 @@ namespace Aucma.Core.BoxFoam.ViewModels
private IndexPageView firstPage = new IndexPageView();//首页 private IndexPageView firstPage = new IndexPageView();//首页
CollectionFoamLine line=new CollectionFoamLine(); CollectionFoamLine line=new CollectionFoamLine();
CollectionFoamMachine machine = new CollectionFoamMachine(); 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() public MainWindowViewModel()
{ {
UserContent = firstPage; UserContent = firstPage;
@ -199,27 +205,27 @@ namespace Aucma.Core.BoxFoam.ViewModels
UserContent = firstPage; UserContent = firstPage;
break; break;
case "RealTimeInventoryPage": case "RealTimeInventoryPage":
RealTimeInventoryPageView realTimeInventoryPage = new RealTimeInventoryPageView();
UserContent = realTimeInventoryPage; UserContent = realTimeInventoryPage;
break; break;
case "StatisticsPage": case "StatisticsPage":
EnterWarehouseStatisticsPageView enterWarehouseStatisticsPage = new EnterWarehouseStatisticsPageView();
UserContent = enterWarehouseStatisticsPage; UserContent = enterWarehouseStatisticsPage;
break; break;
case "MonitorPage": case "MonitorPage":
MonitorPageView monitorPage = new MonitorPageView();//任务监控
UserContent = monitorPage; UserContent = monitorPage;
break; break;
case "FoamPlanPage": case "FoamPlanPage":
FoamPlanPageView foamPlanPageView = new FoamPlanPageView();
UserContent = foamPlanPageView; UserContent = foamPlanPageView;
break; break;
case "FoamMonitorPage": case "FoamMonitorPage":
FoamMonitorPageView foamMonitorPageView = new FoamMonitorPageView();
UserContent = foamMonitorPageView; UserContent = foamMonitorPageView;
break; break;
case "FoamMachinesPage": case "FoamMachinesPage":
FoamMachinesPageView foamMachinesPageView = new FoamMachinesPageView();
UserContent = foamMachinesPageView; UserContent = foamMachinesPageView;
break; break;
default: default:

@ -33,6 +33,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices; protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices;
protected readonly IBaseBomInfoServices _baseBomInfoServices; protected readonly IBaseBomInfoServices _baseBomInfoServices;
private readonly ISysUserInfoServices _sysUserInfoServices; private readonly ISysUserInfoServices _sysUserInfoServices;
private readonly IRecordInStoreServices _recordInstoreServices;
private AppConfigHelper appConfig = new AppConfigHelper(); private AppConfigHelper appConfig = new AppConfigHelper();
List<SelectModel> list = new List<SelectModel>() { new SelectModel() List<SelectModel> list = new List<SelectModel>() { new SelectModel()
{ {
@ -55,6 +56,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
_recordSidePanelComplateServices = App.ServiceProvider.GetService<IRecordSidePanelComplateServices>(); _recordSidePanelComplateServices = App.ServiceProvider.GetService<IRecordSidePanelComplateServices>();
_baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>(); _baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>(); _sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
_recordInstoreServices = App.ServiceProvider.GetService<IRecordInStoreServices>();
//Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod; //Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
//Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示 //Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示
//WeakReferenceMessenger.Default.Register<string>(this, Recive); //WeakReferenceMessenger.Default.Register<string>(this, Recive);
@ -63,7 +65,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
RefreshHourAmount();//小时产量 RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量 RefreshMaterialStats();//型号产量
SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo; SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData;
} }
#endregion #endregion
@ -192,15 +194,18 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 计划列表 #region 计划列表
#region 加载DataGrid数据 #region 加载DataGrid数据
private Task LoadData() private Task LoadData()
{ {
string stationCode = Appsettings.app("StationInfo", "StationCode"); string stationCode = Appsettings.app("StationInfo", "StationCode");
CurrentTeamTimeView view = GetTeamHour();
var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode).Result;
var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode&& x.CreatedTime> view.StartTime && x.CreatedTime <view.EndTime).Result;
if (list == null) return Task.CompletedTask; if (list == null) return Task.CompletedTask;
var execList = list.OrderByDescending(d => d.ExecuteOrder); var execList = list.OrderByDescending(d => d.ExecuteOrder);
int i = 1; int i = 1;
string planType = string.Empty; string planType = string.Empty;
PlanInfoDataGrid.Clear();
foreach (var item in execList) foreach (var item in execList)
{ {
TaskExecModel task = new TaskExecModel(); TaskExecModel task = new TaskExecModel();

@ -23,6 +23,14 @@ namespace Aucma.Core.SheetMetal.ViewModels
{ {
public partial class QuantityIssuedViewModel : ObservableObject public partial class QuantityIssuedViewModel : ObservableObject
{ {
#region 刷新创建计划
/// <summary>
/// 刷新创建计划
/// </summary>
public delegate Task RefreshCretaePlanInfo();
public static event RefreshCretaePlanInfo RefreshCretaePlanInfoEvent;
#endregion
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(QuantityIssuedViewModel)); private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(QuantityIssuedViewModel));
private IBaseBomInfoServices _bomInfoServices; private IBaseBomInfoServices _bomInfoServices;
private IBaseSpaceDetailServices _spaceDetailServices; private IBaseSpaceDetailServices _spaceDetailServices;
@ -34,7 +42,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
_bomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>(); _bomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_spaceDetailServices = App.ServiceProvider.GetService<IBaseSpaceDetailServices>(); _spaceDetailServices = App.ServiceProvider.GetService<IBaseSpaceDetailServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>(); _executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
PlanInfo = productPlanInfo; PlanInfo = productPlanInfo;
} }
#endregion #endregion
@ -94,7 +102,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
if (result > 0) if (result > 0)
{ {
MessageBox.Show("计划拆分成功!", "系统提醒"); MessageBox.Show("计划拆分成功!", "系统提醒");
WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口 //WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口
RefreshCretaePlanInfoEvent?.Invoke();
} }
else else
{ {

@ -26,7 +26,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
{ {
public partial class SplitPlanViewModel : ObservableObject public partial class SplitPlanViewModel : ObservableObject
{ {
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SplitPlanViewModel)); private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SplitPlanViewModel));
protected readonly IProductPlanInfoServices? _productPlanInfoServices; protected readonly IProductPlanInfoServices? _productPlanInfoServices;
//protected readonly ISmTaskExecutionServices? _smTaskExecutionServices; //protected readonly ISmTaskExecutionServices? _smTaskExecutionServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices; protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
@ -137,7 +140,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// <summary> /// <summary>
/// 创建任务 /// 创建任务
/// </summary> /// </summary>
[RelayCommand]
private async Task CreateTask(string obj) private async Task CreateTask(string obj)
{ {
if (string.IsNullOrEmpty(obj)) if (string.IsNullOrEmpty(obj))
@ -176,8 +180,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
if (result>0) if (result>0)
{ {
MessageBox.Show("计划拆分成功!","系统提醒"); MessageBox.Show("计划拆分成功!","系统提醒");
WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口 //WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口
CloseWindow();
} }
else else
{ {

Loading…
Cancel
Save