|
|
@@ -54,7 +54,7 @@ namespace UAS_MES_NEW.Make
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- InsertLog("OK");
|
|
|
+ //InsertLog("OK");
|
|
|
}
|
|
|
|
|
|
private void NG_Click(object sender, EventArgs e)
|
|
|
@@ -77,19 +77,41 @@ namespace UAS_MES_NEW.Make
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- InsertLog("NG");
|
|
|
+ //InsertLog("NG");
|
|
|
}
|
|
|
|
|
|
- private void InsertLog(string resType)
|
|
|
+ private void InsertLog(string sn, string resType, string main_sn = "")
|
|
|
{
|
|
|
- UpdateSN("L", SNVal.Text.Trim());
|
|
|
+ dt = (DataTable)dh.ExecuteSql($@"select * from steptestdetail where std_class = 'Xray抽检' and std_sn = '{sn}'", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(main_sn))
|
|
|
+ {
|
|
|
+ ShowMsg(0, $"序列号:{sn} 已采集Xray信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ShowMsg(0, $"拼板号:{main_sn} 中序列号:{sn} ,已采集Xray信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UpdateSN("L", sn);
|
|
|
|
|
|
SQL.Clear();
|
|
|
SQL.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,std_class,std_testresult,std_indate,STD_SUBCLASS1,STD_SUBCLASS2)
|
|
|
- VALUES (steptestdetail_seq.NEXTVAL, '{SNVal.Text.Trim()}','{workOrder.Text.Trim()}','Xray抽检','{resType}',sysdate, '{LineVal.Text}','{EmployeeVal.Text.Trim()}')");
|
|
|
+ VALUES (steptestdetail_seq.NEXTVAL, '{sn}','{workOrder.Text.Trim()}','Xray抽检','{resType}',sysdate, '{LineVal.Text}','{EmployeeVal.Text.Trim()}')");
|
|
|
dh.ExecuteSql(SQL.ToString(), "insert");
|
|
|
|
|
|
- ShowMsg(1, $"已记录 {SNVal.Text.Trim()},测试结果为 {resType}");
|
|
|
+ if (string.IsNullOrEmpty(main_sn))
|
|
|
+ {
|
|
|
+ ShowMsg(1, $"已记录 {sn},测试结果为 {resType}");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ShowMsg(1, $"拼板号:{main_sn} 已记录序列号:{sn} ,测试结果为 {resType}");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void ShowMsg(int type, string msg)
|
|
|
@@ -227,15 +249,18 @@ namespace UAS_MES_NEW.Make
|
|
|
if (SnType1.Checked)
|
|
|
{
|
|
|
List<string> snList = new List<string>();
|
|
|
- dt = (DataTable)dh.ExecuteSql($@"select * from smtbind where sb_maincode = '{SNVal.Text}'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql($@"select * from smtbind where sb_maincode = '{SNVal.Text.Trim()}'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
foreach (DataRow dr in dt.Rows)
|
|
|
{
|
|
|
- snList.Add(dr["sb_maincode"].ToString());
|
|
|
+ snList.Add(dr["sb_barcode"].ToString());
|
|
|
}
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ ShowMsg(0, $"条码:{SNVal.Text} 不是拼板号或未导入拼板记录");
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
foreach(string str in snList)
|
|
|
{
|
|
|
dt = (DataTable)dh.ExecuteSql($@"SELECT ms_makecode,ms_prodcode,cd_stepcode,cd_stepname,cd_stepno FROM makeserial,craft,craftdetail
|
|
|
@@ -252,6 +277,19 @@ namespace UAS_MES_NEW.Make
|
|
|
ShowMsg(0, $"拼板号:{SNVal.Text} 中序列号:{str} 无投入过站记录,请过投入站后再采集Xray信息");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ for (int i = 0; i <= LineVal.Items.Count; i++)
|
|
|
+ {
|
|
|
+ string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
|
|
|
+ string allLine = LineVal.Items[i].ToString();
|
|
|
+ if (mplinecode == allLine)
|
|
|
+ {
|
|
|
+ LineVal.SelectedIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ InsertLog(str, OkBox.Checked ? "OK" : "NG", SNVal.Text.Trim());
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -270,17 +308,19 @@ namespace UAS_MES_NEW.Make
|
|
|
ShowMsg(0, $"序列号:{SNVal.Text} 无投入过站记录,请过投入站后再采集Xray信息");
|
|
|
return;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- for (int i = 0; i <= LineVal.Items.Count; i++)
|
|
|
- {
|
|
|
- string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
|
|
|
- string allLine = LineVal.Items[i].ToString();
|
|
|
- if (mplinecode == allLine)
|
|
|
+ for (int i = 0; i <= LineVal.Items.Count; i++)
|
|
|
{
|
|
|
- LineVal.SelectedIndex = i;
|
|
|
- break;
|
|
|
+ string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
|
|
|
+ string allLine = LineVal.Items[i].ToString();
|
|
|
+ if (mplinecode == allLine)
|
|
|
+ {
|
|
|
+ LineVal.SelectedIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ InsertLog(SNVal.Text.Trim(), OkBox.Checked ? "OK" : "NG");
|
|
|
}
|
|
|
|
|
|
//if (string.IsNullOrEmpty(LineVal.Text))
|
|
|
@@ -289,8 +329,6 @@ namespace UAS_MES_NEW.Make
|
|
|
// return;
|
|
|
//}
|
|
|
|
|
|
- InsertLog(OkBox.Checked ? "OK" : "NG");
|
|
|
-
|
|
|
SNVal.Focus();
|
|
|
SNVal.SelectAll();
|
|
|
SNVal.Text = "";
|