diff --git a/SlnMesnac.Business/business/InStoreBusiness.cs b/SlnMesnac.Business/business/InStoreBusiness.cs
index fd3e643..70b5614 100644
--- a/SlnMesnac.Business/business/InStoreBusiness.cs
+++ b/SlnMesnac.Business/business/InStoreBusiness.cs
@@ -328,5 +328,17 @@ namespace SlnMesnac.Business.business
{
_logger.LogError($"客户端:{client};读取失败!!!!!!");
}
+
+ ///
+ /// 获取成品库指定区域的货道信息
+ ///
+ ///
+ ///
+ public List GetBaseSpaceinfos(string spaceArea)
+ {
+ _spaceinfoService.GetSpaceInfosByExpression(out List spaceinfos,x=>x.StoreCode == _appConfig.storeCode && x.SpaceArea == spaceArea);
+
+ return spaceinfos;
+ }
}
}
\ No newline at end of file
diff --git a/SlnMesnac.Model/domain/BaseSpaceinfo.cs b/SlnMesnac.Model/domain/BaseSpaceinfo.cs
index 5631990..72bfc6a 100644
--- a/SlnMesnac.Model/domain/BaseSpaceinfo.cs
+++ b/SlnMesnac.Model/domain/BaseSpaceinfo.cs
@@ -13,7 +13,7 @@ namespace SlnMesnac.Model.domain
/// 主键标识
///
[SugarColumn(ColumnName="OBJ_ID" ,IsPrimaryKey = true )]
- public decimal ObjId { get; set; }
+ public int ObjId { get; set; }
///
/// 货道编号
///
diff --git a/SlnMesnac.WPF/MainWindow.xaml b/SlnMesnac.WPF/MainWindow.xaml
index 6c6a0a4..d1836f0 100644
--- a/SlnMesnac.WPF/MainWindow.xaml
+++ b/SlnMesnac.WPF/MainWindow.xaml
@@ -188,7 +188,7 @@
-
+
@@ -219,7 +219,7 @@
-
+
diff --git a/SlnMesnac.WPF/Page/IndexControl.xaml b/SlnMesnac.WPF/Page/IndexControl.xaml
new file mode 100644
index 0000000..979cff4
--- /dev/null
+++ b/SlnMesnac.WPF/Page/IndexControl.xaml
@@ -0,0 +1,264 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.WPF/Page/IndexControl.xaml.cs b/SlnMesnac.WPF/Page/IndexControl.xaml.cs
new file mode 100644
index 0000000..3f10d0f
--- /dev/null
+++ b/SlnMesnac.WPF/Page/IndexControl.xaml.cs
@@ -0,0 +1,31 @@
+using SlnMesnac.WPF.ViewModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SlnMesnac.WPF.Page
+{
+ ///
+ /// IndexControl.xaml 的交互逻辑
+ ///
+ public partial class IndexControl : UserControl
+ {
+ public IndexControl()
+ {
+ InitializeComponent();
+ //CreateDynamicBorders();
+ this.DataContext = new IndexControlViewModel();
+ }
+ }
+}
diff --git a/SlnMesnac.WPF/SlnMesnac.WPF.csproj b/SlnMesnac.WPF/SlnMesnac.WPF.csproj
index c9a9913..9ac895e 100644
--- a/SlnMesnac.WPF/SlnMesnac.WPF.csproj
+++ b/SlnMesnac.WPF/SlnMesnac.WPF.csproj
@@ -33,7 +33,6 @@
-
diff --git a/SlnMesnac.WPF/ViewModel/IndexControlViewModel.cs b/SlnMesnac.WPF/ViewModel/IndexControlViewModel.cs
new file mode 100644
index 0000000..2527f3a
--- /dev/null
+++ b/SlnMesnac.WPF/ViewModel/IndexControlViewModel.cs
@@ -0,0 +1,113 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Command;
+using Microsoft.Extensions.DependencyInjection;
+using SlnMesnac.Business.business;
+using SlnMesnac.Config;
+using SlnMesnac.Model.domain;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SlnMesnac.WPF.ViewModel
+{
+ internal class IndexControlViewModel : ViewModelBase
+ {
+ private InStoreBusiness inStoreBusiness;
+
+ public IndexControlViewModel()
+ {
+ this.inStoreBusiness = App.ServiceProvider.GetService();
+
+ UpdateInStoreFlagCommand = new RelayCommand(obj =>
+ {
+ Console.WriteLine($"{obj};设置");
+ });
+
+
+ this.Init();
+ InStoreAmount = inStoreAmount + "19";
+ }
+
+ #region 参数定义
+
+ public string inStoreAmount = "入库数量:";
+ public string InStoreAmount
+ {
+ get { return this.inStoreAmount; }
+ set
+ {
+ inStoreAmount = value;
+ RaisePropertyChanged(nameof(InStoreAmount));
+ }
+ }
+
+ ///
+ /// A区域货道集合
+ ///
+ public ObservableCollection _areaA_SpaceInfo;
+
+ public ObservableCollection AreaA_SpaceInfo
+ {
+ get { return _areaA_SpaceInfo; }
+ set { _areaA_SpaceInfo = value; RaisePropertyChanged(nameof(AreaA_SpaceInfo)); }
+ }
+
+ ///
+ /// B区域货道集合
+ ///
+ public ObservableCollection _areaB_SpaceInfo;
+
+ public ObservableCollection AreaB_SpaceInfo
+ {
+ get { return _areaB_SpaceInfo; }
+ set { _areaB_SpaceInfo = value; RaisePropertyChanged(nameof(AreaB_SpaceInfo)); }
+ }
+ #endregion
+
+ public RelayCommand UpdateInStoreFlagCommand { get; set; }
+
+ private ObservableCollection spaceItems = new ObservableCollection();
+ private void Init()
+ {
+
+
+ App.Current.Dispatcher.BeginInvoke((Action)(() =>
+ {
+ var info = inStoreBusiness.GetBaseSpaceinfos("A");
+ if (info != null)
+ {
+ if (spaceItems.Count > 0)
+ {
+ spaceItems.Clear();
+ }
+ info = info.OrderByDescending(x=>x.SpaceName).ToList();
+ foreach (var item in info)
+ {
+ spaceItems.Add(item);
+ }
+ AreaA_SpaceInfo = spaceItems;
+ }
+ }));
+ App.Current.Dispatcher.BeginInvoke((Action)(() =>
+ {
+ var info = inStoreBusiness.GetBaseSpaceinfos("A");
+ if (info != null)
+ {
+ if (spaceItems.Count > 0)
+ {
+ spaceItems.Clear();
+ }
+ info = info.OrderByDescending(x => x.SpaceName).ToList();
+ foreach (var item in info)
+ {
+ spaceItems.Add(item);
+ }
+ AreaB_SpaceInfo = spaceItems;
+ }
+ }));
+ }
+ }
+}
diff --git a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs
index 9b71883..abb8f94 100644
--- a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs
+++ b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs
@@ -15,12 +15,16 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using SlnMesnac.Rfid;
+using SlnMesnac.WPF.Page;
namespace SlnMesnac.WPF.ViewModel
{
public class MainWindowViewModel: ViewModelBase
{
private readonly ILogger _logger;
+
+ private IndexControl indexControl = new IndexControl();
+
#region 参数定义
///
/// PLC设备状态
@@ -90,6 +94,8 @@ namespace SlnMesnac.WPF.ViewModel
ControlOnClickCommand = new RelayCommand