From 6599168e1059dbfb42cc1d3efaaa2157557f5099 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 9 Jan 2024 15:37:28 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=80=81=E5=8F=91=E6=B3=A1?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E8=A1=A8=E5=88=B7=E6=96=B0=E9=97=AA=E7=83=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/RealRoadPageViewModel.cs | 39 ++++++++++++++++--- .../Views/RealRoadPageView.xaml | 15 ++++--- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Aucma.Core.OldBoxFoam/ViewModels/RealRoadPageViewModel.cs b/Aucma.Core.OldBoxFoam/ViewModels/RealRoadPageViewModel.cs index 3b743d81..42f026cd 100644 --- a/Aucma.Core.OldBoxFoam/ViewModels/RealRoadPageViewModel.cs +++ b/Aucma.Core.OldBoxFoam/ViewModels/RealRoadPageViewModel.cs @@ -217,9 +217,11 @@ namespace Aucma.Core.OldBoxFoam.ViewModels var hourFoamDataList = _boxFoamDataServices.Query(x=>x.ProductLineCode == "CX_01" && x.StationCode == "1105"); - if(hourFoamDataList != null) + List hours = new List(); + + if (hourFoamDataList != null) { - HourAchievement.Clear(); + hourAchievement.Add(hourFoamDataList.Sum(x => x.AnHour)); hourAchievement.Add(hourFoamDataList.Sum(x => x.TwoHour)); hourAchievement.Add(hourFoamDataList.Sum(x => x.ThreeHour)); @@ -233,11 +235,27 @@ namespace Aucma.Core.OldBoxFoam.ViewModels hourAchievement.Add(hourFoamDataList.Sum(x => x.ElevenHour)); hourAchievement.Add(hourFoamDataList.Sum(x => x.TwelveHour)); } + + + var shellColumn = new ColumnSeries(); shellColumn.DataLabels = true; shellColumn.Title = "小时产量"; shellColumn.Values = hourAchievement; - HourAchievement.Add(shellColumn); + + + if(HourAchievement.Count > 0) + { + for (int i = 0; i < hourAchievement.Count; i++) + { + //hours + HourAchievement.FirstOrDefault().Values[i] = hourAchievement.ElementAt(i); + } + } + else + { + HourAchievement.Add(shellColumn); + } })); } @@ -258,8 +276,6 @@ namespace Aucma.Core.OldBoxFoam.ViewModels if (hourFoamDataList != null) { - MaterialTypeAchievement.Clear(); - var grouped = hourFoamDataList.GroupBy(x => x.Fixtureboxtype); foreach (var item in grouped) { @@ -273,7 +289,18 @@ namespace Aucma.Core.OldBoxFoam.ViewModels shellColumn.DataLabels = true; shellColumn.Title = "型号统计"; shellColumn.Values = materialTypeAchievement; - MaterialTypeAchievement.Add(shellColumn); + + if (MaterialTypeAchievement.Count > 0) + { + for (int i = 0; i < materialTypeAchievement.Count; i++) + { + MaterialTypeAchievement.FirstOrDefault().Values[i] = materialTypeAchievement.ElementAt(i); + } + } + else + { + MaterialTypeAchievement.Add(shellColumn); + } })); } diff --git a/Aucma.Core.OldBoxFoam/Views/RealRoadPageView.xaml b/Aucma.Core.OldBoxFoam/Views/RealRoadPageView.xaml index 426d9ea1..13a5726d 100644 --- a/Aucma.Core.OldBoxFoam/Views/RealRoadPageView.xaml +++ b/Aucma.Core.OldBoxFoam/Views/RealRoadPageView.xaml @@ -166,12 +166,11 @@ - - + - + @@ -179,7 +178,7 @@ - + @@ -199,11 +198,11 @@ - - + + - + @@ -211,7 +210,7 @@ - +