|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Model.Model_New;
|
|
|
|
|
using Admin.Core.Model.ViewModels;
|
|
|
|
|
using Admin.Core.Service;
|
|
|
|
|
using Aucma.Core.Palletiz.Common;
|
|
|
|
|
using Aucma.Core.Palletiz.Views;
|
|
|
|
@ -10,7 +11,9 @@ using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
@ -37,6 +40,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices;
|
|
|
|
|
private readonly IBaseOrderInfoServices? _baseOrderInfoServices;
|
|
|
|
|
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
|
|
|
|
|
private readonly ICodeBindingRecordServices? _codeBindingRecordServices;
|
|
|
|
|
private readonly IProductOffLineServices _offlineService;
|
|
|
|
|
private string spaceCodes = string.Empty;
|
|
|
|
|
private AppConfigHelper appConfig = new AppConfigHelper();
|
|
|
|
|
|
|
|
|
@ -45,6 +50,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
{
|
|
|
|
|
_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
|
|
|
|
|
_baseOrderInfoServices = App.ServiceProvider.GetService<IBaseOrderInfoServices>();
|
|
|
|
|
_codeBindingRecordServices = App.ServiceProvider.GetService<ICodeBindingRecordServices>();
|
|
|
|
|
_offlineService = App.ServiceProvider.GetService<IProductOffLineServices>();
|
|
|
|
|
//_baseMaterialInfoServices = App.ServiceProvider.GetService<IBaseMaterialInfoServices>();
|
|
|
|
|
SpaceInfo = space;
|
|
|
|
|
|
|
|
|
@ -71,11 +78,17 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
string station = Appsettings.app("StationInfo", "StationCode");
|
|
|
|
|
if (!string.IsNullOrEmpty(selectedOption))
|
|
|
|
|
{
|
|
|
|
|
var infos = await _baseOrderInfoServices.QueryAsync(x => x.MaterialName.Contains(selectedOption));
|
|
|
|
|
List<ProductAllModel> list = _codeBindingRecordServices.GetAllProductModel();
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
list = list.Where(x=>x.ProductName.Contains(selectedOption)).ToList();
|
|
|
|
|
if (list == null || list.Count==0) return;
|
|
|
|
|
}
|
|
|
|
|
// var infos = await _baseOrderInfoServices.QueryAsync(x => x.MaterialName.Contains(selectedOption));
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseOrderInfo info in infos)
|
|
|
|
|
foreach (ProductAllModel info in list)
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
}
|
|
|
|
@ -110,11 +123,14 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
//初始化加载数据
|
|
|
|
|
public async void Load(BaseSpaceInfo space)
|
|
|
|
|
{
|
|
|
|
|
var infos = await _baseOrderInfoServices.QueryAsync(d=>d.CompleteAmount!=d.OrderAmount);
|
|
|
|
|
List<ProductAllModel> list = _codeBindingRecordServices.GetAllProductModel();
|
|
|
|
|
if(list==null || list.Count==0) return;
|
|
|
|
|
list = list.OrderBy(x=>x.ProductMasterModel).ToList();
|
|
|
|
|
// var infos = await _baseOrderInfoServices.QueryAsync(d=>d.CompleteAmount!=d.OrderAmount);
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseOrderInfo info in infos)
|
|
|
|
|
foreach (ProductAllModel info in list)
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
}
|
|
|
|
@ -131,8 +147,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
IsSelectedOptionB = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
planInfo.MaterialCode = space.MaterialType;
|
|
|
|
|
planInfo.MaterialName = space.typeNameA;
|
|
|
|
|
planInfo.ProductCode = space.MaterialType;
|
|
|
|
|
planInfo.ProductModel = space.typeNameA;
|
|
|
|
|
|
|
|
|
|
if (SelectedRotation == null)
|
|
|
|
|
{
|
|
|
|
@ -148,9 +164,9 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化物料信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
private ObservableCollection<BaseOrderInfo> materialDataGrid = new ObservableCollection<BaseOrderInfo>();
|
|
|
|
|
private ObservableCollection<ProductAllModel> materialDataGrid = new ObservableCollection<ProductAllModel>();
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<BaseOrderInfo> MaterialDataGrid
|
|
|
|
|
public ObservableCollection<ProductAllModel> MaterialDataGrid
|
|
|
|
|
{
|
|
|
|
|
get { return materialDataGrid; }
|
|
|
|
|
set => SetProperty(ref materialDataGrid, value);
|
|
|
|
@ -170,8 +186,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化下拉列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
private BaseOrderInfo selectedDataItem;
|
|
|
|
|
public BaseOrderInfo SelectedDataItem
|
|
|
|
|
private ProductAllModel selectedDataItem;
|
|
|
|
|
public ProductAllModel SelectedDataItem
|
|
|
|
|
{
|
|
|
|
|
get { return selectedDataItem; }
|
|
|
|
|
set => SetProperty(ref selectedDataItem, value);
|
|
|
|
@ -191,8 +207,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
if (info != null)
|
|
|
|
|
{
|
|
|
|
|
PlanInfo = info;
|
|
|
|
|
SpaceInfo.MaterialType = info.MaterialCode;
|
|
|
|
|
SpaceInfo.typeNameA = info.MaterialName;
|
|
|
|
|
SpaceInfo.MaterialType = info.ProductCode;
|
|
|
|
|
SpaceInfo.typeNameA = info.ProductModel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -217,8 +233,8 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 计划信息
|
|
|
|
|
private BaseOrderInfo planInfo = new BaseOrderInfo();
|
|
|
|
|
public BaseOrderInfo PlanInfo
|
|
|
|
|
private ProductAllModel planInfo = new ProductAllModel();
|
|
|
|
|
public ProductAllModel PlanInfo
|
|
|
|
|
{
|
|
|
|
|
get { return planInfo; }
|
|
|
|
|
set => SetProperty(ref planInfo, value);
|
|
|
|
@ -433,11 +449,18 @@ namespace Aucma.Core.Palletiz.ViewModels
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(searchText))
|
|
|
|
|
{
|
|
|
|
|
var infos = await _baseOrderInfoServices.QueryAsync(x => (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText)));
|
|
|
|
|
List<ProductAllModel> list = _codeBindingRecordServices.GetAllProductModel();
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
list = list.Where(x => x.ProductName.Contains(searchText)).ToList();
|
|
|
|
|
if (list == null || list.Count == 0) return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// var infos = await _baseOrderInfoServices.QueryAsync(x => (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText)));
|
|
|
|
|
MaterialDataGrid.Clear();
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (BaseOrderInfo info in infos)
|
|
|
|
|
foreach (ProductAllModel info in list)
|
|
|
|
|
{
|
|
|
|
|
MaterialDataGrid.Add(info);
|
|
|
|
|
}
|
|
|
|
|