diff --git a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll index 38e6c37..d8060f0 100644 Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll differ diff --git a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb index bf0a007..4091817 100644 Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe index 4dcffab..0d81e5b 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb index 01e9a28..4fa9f60 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb differ diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll index 38e6c37..d8060f0 100644 Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll differ diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb index bf0a007..4091817 100644 Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb differ diff --git a/Aucma.Scada.UI/viewModel/InventoryInfo/SelectTypeViewModel.cs b/Aucma.Scada.UI/viewModel/InventoryInfo/SelectTypeViewModel.cs index 05acdbe..663a6d9 100644 --- a/Aucma.Scada.UI/viewModel/InventoryInfo/SelectTypeViewModel.cs +++ b/Aucma.Scada.UI/viewModel/InventoryInfo/SelectTypeViewModel.cs @@ -87,15 +87,31 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo } public void Load() { - var infos = baseMaterialInfoService.getAllInfos(); - MaterialDataGrid.Clear(); - Application.Current.Dispatcher.Invoke(() => + try { - foreach (BaseMaterialInfo info in infos) + List infos = null; + if (spaceCodes.Contains("XK")) { - MaterialDataGrid.Add(info); + infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "400").ToList(); } - }); + else + { + infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "500").ToList(); + } + if (infos == null) return; + MaterialDataGrid.Clear(); + Application.Current.Dispatcher.Invoke(() => + { + foreach (BaseMaterialInfo info in infos) + { + MaterialDataGrid.Add(info); + } + }); + } + catch (Exception ex) + { + logHelper.Error(ex.Message.ToString()); + } } private ObservableCollection materialDataGrid; @@ -303,17 +319,33 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo /// private async void searchData() { - if (!string.IsNullOrEmpty(searchText)) + try { - var infos = baseMaterialInfoService.getAllInfos().Where(x => x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText)); - MaterialDataGrid.Clear(); - Application.Current.Dispatcher.Invoke(() => + List infos = null; + if (!string.IsNullOrEmpty(searchText)) { - foreach (BaseMaterialInfo info in infos) + if (spaceCodes.Contains("XK")) { - MaterialDataGrid.Add(info); + infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "400" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText))).ToList(); } - }); + else + { + infos = baseMaterialInfoService.getShellAndLiner().Where(x => x.MaterialSubclass == "500" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText))).ToList(); + } + if (infos == null) return; + MaterialDataGrid.Clear(); + Application.Current.Dispatcher.Invoke(() => + { + foreach (BaseMaterialInfo info in infos) + { + MaterialDataGrid.Add(info); + } + }); + } + } + catch (Exception ex) + { + logHelper.Error(ex.Message.ToString()); } } } diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll index 38e6c37..d8060f0 100644 Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll and b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll differ diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb index bf0a007..4091817 100644 Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb and b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb differ diff --git a/HighWayIot.Repository/service/IBaseMaterialInfoService.cs b/HighWayIot.Repository/service/IBaseMaterialInfoService.cs index 9d9f01a..ab04d69 100644 --- a/HighWayIot.Repository/service/IBaseMaterialInfoService.cs +++ b/HighWayIot.Repository/service/IBaseMaterialInfoService.cs @@ -12,8 +12,14 @@ namespace HighWayIot.Repository.service public interface IBaseMaterialInfoService { /// - /// 箱壳内胆条码绑定 + /// 获取所有物料型号 /// List getAllInfos(); + + /// + /// 获取箱壳和内胆部件 + /// + /// + List getShellAndLiner(); } } diff --git a/HighWayIot.Repository/service/Impl/BaseMaterialInfoServiceImpl.cs b/HighWayIot.Repository/service/Impl/BaseMaterialInfoServiceImpl.cs index 1af98b4..b7026ee 100644 --- a/HighWayIot.Repository/service/Impl/BaseMaterialInfoServiceImpl.cs +++ b/HighWayIot.Repository/service/Impl/BaseMaterialInfoServiceImpl.cs @@ -15,6 +15,24 @@ namespace HighWayIot.Repository.service.Impl private LogHelper logHelper = LogHelper.Instance; public List getAllInfos() + { + try + { + var info = _baseMaterialInfo.GetList(x => x.MaterialSubclass == "200"); + return info; + } + catch (Exception ex) + { + logHelper.Error("获取集合异常", ex); + return null; + } + } + + /// + /// 获取箱壳和内胆部件 + /// + /// + public List getShellAndLiner() { try { @@ -28,5 +46,6 @@ namespace HighWayIot.Repository.service.Impl } } + } }