diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs index 0e0f761..2f3d542 100644 --- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs @@ -107,8 +107,10 @@ namespace Aucma.Core.SheetMetal.ViewModels #region 更新前端数据 public Task RefreshChat() { - RefreshHourAmountChart();//小时产量 - RefreshMaterialChart();//型号产量 + RefreshHourAmount();//小时产量 + RefreshMaterialStats();//型号产量 + // RefreshHourAmountChart();//小时产量 + // RefreshMaterialChart();//型号产量 return Task.CompletedTask; } #endregion @@ -953,11 +955,13 @@ namespace Aucma.Core.SheetMetal.ViewModels /// private void RefreshHourAmount() { + //获取小时产量 + string stationCode = Appsettings.app("StationInfo", "StationCode"); + var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result; App.Current.Dispatcher.Invoke((Action)(() => { - //获取小时产量 - string stationCode = Appsettings.app("StationInfo", "StationCode"); - var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result; + + if (hourAmount != null) { if (Achievement.Count != 0) Achievement.Clear(); @@ -1010,11 +1014,12 @@ namespace Aucma.Core.SheetMetal.ViewModels /// private void RefreshHourAmountChart() { + //获取小时产量 + string stationCode = Appsettings.app("StationInfo", "StationCode"); + var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result; App.Current.Dispatcher.Invoke((Action)(() => { - //获取小时产量 - string stationCode = Appsettings.app("StationInfo", "StationCode"); - var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result; + if (hourAmount != null) { int hour = 0; @@ -1039,11 +1044,12 @@ namespace Aucma.Core.SheetMetal.ViewModels /// private void RefreshMaterialStats() { + //获取物料型号统计 + string stationCode = Appsettings.app("StationInfo", "StationCode"); + var sheetMetalTypeList = _sysUserInfoServices.GetSheetMetalTypeData(stationCode).Result; App.Current.Dispatcher.Invoke((Action)(() => { - //获取物料型号统计 - string stationCode = Appsettings.app("StationInfo", "StationCode"); - var sheetMetalTypeList = _sysUserInfoServices.GetSheetMetalTypeData(stationCode).Result; + if (sheetMetalTypeList != null) { #region 按类型统计