|
|
@@ -42,6 +42,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
string ms_firstsn = "";
|
|
|
|
|
|
+ List<string> TSN = new List<string>();
|
|
|
+
|
|
|
DataHelper dh;
|
|
|
LogStringBuilder sql = new LogStringBuilder();
|
|
|
DataTable DBFind;
|
|
|
@@ -145,7 +147,13 @@ namespace UAS_MES.Make
|
|
|
string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
|
|
|
string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
|
|
|
if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
|
|
|
+ {
|
|
|
+ if (sp_barcoderule == "TSN")
|
|
|
+ {
|
|
|
+ TSN.Add(code.Text);
|
|
|
+ }
|
|
|
Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
|
|
|
+ }
|
|
|
else
|
|
|
OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
|
|
|
}
|
|
|
@@ -385,18 +393,18 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>物料" + sp_soncode + "采集成功\n");
|
|
|
code.Clear();
|
|
|
//如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
|
|
|
- string fsoncode = dt1.Rows[RemainIndex]["sp_fsoncode"].ToString();
|
|
|
- if (RemindItem.Contains(fsoncode))
|
|
|
- {
|
|
|
- RemainIndex = RemainIndex + 1;
|
|
|
- }
|
|
|
if (RemainIndex < RemainList.Length)
|
|
|
{
|
|
|
+ string fsoncode = dt1.Rows[RemainIndex]["sp_fsoncode"].ToString();
|
|
|
+ if (RemindItem.Contains(fsoncode))
|
|
|
+ {
|
|
|
+ RemainIndex = RemainIndex + 1;
|
|
|
+ }
|
|
|
string soncode = "";
|
|
|
for (int i = 0; i < dt1.Rows.Count; i++)
|
|
|
{
|
|
|
if (fsoncode == dt1.Rows[i]["sp_fsoncode"].ToString())
|
|
|
- soncode += dt1.Rows[i]["sp_soncode"].ToString()+",";
|
|
|
+ soncode += dt1.Rows[i]["sp_soncode"].ToString() + ",";
|
|
|
}
|
|
|
string prdetail = dt1.Rows[RemainIndex]["pr_detail"].ToString();
|
|
|
if (!RemindItem.Contains(fsoncode))
|
|
|
@@ -418,7 +426,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
|
|
|
dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
|
|
|
//更新序列号半成品已被使用
|
|
|
- dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + sn_code.Text + "' and ms_makecode<>'" + ma_code + "')", "update");
|
|
|
+ dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
|
|
|
if (ma_ecncode_label.Checked || ma_softversion_label.Checked)
|
|
|
{
|
|
|
string ecnText = ma_ecncode_label.Checked ? ma_ecncode.Text : "";
|
|
|
@@ -431,6 +439,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("'" + User.UserCode + "',sysdate from makeserial where ms_sncode='" + sn_code.Text + "' and ms_makecode='" + ma_code + "'");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
}
|
|
|
+ TSN.Clear();
|
|
|
CollectData.Clear();
|
|
|
RemindItem.Clear();
|
|
|
CollectDataSonCode.Clear();
|
|
|
@@ -455,6 +464,7 @@ namespace UAS_MES.Make
|
|
|
private void ClearSn_code_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
sn_code.Clear();
|
|
|
+ TSN.Clear();
|
|
|
CollectData.Clear();
|
|
|
RemindItem.Clear();
|
|
|
CollectDataSonCode.Clear();
|