From 13f0eb973814b08fdb4fef9751ae4be2744cc19e Mon Sep 17 00:00:00 2001 From: liuwf Date: Sun, 3 Mar 2024 18:49:31 +0800 Subject: [PATCH] =?UTF-8?q?change-=E6=88=90=E5=93=81=E4=B8=8B=E7=BA=BF?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E5=99=A8=E6=B7=BB=E5=8A=A020=E4=BD=8D?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/MvCodeHelper.cs | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Aucma.Core.ProductOffLine/Business/MvCodeHelper.cs b/Aucma.Core.ProductOffLine/Business/MvCodeHelper.cs index 28179fcd..67e7e2db 100644 --- a/Aucma.Core.ProductOffLine/Business/MvCodeHelper.cs +++ b/Aucma.Core.ProductOffLine/Business/MvCodeHelper.cs @@ -59,7 +59,7 @@ namespace Aucma.Core.ProductOffLine.Business // Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]"); if (stBcrResult.nCodeNum == 0) { - Console.WriteLine("shell--->No Read 处理"); + Console.WriteLine("外侧--->No Read 处理"); } for (Int32 i = 0; i < stBcrResult.nCodeNum; i++) { @@ -74,8 +74,16 @@ namespace Aucma.Core.ProductOffLine.Business string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode); Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); // RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp); - RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp); - // 业务处理 + if (strCode.Trim().TrimEnd('\0').Length == 20) + { + RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp); + // 业务处理 + } + else + { + Console.WriteLine("外侧--->No Read 处理"); + } + } } @@ -98,7 +106,7 @@ namespace Aucma.Core.ProductOffLine.Business // Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]"); if (stBcrResult.nCodeNum == 0) { - Console.WriteLine("liner--->No Read 处理"); + Console.WriteLine("内侧--->No Read 处理"); } for (Int32 i = 0; i < stBcrResult.nCodeNum; i++) { @@ -113,8 +121,17 @@ namespace Aucma.Core.ProductOffLine.Business string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode); Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); // RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp); - // 业务处理 - RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp); + if (strCode.Trim().TrimEnd('\0').Length == 20) + { + // 业务处理 + RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp); + } + else + { + Console.WriteLine("内侧--->No Read 处理"); + } + + } }