|
|
|
@ -13,6 +13,7 @@ using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
@ -26,15 +27,33 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
{
|
|
|
|
|
protected readonly IBoxFoamPlanServices? _boxFoamPlanServices;
|
|
|
|
|
private readonly ICurrentTeamTimeServices _currentTeamTimeServices;
|
|
|
|
|
public Collection collect= new Collection();
|
|
|
|
|
|
|
|
|
|
private Collection collection = new Collection();
|
|
|
|
|
|
|
|
|
|
public FoamPlanPageViewModel()
|
|
|
|
|
{
|
|
|
|
|
_boxFoamPlanServices = App.ServiceProvider.GetService<IBoxFoamPlanServices>();
|
|
|
|
|
_currentTeamTimeServices = App.ServiceProvider.GetService<ICurrentTeamTimeServices>();
|
|
|
|
|
WeakReferenceMessenger.Default.Register<string>(this, Recive);
|
|
|
|
|
InitData();
|
|
|
|
|
//InitData();
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
InitData();
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(1000 * 5);
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 删除
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除
|
|
|
|
@ -53,17 +72,17 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public async void InitData()
|
|
|
|
|
private void InitData()
|
|
|
|
|
{
|
|
|
|
|
ListItems1.Clear();
|
|
|
|
|
ListItems.Clear();
|
|
|
|
|
int count = 0;
|
|
|
|
|
DateTime now=DateTime.Now;
|
|
|
|
|
CurrentTeamTime time = await _currentTeamTimeServices.FirstAsync(d => d.StartTime <= now && d.EndTime >= now);
|
|
|
|
|
CurrentTeamTime time = _currentTeamTimeServices.FirstAsync(d => d.StartTime <= now && d.EndTime >= now).Result;
|
|
|
|
|
if (time == null) return;
|
|
|
|
|
if (time.TeamName.Equals("早班"))
|
|
|
|
|
{
|
|
|
|
|
List<BoxFoamPlan> list = await _boxFoamPlanServices.QueryAsync(d=>d.ShiftType==1);
|
|
|
|
|
List<BoxFoamPlan> list = _boxFoamPlanServices.QueryAsync(d=>d.ShiftType==1).Result;
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
foreach (BoxFoamPlan item in list)
|
|
|
|
|
{
|
|
|
|
@ -82,7 +101,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
if (time.TeamName.Equals("晚班"))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
List<BoxFoamPlan> list = await _boxFoamPlanServices.QueryAsync(d => d.ShiftType == 1);
|
|
|
|
|
List<BoxFoamPlan> list = _boxFoamPlanServices.QueryAsync(d => d.ShiftType == 1).Result;
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
foreach (BoxFoamPlan item in list)
|
|
|
|
|
{
|
|
|
|
|