Browse Source

彩盒标打印TSN判定修改

Hcsy 8 years ago
parent
commit
023c5ed3fa
1 changed files with 5 additions and 2 deletions
  1. 5 2
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

+ 5 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -117,9 +117,11 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);
                         return;
                     }
+                    OperateResult.AppendText(">>"+sncode.Text+ "\n", Color.Black);
                     sql.Clear();
-                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from");
-                    sql.Append(" makesnrelation where beforesn= '"+ sncode.Text + "'and ms_makecode=makecode)");
+                    //sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from");
+                    //sql.Append(" makesnrelation where beforesn= '"+ sncode.Text + "'and ms_makecode=makecode)");
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "' or ms_beforesn = '"+sncode.Text+"'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows[0][0].ToString() != "")
                     {
@@ -141,6 +143,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
                     return;
                 }
+                OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
                 if (CheckTSN.Checked == true && ms_id != null) {
                     sql.Clear();
                     sql.Append("select * from makeserial where ms_id='"+ms_id+"'  and  ms_sncode= '"+sncode.Text+"' ");