yhluo 2 days ago
parent
commit
ba1dda469a
1 changed files with 11 additions and 8 deletions
  1. 11 8
      UAS_MES_HYSX/FunctionCode/Make/Make_AirTightnessTest.cs

+ 11 - 8
UAS_MES_HYSX/FunctionCode/Make/Make_AirTightnessTest.cs

@@ -214,9 +214,9 @@ namespace UAS_MES_NEW.Make
                         Result.Text = parseStr;
                         string testRes = LoadTestDetail("L", "1");
                         CheckPassStation(FirstSN.Text.Trim(), testRes, RTxt8.Text.Trim(), RTxt7.Text.Trim());
+                        Pagination.SelectedIndex = 0;
                         if (testRes == "NG")
                         {
-                            Pagination.SelectedIndex = 0;
                             RTxt8.Focus();
                             RTxt8.SelectAll();
                         }
@@ -226,9 +226,9 @@ namespace UAS_MES_NEW.Make
                         Result1.Text = parseStr;
                         string testRes = LoadTestDetail("L", "2");
                         CheckPassStation(SecondSN.Text.Trim(), testRes, R1Txt8.Text.Trim(), R1Txt7.Text.Trim());
+                        Pagination.SelectedIndex = 1;
                         if (testRes == "NG")
                         {
-                            Pagination.SelectedIndex = 1;
                             R1Txt8.Focus();
                             R1Txt8.SelectAll();
                         }
@@ -266,7 +266,8 @@ namespace UAS_MES_NEW.Make
             dt = (DataTable)dh.ExecuteSql($"select sm_id from steptestmain where sm_sourcetype = 'AirTightness' and sm_sn = '{sn}' order by sm_indate desc", "select");
             string sm_id = dt.Rows[0]["sm_id"].ToString();
 
-            dt = (DataTable)dh.ExecuteSql($"SELECT pr_at_max1,pr_at_max2,pr_at_time FROM product, makeserial WHERE ms_sncode = '{sn}' AND ms_prodcode = pr_code", "select");
+            //dt = (DataTable)dh.ExecuteSql($"SELECT pr_at_max1,pr_at_max2,pr_at_time FROM product, makeserial WHERE ms_sncode = '{sn}' AND ms_prodcode = pr_code", "select");
+            dt = (DataTable)dh.ExecuteSql($"SELECT pr_at_max1,pr_at_max2,pr_at_time FROM product, make,makeserial WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ma_prodcode = pr_code ORDER BY ms_id desc", "select");
             string max1 = dt.Rows[0]["pr_at_max1"].ToString();
             string max2 = dt.Rows[0]["pr_at_max2"].ToString();
             string attime = dt.Rows[0]["pr_at_time"].ToString();
@@ -279,8 +280,8 @@ namespace UAS_MES_NEW.Make
             Dictionary<string,string> testArr = new Dictionary<string,string>();
             testArr.Add("测试项", "气密性测试压力");
             testArr.Add("参数名称", "气密性测试压力");
-            testArr.Add("结果", Convert.ToInt32(testVal) > Convert.ToInt32(max1) ? "1" : "0");
-            testArr.Add("结果描述", Convert.ToInt32(testVal) > Convert.ToInt32(max1) ? "OK" : "NG");
+            testArr.Add("结果", Convert.ToInt32(pressureVal) > Convert.ToInt32(max1) ? "1" : "0");
+            testArr.Add("结果描述", Convert.ToInt32(pressureVal) > Convert.ToInt32(max1) ? "OK" : "NG");
             testArr.Add("产测指标门限", max1);
             testArr.Add("测试时长", attime);
             testArr.Add("值", pressureVal);
@@ -295,8 +296,8 @@ namespace UAS_MES_NEW.Make
             Dictionary<string, string> testArr1 = new Dictionary<string, string>();
             testArr1.Add("测试项", "气密性泄漏值");
             testArr1.Add("参数名称", "气密性泄漏值");
-            testArr1.Add("结果", Convert.ToInt32(pressureVal) < Convert.ToInt32(max2) ? "1" : "0");
-            testArr1.Add("结果描述", Convert.ToInt32(pressureVal) < Convert.ToInt32(max2) ? "OK" : "NG");
+            testArr1.Add("结果", Convert.ToInt32(testVal) < Convert.ToInt32(max2) ? "1" : "0");
+            testArr1.Add("结果描述", Convert.ToInt32(testVal) < Convert.ToInt32(max2) ? "OK" : "NG");
             testArr1.Add("产测指标门限", max2);
             testArr1.Add("测试时长", attime);
             testArr1.Add("值", testVal);
@@ -452,8 +453,10 @@ namespace UAS_MES_NEW.Make
             else if (type == "L") 
             {
                 SQL.Clear();
+                //SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
+                //        WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
                 SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
-                        WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
+                        WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {