liuwf 1 year ago
parent 886b7785d6
commit 771cf621f8

@ -70,8 +70,14 @@ namespace Aucma.Core.BoxFoam.ViewModels
/// <returns></returns>
private Task InitEveryDayMethod()
{
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
ModelStatistics.Clear();
ProductionHourList = new List<string>();
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
ProductionHourList.Clear();
foreach (WorkTime time in listTime)
{
ProductionHourList.Add(time.hourTime);
@ -99,7 +105,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
column.Title = "当日小时产量统计";
column.Values = achievement;
column.Foreground = Brushes.White;
Achievement.Clear();
Achievement.Add(column);
#endregion
@ -109,10 +115,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
#region 按类型统计
MaterialNameList = new List<string>();
ChartValues<int> achievement2 = new ChartValues<int>();
//foreach(BoxFoamData space in list)
//{
// MaterialNameList.Add(space.Fixtureboxtype);
//}
MaterialNameList.Clear();
var grouped = list.GroupBy(x => x.Fixtureboxtype);
foreach (var item in grouped)
{
@ -126,11 +129,14 @@ namespace Aucma.Core.BoxFoam.ViewModels
column2.Title = "当日型号产量统计";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
ModelStatistics.Clear();
ModelStatistics.Add(column2);
#endregion
}));
//await InitExecMethod();
return Task.CompletedTask;
@ -335,7 +341,8 @@ namespace Aucma.Core.BoxFoam.ViewModels
public async void RealTimeFoamingTask(object? sender, ElapsedEventArgs e)
{
semaphore.WaitOne();
//刷新统计图表
InitEveryDayMethod();
try
{
string productLineCode = Appsettings.app("StationInfo", "ProductLineCode");

Loading…
Cancel
Save