|
|
|
@ -7,7 +7,10 @@ using Admin.Core.Tasks;
|
|
|
|
|
using Aucma.Core.DoorFoam.Business;
|
|
|
|
|
using Aucma.Core.DoorFoam.Models;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.IdentityModel.Logging;
|
|
|
|
|
using StackExchange.Profiling.Internal;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
@ -20,6 +23,8 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
public partial class FoamMachinesPageViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
IBoxLastShotRecordServices _boxLastShotRecordServices;
|
|
|
|
|
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(FoamMachinesPageViewModel));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public FoamMachinesPageViewModel()
|
|
|
|
|
{
|
|
|
|
@ -206,16 +211,21 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 加载DataGrid数据
|
|
|
|
|
private async Task LoadData()
|
|
|
|
|
private void LoadData()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var list = _boxLastShotRecordServices.QueryAsync(x => x.CreateTime >= System.DateTime.Now.AddDays(-1)).Result.Take(30).OrderByDescending(d => d.CreateTime);
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
|
|
|
|
|
{
|
|
|
|
|
LastShotRecordDataGrid.Clear();
|
|
|
|
|
|
|
|
|
|
int i = 1;
|
|
|
|
|
var list = await _boxLastShotRecordServices.QueryAsync();
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
list.OrderByDescending(d => d.CreateTime).Take(30);
|
|
|
|
|
// var list = await _boxLastShotRecordServices.QueryAsync();
|
|
|
|
|
|
|
|
|
|
// list.OrderByDescending(d => d.CreateTime).Take(30);
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
string system = string.Empty;
|
|
|
|
@ -244,6 +254,11 @@ namespace Aucma.Core.DoorFoam.ViewModels
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info(ex.Message.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|