From 87f01217966147c4567f416f430a0fe24679f53e Mon Sep 17 00:00:00 2001 From: liuwf Date: Tue, 5 Dec 2023 11:07:39 +0800 Subject: [PATCH 1/2] change. --- Aucma.Core.ProductOffLine/Business/offLineBusiness.cs | 4 ++-- .../ViewModels/QualityPageViewModel.cs | 9 ++++++++- Aucma.Core.Scanner/Scanner/ScannerService.cs | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs index 9d3f9f6c..fd7c6d13 100644 --- a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs +++ b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs @@ -217,7 +217,7 @@ namespace Aucma.Core.ProductOffLine.Business { try { - Thread.Sleep(10000); + Thread.Sleep(10000); TempOffLineInfo.ProductSNCode = BarCode.Trim(); //产品SN条码*1 TempOffLineInfo.ProductScanTime = System.DateTime.Now; // 扫码时间*2 TempOffLineInfo.ProductOrderNo = ""; @@ -225,7 +225,7 @@ namespace Aucma.Core.ProductOffLine.Business //1.查询条码系统 // string result = await _productOffLineServices.QueryChecked(BarCode); - string result = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000004899@BCD-160C,家电下乡@@BCD-160C@test皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01"; + string result = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000003987@BCD-160C,家电下乡@@BCD-160C@test皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01"; //查询到的数据分割处理,结果中用"@"号分隔,刷新页面显示 string[] FArrayList = result.Split('@'); diff --git a/Aucma.Core.ProductOffLine/ViewModels/QualityPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/QualityPageViewModel.cs index 630b397a..bfe4ffa4 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/QualityPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/QualityPageViewModel.cs @@ -65,7 +65,14 @@ namespace Aucma.Core.ProductOffLine.ViewModels { // 未设置方向模式或者设置自动模式,默认自动 BaseMaterialInfo info = _baseMaterialInfoServices.Query(x => x.MaterialCode == materialType).FirstOrDefault(); - direction = info.InboundDirection; + if (info != null) + { + direction = info.InboundDirection; + } + else // 自动模式未设置入库方向,默认为A + { + direction = "A"; + } } }); diff --git a/Aucma.Core.Scanner/Scanner/ScannerService.cs b/Aucma.Core.Scanner/Scanner/ScannerService.cs index 7a5a1aa9..83ad255e 100644 --- a/Aucma.Core.Scanner/Scanner/ScannerService.cs +++ b/Aucma.Core.Scanner/Scanner/ScannerService.cs @@ -13,7 +13,6 @@ namespace Aucma.Core.Scanner { try { - MvCodeHelper.DeviceListAcq();//获取创建设备 MvCodeHelper.StartGrab(); // 开启触发扫码接收数据 From 03b27b34d3d90466a15201b80bbb6204819535b0 Mon Sep 17 00:00:00 2001 From: liuwf Date: Tue, 5 Dec 2023 11:47:21 +0800 Subject: [PATCH 2/2] change. --- Aucma.Core.ProductOffLine/Models/TempInfo.cs | 5 ++++ .../ViewModels/StatisticsPageViewModel.cs | 27 +++++++++++++++++++ .../Views/StatisticsPageView.xaml | 12 ++++----- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Aucma.Core.ProductOffLine/Models/TempInfo.cs b/Aucma.Core.ProductOffLine/Models/TempInfo.cs index abba589f..bd777b14 100644 --- a/Aucma.Core.ProductOffLine/Models/TempInfo.cs +++ b/Aucma.Core.ProductOffLine/Models/TempInfo.cs @@ -124,5 +124,10 @@ namespace Aucma.Core.ProductOffLine.Models /// 扫码重复是否允许放行,界面加选择栏 /// public bool ChkOut { get; set; } + + /// + /// 按型号统计使用的数量 + /// + public int Count { get; set; } } } diff --git a/Aucma.Core.ProductOffLine/ViewModels/StatisticsPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/StatisticsPageViewModel.cs index 0b11d876..71ccaf8f 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/StatisticsPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/StatisticsPageViewModel.cs @@ -42,6 +42,21 @@ namespace Aucma.Core.ProductOffLine.ViewModels }); } + var countByProductModel = list.GroupBy(x => x.ProductModel).Select(group => new + { + ProductCode = group.First().ProductCode, + ProductRemark = group.First().ProductRemark, + ProductModel = group.Key, + Count = group.Count() + }).ToList(); + foreach (var item in countByProductModel) + { + Application.Current.Dispatcher.Invoke(() => + { + TotalItem.Add(new TempInfo() { No = TotalItem.Count + 1,ProductCode = item.ProductCode, ProductModel = item.ProductModel,ProductRemark = item.ProductRemark, Count = item.Count }); + }); + + } } } @@ -58,6 +73,18 @@ namespace Aucma.Core.ProductOffLine.ViewModels OnPropertyChanged();//属性通知 } } + // 按照型号统计 + private ObservableCollection totalItem = new ObservableCollection() { }; + public ObservableCollection TotalItem + { + get { return totalItem; } + set + { + totalItem = value; + OnPropertyChanged();//属性通知 + } + } + #endregion #region 查询 diff --git a/Aucma.Core.ProductOffLine/Views/StatisticsPageView.xaml b/Aucma.Core.ProductOffLine/Views/StatisticsPageView.xaml index c8d13d4c..18559612 100644 --- a/Aucma.Core.ProductOffLine/Views/StatisticsPageView.xaml +++ b/Aucma.Core.ProductOffLine/Views/StatisticsPageView.xaml @@ -130,7 +130,7 @@ --> - - - - - - + + + + +