From 31de09d1ba504cb036ae29a98a9efbb0c2d61914 Mon Sep 17 00:00:00 2001
From: quanzhou <quan.zhou@broconcentric.com>
Date: 星期四, 11 九月 2025 13:34:11 +0800
Subject: [PATCH] 增加扫码上传打印追溯条码的界面以及对mes的开关添加了日志

---
 src/Bro.M141.Process/M141Process_Mysql.cs |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/Bro.M141.Process/M141Process_Mysql.cs b/src/Bro.M141.Process/M141Process_Mysql.cs
index c2b3a8e..e14519a 100644
--- a/src/Bro.M141.Process/M141Process_Mysql.cs
+++ b/src/Bro.M141.Process/M141Process_Mysql.cs
@@ -406,6 +406,38 @@
             return "NoRead";
         }
 
+        public List<ProductModel> SNGetProductList(string sn,string device)
+        {
+            try
+            {
+                string mysqlstr = $"select data from forall where sn='{sn}' and device='{device}'";
+                var dt = selectdt(mysqlstr, connStrAll);
+                if (dt == null)
+                {
+                    return null;
+                }
+                else
+                {
+                    List<ProductModel> plist = new List<ProductModel>();
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        string strjson = dt.Rows[i][0].ToString();
+                        strjson = strjson.Replace(@"\", @"\\");
+                        ProductModel p = JsonConvert.DeserializeObject<ProductModel>(strjson, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All });
+
+                        //JsonConvert.DeserializeObject<IProcessConfig>(_configBackupStr, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All });
+                        plist.Add(p);
+                    }
+                    return plist;
+                }
+            }
+            catch (Exception e)
+            {
+                CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"鏁版嵁搴揻orall鏁版嵁寮傚父 {e.ToString()}");
+            }
+            return null;
+        }
+
         public List<ProductModel> GetProductList(string plcnum)
         {
             try

--
Gitblit v1.8.0