|
|
|
@ -23,6 +23,9 @@ using log4net;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
using Microsoft.Extensions.FileSystemGlobbing.Internal;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
{
|
|
|
|
@ -52,12 +55,29 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private void InitEveryDayMethodAsync()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ChartValues<double> achievement = new ChartValues<double>();
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
|
MaterialNameList = new List<string>();
|
|
|
|
|
|
|
|
|
|
var info = _doorMateHistoryServices.Query(x => x.ScanTime.ToString("yyyy-MM-dd").Contains(DateTime.Now.ToString("yyyy-MM-dd")));
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
ModelStatistics.Clear();
|
|
|
|
|
|
|
|
|
|
if (info != null)
|
|
|
|
|
{
|
|
|
|
|
var groupResult = from p in info
|
|
|
|
|
group p by p.MaterialName into g
|
|
|
|
|
select new { MaterialName = g.Key, Count = g.Count() };
|
|
|
|
|
foreach (var groupItem in groupResult)
|
|
|
|
|
{
|
|
|
|
|
achievement.Add(random.Next(0, 50));
|
|
|
|
|
achievement.Add(groupItem.Count);
|
|
|
|
|
|
|
|
|
|
MaterialNameList.Add(FormatMaterialType(groupItem.MaterialName));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModelStatistics.Add(new ColumnSeries()
|
|
|
|
|
{
|
|
|
|
|
DataLabels = true,
|
|
|
|
@ -67,12 +87,9 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
Foreground = Brushes.White,
|
|
|
|
|
FontSize = 18
|
|
|
|
|
});
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MaterialNameList = new List<string>()
|
|
|
|
|
{
|
|
|
|
|
"BCD-287CHN",
|
|
|
|
|
"BCD-287CHN"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -190,6 +207,8 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 门体匹配队列
|
|
|
|
|
|
|
|
|
|
private int i = 0;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 门体匹配队列
|
|
|
|
|
/// </summary>
|
|
|
|
@ -216,9 +235,14 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
model.MaterialCode = stationPlan.MaterialCode;
|
|
|
|
|
model.MaterialName = stationPlan.MaterialName;
|
|
|
|
|
model.ScanTime = DateTime.Now;
|
|
|
|
|
planInfoDataGrid.Insert(0, model);
|
|
|
|
|
SaveMateHistory(code,obj, productLineCode, plan, model);
|
|
|
|
|
|
|
|
|
|
model.MaterialName = this.FormatMaterialType(stationPlan.MaterialName);
|
|
|
|
|
model.ObjId = i+1;
|
|
|
|
|
planInfoDataGrid.Insert(0, model);
|
|
|
|
|
|
|
|
|
|
InitEveryDayMethodAsync();//刷新型号统计图表
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 记录历史
|
|
|
|
@ -311,5 +335,28 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 格式化物料类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="materialType"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string FormatMaterialType(string materialType)
|
|
|
|
|
{
|
|
|
|
|
string result = "";
|
|
|
|
|
System.Text.RegularExpressions.Match match = Regex.Match(materialType, @".*?,(.*?),");
|
|
|
|
|
|
|
|
|
|
if (match.Success && match.Groups.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
result = match.Groups[1].Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result = materialType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|