|
|
|
@ -37,6 +37,8 @@ using Aucma.Core.ProductOffLine.Models;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using Admin.Core.Model.ViewModels;
|
|
|
|
|
using ChartsByTime = Admin.Core.Model.ViewModels.ChartsByTime;
|
|
|
|
|
using LiveCharts.Defaults;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -52,7 +54,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
// 成品下线操作mes数据
|
|
|
|
|
private readonly IOffLineInfoServices? _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
|
|
|
|
|
|
|
|
|
|
// System.Timers.Timer timer = new System.Timers.Timer(500);//界面刷新定时器
|
|
|
|
|
// System.Timers.Timer timer = new System.Timers.Timer(500);//界面刷新定时器
|
|
|
|
|
private readonly IBaseBomInfoServices? _baseBomInfoServices;
|
|
|
|
|
private OffLineBusiness offLineBusiness = OffLineBusiness.Instance;
|
|
|
|
|
private static double aaa = 100.0;
|
|
|
|
@ -61,22 +63,14 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
{
|
|
|
|
|
OffLineBusiness.RefreshScanMateriaCodeEvent += ModelToPage;
|
|
|
|
|
OffLineBusiness.RefreshChartsEvent += RefreshCharts;
|
|
|
|
|
OffLineQty = "235";
|
|
|
|
|
MainWindowViewModel.RefreshFirstPageChartsEvent += RefreshCharts;
|
|
|
|
|
_offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
|
|
|
|
|
_baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
|
|
|
|
|
InitEveryDayMethod();
|
|
|
|
|
// 刷新界面扫码信息
|
|
|
|
|
// RefreshPageListen();
|
|
|
|
|
LoadData();
|
|
|
|
|
//Task.Run(() =>
|
|
|
|
|
//{
|
|
|
|
|
// Thread.Sleep(5000);
|
|
|
|
|
// InitEveryDayMethod();
|
|
|
|
|
// // Thread.Sleep(5000);
|
|
|
|
|
// // InitEveryDayMethod();
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
// offLineBusiness.test();
|
|
|
|
|
|
|
|
|
|
RefreshCharts();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
@ -84,10 +78,13 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshCharts()
|
|
|
|
|
{
|
|
|
|
|
InitEveryDayMethod();
|
|
|
|
|
AddDataGrid();
|
|
|
|
|
|
|
|
|
|
List<OffLineInfo> list = LoadData();
|
|
|
|
|
// Console.WriteLine("刷新台数:"+list.Count);
|
|
|
|
|
InitEveryDayMethod(list);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 参数定义
|
|
|
|
|
|
|
|
|
@ -204,7 +201,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
OnPropertyChanged(nameof(MsgColor));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +252,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 日产量柱状图X轴日期
|
|
|
|
|
/// </summary>
|
|
|
|
|
private List<string> productionHourList;
|
|
|
|
|
private List<string> productionHourList = new List<string>();
|
|
|
|
|
|
|
|
|
|
public List<string> ProductionHourList
|
|
|
|
|
{
|
|
|
|
@ -293,40 +290,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 界面刷新定时器
|
|
|
|
|
//public void RefreshPageListen()
|
|
|
|
|
//{
|
|
|
|
|
// timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshPage);
|
|
|
|
|
// timer.AutoReset = true;
|
|
|
|
|
// timer.Enabled = true;
|
|
|
|
|
// timer.Start();
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 定时检测两个扫码实体是否需要刷新
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="source"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
//public void RefreshPage(object source, System.Timers.ElapsedEventArgs e)
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag == true)
|
|
|
|
|
// {
|
|
|
|
|
// OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag = false;
|
|
|
|
|
// ModelToPage(OffLineBusiness.TempOffLineInfo1);
|
|
|
|
|
|
|
|
|
|
// LoadData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// else if(OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag == true)
|
|
|
|
|
// {
|
|
|
|
|
// OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag = false;
|
|
|
|
|
// ModelToPage(OffLineBusiness.TempOffLineInfo2);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
public void ModelToPage(TempInfo tempInfo)
|
|
|
|
|
{
|
|
|
|
|
App.Current.Dispatcher.Invoke(() =>
|
|
|
|
@ -338,7 +302,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
OrderQty = tempInfo.OrderQty.ToString();
|
|
|
|
|
ActQty = tempInfo.ActQty.ToString();
|
|
|
|
|
MsgInfo = tempInfo.MsgInfo;
|
|
|
|
|
if (tempInfo.MsgAlarmFlag==null || tempInfo.MsgAlarmFlag==false)
|
|
|
|
|
if (tempInfo.MsgAlarmFlag == null || tempInfo.MsgAlarmFlag == false)
|
|
|
|
|
{
|
|
|
|
|
MsgColor = Brushes.White;
|
|
|
|
|
}
|
|
|
|
@ -352,159 +316,190 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async void InitEveryDayMethod()
|
|
|
|
|
|
|
|
|
|
private async void InitEveryDayMethod(List<OffLineInfo> list)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
Achievement.Clear();
|
|
|
|
|
ProductionHourList = new List<string>();
|
|
|
|
|
// OffLineQty = "232";
|
|
|
|
|
for (int i = 8; i <= 19; i++)
|
|
|
|
|
{
|
|
|
|
|
ProductionHourList.Add(i + ":00");
|
|
|
|
|
}
|
|
|
|
|
//ChartValues<int> achievement2 = new ChartValues<int>();
|
|
|
|
|
//achievement2.Add(74);
|
|
|
|
|
//achievement2.Add(77);
|
|
|
|
|
//achievement2.Add(75);
|
|
|
|
|
//achievement2.Add(6);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//achievement2.Add(0);
|
|
|
|
|
//var column2 = new ColumnSeries();
|
|
|
|
|
//column2.DataLabels = true;
|
|
|
|
|
//column2.Title = "产量";
|
|
|
|
|
//column2.Values = achievement2;
|
|
|
|
|
//column2.Foreground = Brushes.White;
|
|
|
|
|
//Achievement.Add(column2);
|
|
|
|
|
|
|
|
|
|
//MaterialNameList.Add("BCD-162CST,炫金色,A");
|
|
|
|
|
//MaterialNameList.Add("BCD-212CHG,炫金色,A");
|
|
|
|
|
//MaterialNameList.Add("BCD-211CGN,星际灰,A");
|
|
|
|
|
//MaterialNameList.Add("BC/BD-310NF,银河灰,A");
|
|
|
|
|
//MaterialNameList.Add("BC/BD-232WD,银河灰,A");
|
|
|
|
|
//MaterialNameList.Add("BC/BD-145NF,炫金色,ZS,A");
|
|
|
|
|
//ChartValues<int> achievement = new ChartValues<int>();
|
|
|
|
|
//achievement.Add(41);
|
|
|
|
|
//achievement.Add(37);
|
|
|
|
|
//achievement.Add(37);
|
|
|
|
|
//achievement.Add(47);
|
|
|
|
|
//achievement.Add(39);
|
|
|
|
|
//achievement.Add(19);
|
|
|
|
|
//var column = new ColumnSeries();
|
|
|
|
|
//column.DataLabels = true;
|
|
|
|
|
//column.Title = "型号";
|
|
|
|
|
//column.Values = achievement;
|
|
|
|
|
//column.Foreground = Brushes.White;
|
|
|
|
|
|
|
|
|
|
//ModelStatistics.Add(column);
|
|
|
|
|
#region 小时产量统计
|
|
|
|
|
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
|
|
|
|
|
if (listTime == null) return;
|
|
|
|
|
// var aa =_offLineInfoServices.Query(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime<= listTime[11].startTime)
|
|
|
|
|
// List<dynamic> hourAmount = _offLineInfoServices.QueryCharts1("CX_01");
|
|
|
|
|
|
|
|
|
|
List<Admin.Core.Model.ViewModels.ChartsByTime> list = _offLineInfoServices.QueryCharts(listTime[0].startTime, listTime[11].startTime).Result;
|
|
|
|
|
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
List<ChartsByTimeAmount> hourList1 = new List<ChartsByTimeAmount>();
|
|
|
|
|
// 当班下线数量
|
|
|
|
|
int sum = 0;
|
|
|
|
|
foreach (ChartsByTime item in list)
|
|
|
|
|
{
|
|
|
|
|
DateTime date = DateTime.ParseExact(item.date + ":00:00", "yyyy-MM-dd/HH:mm:ss", CultureInfo.InvariantCulture);
|
|
|
|
|
ChartsByTimeAmount hour = new ChartsByTimeAmount();
|
|
|
|
|
hour.ProductCode = item.productLineCode;
|
|
|
|
|
hour.ProductDate = date;
|
|
|
|
|
hour.ProductAmount = item.Amount;
|
|
|
|
|
sum += item.Amount;
|
|
|
|
|
hourList1.Add(hour);
|
|
|
|
|
}
|
|
|
|
|
// 当班下线数量页面赋值
|
|
|
|
|
OffLineQty = sum.ToString();
|
|
|
|
|
if (hourList1 == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var hourList = hourList1.Where(x => x.ProductCode.Equals("CX_02") && x.ProductDate >= listTime[0].startTime && x.ProductDate <= listTime[11].startTime);
|
|
|
|
|
|
|
|
|
|
List<string> xList = new List<string>();
|
|
|
|
|
ChartValues<int> achievement2 = new ChartValues<int>();
|
|
|
|
|
foreach (var item in hourList)
|
|
|
|
|
{
|
|
|
|
|
xList.Add(item.ProductDate.Hour.ToString() + ":00");
|
|
|
|
|
achievement2.Add(item.ProductAmount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var column2 = new ColumnSeries();
|
|
|
|
|
column2.DataLabels = true;
|
|
|
|
|
column2.Title = "产量";
|
|
|
|
|
column2.Values = achievement2;
|
|
|
|
|
column2.Foreground = Brushes.White;
|
|
|
|
|
|
|
|
|
|
// Achievement.Clear();
|
|
|
|
|
//Achievement.Add(column2);
|
|
|
|
|
if (Achievement.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < hourList.Count(); i++)
|
|
|
|
|
{
|
|
|
|
|
Achievement.FirstOrDefault().Values[i] = hourList.ElementAt(i).ProductAmount;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Achievement.Clear();
|
|
|
|
|
Achievement.Add(column2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProductionHourList = xList;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 型号统计
|
|
|
|
|
List<string> nameList = new List<string>();
|
|
|
|
|
ChartValues<int> achievement = new ChartValues<int>();
|
|
|
|
|
var column = new ColumnSeries();
|
|
|
|
|
|
|
|
|
|
List<OffLineInfo> offList = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].startTime).Result;
|
|
|
|
|
var modelList = offList.GroupBy(x => x.ProductModel);
|
|
|
|
|
|
|
|
|
|
foreach (var item in modelList)
|
|
|
|
|
{
|
|
|
|
|
achievement.Add(item.Count());
|
|
|
|
|
nameList.Add(item.Key);
|
|
|
|
|
}
|
|
|
|
|
column.DataLabels = true;
|
|
|
|
|
column.Title = "型号";
|
|
|
|
|
column.Values = achievement;
|
|
|
|
|
column.Foreground = Brushes.White;
|
|
|
|
|
|
|
|
|
|
// x轴
|
|
|
|
|
MaterialNameList = null;
|
|
|
|
|
MaterialNameList = nameList;
|
|
|
|
|
// y轴
|
|
|
|
|
if (ModelStatistics.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < modelList.Count(); i++)
|
|
|
|
|
{
|
|
|
|
|
Achievement.FirstOrDefault().Values[i] = modelList.ElementAt(i).Count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ModelStatistics.Add(column);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
ProductionHourList.Clear();
|
|
|
|
|
Achievement.Clear();
|
|
|
|
|
#region 小时产量统计
|
|
|
|
|
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
|
|
|
|
|
if (listTime == null) return;
|
|
|
|
|
// List<string> xList = new List<string>();
|
|
|
|
|
foreach (WorkTime workTime in listTime)
|
|
|
|
|
{
|
|
|
|
|
// xList.Add(workTime.startTime.Hour.ToString());
|
|
|
|
|
ProductionHourList.Add(workTime.startTime.Hour.ToString());
|
|
|
|
|
}
|
|
|
|
|
// ProductionHourList = xList;
|
|
|
|
|
// y轴
|
|
|
|
|
if (list == null || list.Count <= 0) return;
|
|
|
|
|
var result = list.GroupBy(x => x.ProductScanTime.Hour) // 按照小时进行分组
|
|
|
|
|
.Select(g => new
|
|
|
|
|
{
|
|
|
|
|
Hour = g.Key.ToString(), // 小时
|
|
|
|
|
Count = g.Count() // 统计每个小时的个数
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
ChartValues<ObservablePoint> achievement2 = new ChartValues<ObservablePoint>();
|
|
|
|
|
int i = 0;
|
|
|
|
|
foreach (string item in ProductionHourList)
|
|
|
|
|
{
|
|
|
|
|
var target = result.Where(x => x.Hour == item).FirstOrDefault();
|
|
|
|
|
if (target != null)
|
|
|
|
|
{
|
|
|
|
|
achievement2.Add(new ObservablePoint(i, target.Count));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
achievement2.Add(new ObservablePoint(i, 0));
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var column2 = new ColumnSeries();
|
|
|
|
|
column2.DataLabels = true;
|
|
|
|
|
column2.Title = "产量";
|
|
|
|
|
column2.Values = achievement2;
|
|
|
|
|
column2.Foreground = Brushes.White;
|
|
|
|
|
Achievement.Add(column2);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 型号统计
|
|
|
|
|
List<string> nameList = new List<string>();
|
|
|
|
|
ChartValues<int> achievement = new ChartValues<int>();
|
|
|
|
|
var column = new ColumnSeries();
|
|
|
|
|
|
|
|
|
|
List<OffLineInfo> offList = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].startTime).Result;
|
|
|
|
|
var modelList = offList.GroupBy(x => x.ProductModel);
|
|
|
|
|
|
|
|
|
|
foreach (var item in modelList)
|
|
|
|
|
{
|
|
|
|
|
achievement.Add(item.Count());
|
|
|
|
|
nameList.Add(item.Key);
|
|
|
|
|
}
|
|
|
|
|
column.DataLabels = true;
|
|
|
|
|
column.Title = "型号";
|
|
|
|
|
column.Values = achievement;
|
|
|
|
|
column.Foreground = Brushes.White;
|
|
|
|
|
|
|
|
|
|
// x轴
|
|
|
|
|
MaterialNameList = null;
|
|
|
|
|
MaterialNameList = nameList;
|
|
|
|
|
// y轴
|
|
|
|
|
//if (ModelStatistics.Count > 0)
|
|
|
|
|
//{
|
|
|
|
|
// for (int j = 0; j < modelList.Count(); j++)
|
|
|
|
|
// {
|
|
|
|
|
// Achievement.FirstOrDefault().Values[j] = modelList.ElementAt(j).Count();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
ModelStatistics.Clear();
|
|
|
|
|
ModelStatistics.Add(column);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void InitEveryDayMethod11(List<OffLineInfo> list)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
ProductionHourList.Clear();
|
|
|
|
|
Achievement.Clear();
|
|
|
|
|
#region 小时产量统计
|
|
|
|
|
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
|
|
|
|
|
if (listTime == null) return;
|
|
|
|
|
// List<string> xList = new List<string>();
|
|
|
|
|
foreach (WorkTime workTime in listTime)
|
|
|
|
|
{
|
|
|
|
|
// xList.Add(workTime.startTime.Hour.ToString());
|
|
|
|
|
ProductionHourList.Add(workTime.startTime.Hour.ToString());
|
|
|
|
|
}
|
|
|
|
|
// ProductionHourList = xList;
|
|
|
|
|
// y轴
|
|
|
|
|
if (list == null || list.Count <= 0) return;
|
|
|
|
|
var result = list.GroupBy(x => x.ProductScanTime.Hour) // 按照小时进行分组
|
|
|
|
|
.Select(g => new
|
|
|
|
|
{
|
|
|
|
|
Hour = g.Key.ToString(), // 小时
|
|
|
|
|
Count = g.Count() // 统计每个小时的个数
|
|
|
|
|
}).ToList();
|
|
|
|
|
ChartValues<int> achievement2 = new ChartValues<int>();
|
|
|
|
|
foreach (string item in ProductionHourList)
|
|
|
|
|
{
|
|
|
|
|
var target = result.Where(x => x.Hour == item).FirstOrDefault();
|
|
|
|
|
if (target != null)
|
|
|
|
|
{
|
|
|
|
|
achievement2.Add(target.Count);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
achievement2.Add(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var column2 = new ColumnSeries();
|
|
|
|
|
column2.DataLabels = true;
|
|
|
|
|
column2.Title = "产量";
|
|
|
|
|
column2.Values = achievement2;
|
|
|
|
|
column2.Foreground = Brushes.White;
|
|
|
|
|
Achievement.Add(column2);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 型号统计
|
|
|
|
|
List<string> nameList = new List<string>();
|
|
|
|
|
ChartValues<int> achievement = new ChartValues<int>();
|
|
|
|
|
var column = new ColumnSeries();
|
|
|
|
|
|
|
|
|
|
List<OffLineInfo> offList = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].startTime).Result;
|
|
|
|
|
var modelList = offList.GroupBy(x => x.ProductModel);
|
|
|
|
|
|
|
|
|
|
foreach (var item in modelList)
|
|
|
|
|
{
|
|
|
|
|
achievement.Add(item.Count());
|
|
|
|
|
nameList.Add(item.Key);
|
|
|
|
|
}
|
|
|
|
|
column.DataLabels = true;
|
|
|
|
|
column.Title = "型号";
|
|
|
|
|
column.Values = achievement;
|
|
|
|
|
column.Foreground = Brushes.White;
|
|
|
|
|
|
|
|
|
|
// x轴
|
|
|
|
|
MaterialNameList = null;
|
|
|
|
|
MaterialNameList = nameList;
|
|
|
|
|
// y轴
|
|
|
|
|
if (ModelStatistics.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < modelList.Count(); i++)
|
|
|
|
|
{
|
|
|
|
|
Achievement.FirstOrDefault().Values[i] = modelList.ElementAt(i).Count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ModelStatistics.Add(column);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//private async void InitEveryDayMethod()
|
|
|
|
|
//{
|
|
|
|
@ -553,32 +548,44 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
// };
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
public void LoadData()
|
|
|
|
|
public List<OffLineInfo> LoadData()
|
|
|
|
|
{
|
|
|
|
|
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
|
|
|
|
|
if (listTime == null) return;
|
|
|
|
|
List<OffLineInfo> list = _offLineInfoServices.Query(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].endTime);
|
|
|
|
|
if(list==null || list.Count<=0) return;
|
|
|
|
|
list = list.OrderBy(x=>x.ProductScanTime).ToList();
|
|
|
|
|
// OffLineInfo record = _offLineInfoServices.FirstAsync().Result;
|
|
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
foreach(OffLineInfo record in list)
|
|
|
|
|
|
|
|
|
|
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
|
|
|
|
|
if (listTime == null) return null;
|
|
|
|
|
List<OffLineInfo> list = _offLineInfoServices.Query(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].endTime && x.ProductLineCode == "CX_02");
|
|
|
|
|
OffLineQty = list.Count.ToString();
|
|
|
|
|
if (list == null || list.Count <= 0) return null;
|
|
|
|
|
list = list.OrderBy(x => x.ProductScanTime).ToList();
|
|
|
|
|
// OffLineInfo record = _offLineInfoServices.FirstAsync().Result;
|
|
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
ListItems.Insert(0, new TempInfo()
|
|
|
|
|
ListItems.Clear();
|
|
|
|
|
foreach (OffLineInfo record in list)
|
|
|
|
|
{
|
|
|
|
|
No = ListItems.Count + 1,
|
|
|
|
|
ProductOrderNo = record.ProductOrderNo,
|
|
|
|
|
ProductSNCode = record.ProductSNCode,
|
|
|
|
|
ProductModel = record.ProductModel,
|
|
|
|
|
ProductRemark = record.ProductRemark,
|
|
|
|
|
QualityResult = "成功",
|
|
|
|
|
ProductScanTime = record.ProductScanTime,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
ListItems.Insert(0, new TempInfo()
|
|
|
|
|
{
|
|
|
|
|
No = ListItems.Count + 1,
|
|
|
|
|
ProductOrderNo = record.ProductOrderNo,
|
|
|
|
|
ProductSNCode = record.ProductSNCode,
|
|
|
|
|
ProductModel = record.ProductModel,
|
|
|
|
|
ProductRemark = record.ProductRemark,
|
|
|
|
|
QualityResult = "成功",
|
|
|
|
|
ProductScanTime = record.ProductScanTime,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
log.Error("首页LoadData()方法异常:" + ex.Message.ToString());
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddDataGrid()
|
|
|
|
@ -589,7 +596,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
if (list == null || list.Count <= 0) return;
|
|
|
|
|
OffLineInfo record = list.OrderByDescending(x => x.ProductScanTime).FirstOrDefault();
|
|
|
|
|
//OffLineInfo record = _offLineInfoServices.FirstAsync(x=>x.ProductScanTime).Result;
|
|
|
|
|
if(record.ProductSNCode!= ListItems[0].ProductSNCode && record.ProductSNCode != ListItems[1].ProductSNCode)
|
|
|
|
|
if (record.ProductSNCode != ListItems[0].ProductSNCode && record.ProductSNCode != ListItems[1].ProductSNCode)
|
|
|
|
|
{
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
@ -606,7 +613,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|