Browse Source

修改为更新半成品下一工单的BUG

章政 8 years ago
parent
commit
73d20bacdf
1 changed files with 4 additions and 1 deletions
  1. 4 1
      UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

+ 4 - 1
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -115,12 +115,13 @@ namespace UAS_MES.Make
                         //如果录入框和工单号均有输入
                         if (code.Text != "" && ma_code.Text != "" && sn_code.Text == "")
                         {
-                            //根据序列号查出ma_code,ma_prodcode,stepcode
                             GetCollectItem();
                         }
                         //输入框有值但未选择工单号
                         else if (code.Text != "" && ma_code.Text == "" && sn_code.Text == "")
+                        {
                             GetCollectItem();
+                        }
                         else if (sn_code.Text != "")
                         {
                             //索引超出长度表示内容均已提醒
@@ -360,6 +361,8 @@ namespace UAS_MES.Make
                 sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
                 sql.Append("where ma_code='" + make_code + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
                 dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
+                //更新序列号半成品已被使用
+                dh.ExecuteSql("update 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");
                 if (ecn_label.Checked || softwareversion_label.Checked)
                 {
                     string ecnText = ecn_label.Checked ? ecn.Text : "";