From 2bc7d729da06ebe31e94a727cb7e7b53a77add79 Mon Sep 17 00:00:00 2001
From: kingno <30263@KINGNO>
Date: 星期三, 27 八月 2025 13:06:48 +0800
Subject: [PATCH] 合并
---
src/Bro.M141.Process/M141Process_Mysql.cs | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/src/Bro.M141.Process/M141Process_Mysql.cs b/src/Bro.M141.Process/M141Process_Mysql.cs
index 59cd94f..c2b3a8e 100644
--- a/src/Bro.M141.Process/M141Process_Mysql.cs
+++ b/src/Bro.M141.Process/M141Process_Mysql.cs
@@ -23,10 +23,8 @@
{
public class M141Process_Mysql
{
-
string connStrAll = "server=localhost;port=3306;user id=root;password=123456;database=BroDB;charset=utf8";
string connStrLocal = "server=localhost;port=3306;user id=root;password=123456;database=BroDB;charset=utf8";
-
#region 鍩虹鎿嶄綔
public void IniDBIP(string IP)
@@ -107,7 +105,6 @@
}
#endregion
-
public void NewProduct(ProductModel pro)
@@ -199,7 +196,7 @@
//string destr = "delete from forall where id not in (select id from (select id from forall order BY id desc limit 1000) as subquery)";
//Operatoremysql(destr, connStrAll);
- if (string.IsNullOrEmpty(netname) /*|| devicestr != "S3" */)
+ if (string.IsNullOrEmpty(netname) || devicestr != "S3")
{
if (pro.Details != null)
{
@@ -213,7 +210,6 @@
item.DefectList.AddRange(defects.Distinct());
item.DefectList = item.DefectList.Distinct().ToList();
}
-
}
}
}
@@ -245,7 +241,7 @@
//HOperatorSet.AffineTransPoint2d(new HTuple(pro.Centermatrix.ToArray()), x1, y1, out HTuple qx, out HTuple qy);
CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Detail, $"sql {pro.SN}鍘熷潗鏍噞num} {x1},{y1}");
- HOperatorSet.ProjectiveTransPixel(new HTuple(pro.Centermatrix.ToArray()), x1, y1, out HTuple qx, out HTuple qy);
+ HOperatorSet.ProjectiveTransPixel(new HTuple(pro.Centermatrix.ToArray()), y1, x1, out HTuple qx, out HTuple qy);
CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Detail, $"sql {pro.SN}鏂板潗鏍噞num} {qx},{qy}");
Netdefectdetail temc = new Netdefectdetail()
@@ -291,7 +287,7 @@
Operatoremysql(str2, connStrAll);
}
- string mysqlstr = $"insert into forall (basketcode,device,plcnum,sn,data,time) values('{pro.BasketCode}','{devicestr}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All })}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')";
+ string mysqlstr = $"insert into forall (basketcode,zword,device,plcnum,sn,data,time) values('{pro.BasketCode}','{pro.Zword}','{devicestr}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All })}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')";
if (Operatoremysql(mysqlstr, connStrAll))
{
@@ -335,7 +331,6 @@
return null;
}
-
public List<Netdefectdetail> GetNetdefectdetails(string plcnum)
{
try
@@ -374,8 +369,8 @@
{
ProductModel p = null;
p = JsonConvert.DeserializeObject<ProductModel>(str, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All });
-
- return p.Result=="OK";
+
+ return p.Result == "OK";
}
}
catch (Exception e)
@@ -385,13 +380,13 @@
return false;
}
-
- public string Getbasketcode(string plcnum, out string sn)
+ public string Getbasketcode(string plcnum, out string sn, out string zword)
{
sn = "Noread";
+ zword = "Noread";
try
{
- string mysqlstr = $"select basketcode,sn from forall where plcnum='{plcnum}' && device='S2' order by id desc limit 1";
+ string mysqlstr = $"select basketcode,sn,zword from forall where plcnum='{plcnum}' && device='S2' order by id desc limit 1";
var dt = selectdt(mysqlstr, connStrAll);
if (dt == null || dt.Rows.Count == 0)
{
@@ -400,6 +395,7 @@
else
{
sn = dt.Rows[0][1].ToString();
+ zword = dt.Rows[0][2].ToString();
return dt.Rows[0][0].ToString();
}
}
@@ -409,7 +405,6 @@
}
return "NoRead";
}
-
public List<ProductModel> GetProductList(string plcnum)
{
@@ -443,8 +438,6 @@
return null;
}
-
-
public DataTable getBasketCode()
{
try
@@ -469,7 +462,6 @@
}
-
public void NewBasketcode(string code)
{
--
Gitblit v1.8.0