From ce02c0e4b342d5d1e96bdfb658e84bf168a6a221 Mon Sep 17 00:00:00 2001 From: liuwf Date: Sat, 11 May 2024 10:58:09 +0800 Subject: [PATCH] =?UTF-8?q?change-=E4=BC=98=E5=8C=96=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/IndexPageViewModel.cs | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 按类型统计