|
|
|
@ -125,26 +125,57 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
public async void InitData(object? sender, ElapsedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
List<OldBoxFoamType> list = await _oldBoxFoamTypeServices.QueryAsync();
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
|
|
|
|
|
|
|
|
|
|
if(list != null)
|
|
|
|
|
{
|
|
|
|
|
ListItems.Clear();
|
|
|
|
|
foreach (OldBoxFoamType item in list)
|
|
|
|
|
if(list.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
ListItems.Add(new OldBoxFoamTypeModel()
|
|
|
|
|
{
|
|
|
|
|
ObjId = item.ObjId,
|
|
|
|
|
Local = item.Local,
|
|
|
|
|
Status = item.Storeamount==3?"1":"0",
|
|
|
|
|
Storeamount = item.Storeamount,
|
|
|
|
|
MaterialCode = item.MaterialCode,
|
|
|
|
|
MaterialName = item.MaterialName,
|
|
|
|
|
Boxtype = item.Boxtype,
|
|
|
|
|
list = list.OrderBy(x=>x.ObjId).ToList();
|
|
|
|
|
int totalItems = list.Count;
|
|
|
|
|
int half = totalItems / 2;
|
|
|
|
|
|
|
|
|
|
}); ;
|
|
|
|
|
List<OldBoxFoamType> spaceInfoLeft = list.Take(half).ToList();
|
|
|
|
|
List<OldBoxFoamType> spaceInfoRight = list.Skip(half).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
ListItems.Clear();
|
|
|
|
|
if (spaceInfoLeft == null) return;
|
|
|
|
|
for (int i = 0; i < spaceInfoLeft.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
ListItems.Add(new OldBoxFoamTypeModel()
|
|
|
|
|
{
|
|
|
|
|
SpaceName = $"东线{i + 1}",
|
|
|
|
|
Local = spaceInfoLeft[i].Local,
|
|
|
|
|
Status = spaceInfoLeft[i].Storeamount == 3 ? "1" : "0",
|
|
|
|
|
Storeamount = spaceInfoLeft[i].Storeamount,
|
|
|
|
|
MaterialCode = spaceInfoLeft[i].MaterialCode,
|
|
|
|
|
MaterialName = spaceInfoLeft[i].MaterialName,
|
|
|
|
|
Boxtype = spaceInfoLeft[i].Boxtype,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (spaceInfoRight == null) return;
|
|
|
|
|
for (int i = 0; i < spaceInfoRight.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
ListItems.Add(new OldBoxFoamTypeModel()
|
|
|
|
|
{
|
|
|
|
|
SpaceName = $"西线{i + 1}",
|
|
|
|
|
Local = spaceInfoRight[i].Local,
|
|
|
|
|
Status = spaceInfoRight[i].Storeamount == 3 ? "1" : "0",
|
|
|
|
|
Storeamount = spaceInfoRight[i].Storeamount,
|
|
|
|
|
MaterialCode = spaceInfoRight[i].MaterialCode,
|
|
|
|
|
MaterialName = spaceInfoRight[i].MaterialName,
|
|
|
|
|
Boxtype = spaceInfoRight[i].Boxtype,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 初始化datagrid
|
|
|
|
|