From 86f899fa91e811415614dff1a699141144bfc802 Mon Sep 17 00:00:00 2001
From: quanzhou <quan.zhou@broconcentric.com>
Date: 星期五, 12 十二月 2025 13:25:37 +0800
Subject: [PATCH] S5上传mes逻辑修改及打印机逻辑修改和数据库存储数据增加

---
 src/Bro.M141.Process/M141Process_Mysql.cs |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/src/Bro.M141.Process/M141Process_Mysql.cs b/src/Bro.M141.Process/M141Process_Mysql.cs
index c2b3a8e..592ceda 100644
--- a/src/Bro.M141.Process/M141Process_Mysql.cs
+++ b/src/Bro.M141.Process/M141Process_Mysql.cs
@@ -120,7 +120,7 @@
 
                 if (!string.IsNullOrEmpty(index))
                 {
-                    string str2 = $"delete from forlocal where id < ({index}-1000)";
+                    string str2 = $"delete from forlocal where id < ({index}-2000)";
                     Operatoremysql(str2, connStrLocal);
                 }
 
@@ -283,7 +283,7 @@
 
                         if (!string.IsNullOrEmpty(index))
                         {
-                            string str2 = $"delete from forall where id < ({index}-1000)";
+                            string str2 = $"delete from forall where id < ({index}-2000)";
                             Operatoremysql(str2, connStrAll);
                         }
 
@@ -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