瀏覽代碼

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 年之前
父節點
當前提交
9b81243095
共有 2 個文件被更改,包括 28 次插入10 次删除
  1. 11 3
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  2. 17 7
      UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

+ 11 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -32,6 +32,8 @@ namespace UAS_MES.Make
 
         string ErrorMessage = "";
 
+        List<string> TSN = new List<string>();
+
         System.DateTime[] indate;
 
         string ms_firstsn = "";
@@ -142,7 +144,7 @@ namespace UAS_MES.Make
                             //获取对应 产品的机身标的打印模板
                             if (ListA.Rows.Count > 0)
                             {
-                                string fsoncode= ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
+                                string fsoncode = ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
                                 string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
                                 string soncode = "";
                                 RemindItem.Add(fsoncode);
@@ -219,8 +221,12 @@ namespace UAS_MES.Make
                             CollectData.Add(code.Text);
                             SPID.Add(sp_id);
                             CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());
-                            OperateResult.AppendText(">>物料" + code.Text + "采集成功\n", Color.Green, code);
+                            if (sp_barcoderule == "TSN")
+                            {
+                                TSN.Add(code.Text);
+                            }
                             RemainIndex = RemainIndex + 1;
+                            OperateResult.AppendText(">>物料" + code.Text + "采集成功\n", Color.Green, code);
                         }
                         else
                         {
@@ -260,11 +266,12 @@ namespace UAS_MES.Make
                             sql.Append("where ma_code='" + ma_code.Text + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
                             //更新半成品SN已被工单使用
-                            dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + ms_sncode.Text + "' and ms_makecode<>'" + ma_code.Text + "')", "update");
+                            dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_makecode<>'" + ma_code.Text + "')", new string[] { "sncode" }, TSN.ToArray());
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
                             RemainIndex = 0;
                             RemindItem.Clear();
                             CollectData.Clear();
+                            TSN.Clear();
                             CollectDataSonCode.Clear();
                             BaseUtil.CleanDataTableData(ListA);
                             if (LogicHandler.SetTestResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
@@ -321,6 +328,7 @@ namespace UAS_MES.Make
         {
             BaseUtil.CleanDataTableData(ListA);
             RemainIndex = 0;
+            TSN.Clear();
             RemindItem.Clear();
             code.Clear();
             OperateResult.AppendText(">>请重新采集序列号\n");

+ 17 - 7
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -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();