From 0787b253d6f02b91a4e68618b9f5e07156df6f89 Mon Sep 17 00:00:00 2001 From: liuwf Date: Thu, 23 Nov 2023 08:53:02 +0800 Subject: [PATCH] . --- .../ViewModels/IndexPageViewModel.cs | 4 ++-- .../ViewModels/IndexPageViewModel.cs | 11 +++++------ Aucma.Core.ProductOffLine/Views/QualityPageView.xaml | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs index 932790d4..f1b365dd 100644 --- a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs @@ -49,7 +49,6 @@ namespace Aucma.Core.CodeBinding.ViewModels MvCodeHelper.ReceiveCode1Event += receiveCode1; MvCodeHelper.ReceiveCode2Event += receiveCode2; - // var list = _codeBindingRecordServices.FirstAsync().Result; LoadData(); // 程序运行 5 秒后添加新数据项 @@ -306,11 +305,12 @@ namespace Aucma.Core.CodeBinding.ViewModels // 1.数据库查询各个工序质检结果,不合格报警 - // 2.查询条码绑定记录表,绑定SN码 + // 2.查询条码绑定记录表(内胆箱壳绑定就应该插入记录),绑定SN码 List list = await _codeBindingRecordServices.QueryAsync(x=> x.BoxCode==code1); CodeBindingRecord record = list.FirstOrDefault(); // List list = await _codeBindingRecordServices.QueryByTime(); // CodeBindingRecord record = list.FirstOrDefault(); + record.BoxName = "去别的数据库查询"; record.ProductCode = code2; record.RecordTime2 = System.DateTime.Now; record.BindingResult = "成功"; diff --git a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs index 9ea1766b..21e732fc 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs @@ -51,6 +51,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels _productPlanInfoServices = App.ServiceProvider.GetService(); MvCodeHelper.ReceiveCodeEvent += ReceiveCode; // test33(); + ReceiveCode("12345", 1); StartPlcTimer(); InitEveryDayMethod(); test2(); @@ -75,7 +76,6 @@ namespace Aucma.Core.ProductOffLine.ViewModels private void readPlcStatus(object source, System.Timers.ElapsedEventArgs e) { startGrab(); - } /// /// 读取开启扫码信号 @@ -275,13 +275,12 @@ namespace Aucma.Core.ProductOffLine.ViewModels /// 扫描的条码处理 /// /// - /// 扫码器方向,1左边分A库,2右边分B库 + /// 扫码器方向 private async void ReceiveCode(string code, int scannerNo) { - //1.扫描的SN条码去条码系统查询GET_BARCODE_DATA - //条码系统返回校验数据 - // string result = await _productOffLineServices.QueryChecked(code); - string result = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000000807@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01"; + //1.扫描的SN条码去条码系统查询GET_BARCODE_DATA 返回校验数据 + // string result = await _productOffLineServices.QueryChecked(code); + string result = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000000807@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01"; // 如果校验失败,下发报警 if ("N".Equals(result.Substring(0, 1))) { diff --git a/Aucma.Core.ProductOffLine/Views/QualityPageView.xaml b/Aucma.Core.ProductOffLine/Views/QualityPageView.xaml index 1aa88eee..b4388364 100644 --- a/Aucma.Core.ProductOffLine/Views/QualityPageView.xaml +++ b/Aucma.Core.ProductOffLine/Views/QualityPageView.xaml @@ -58,7 +58,7 @@ -