Ver código fonte

拆解处理判断不良代码更新,以及拆解更换以及拆解处半成品字段更新修改

Hcsy 8 anos atrás
pai
commit
20a06cc99a
1 arquivos alterados com 10 adições e 4 exclusões
  1. 10 4
      UAS-MES/FunctionCode/Make/Make_Decompose.cs

+ 10 - 4
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -204,12 +204,17 @@ namespace UAS_MES.Make
             {
                 if (LabelDataGridView.Rows[i].Cells["Choose"].Value != null)
                 {
-                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null || LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null))
+                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null || LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null)&& LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() != "-1")
                     {
                         OperateResult.AppendText("第" + (i + 1) + "行没有采集不良代码或新批号\n", Color.Red);
                         return;
                     }
-                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && nochange.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null))
+                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked &&  LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null && LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() == "-1")
+                    {
+                        OperateResult.AppendText("第" + (i + 1) + "行没有采集新批号\n", Color.Red);
+                        return;
+                    }
+                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && nochange.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null) && LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() != "-1")
                     {
                         OperateResult.AppendText("第" + (i + 1) + "行没有采集不良代码\n", Color.Red);
                         return;
@@ -356,6 +361,7 @@ namespace UAS_MES.Make
                                     sql.Append("(MAKEBADRSPART_seq.nextval, sysdate, '" + User.UserCode + "','" + ms_sncode.Text + "',:bc_code,'" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "','" + ms_makecode.Text + "','" + User.UserSourceCode + "','" + LabelDataGridView.Rows[i].Cells["cm_barcode"].Value + "')");
                                     dh.BatchInsert(sql.GetString(), new string[] { "bc_code" }, bccode);
                                 }
+                            }
 
                                 //此物料上线状态更新为-1,代表被拆解
                                 sql.Clear();
@@ -363,7 +369,7 @@ namespace UAS_MES.Make
                                 sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
                                 sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
                                 dh.ExecuteSql(sql.GetString(), "update");
-                            }
+                            
 
                             ////将新批号绑定到序列号中
                             //dt = (DataTable)dh.ExecuteSql("select sp_id from stepproduct where sp_mothercode='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'", "select");
@@ -416,7 +422,7 @@ namespace UAS_MES.Make
                                 }
                                 //craftmaterial解除相应物料绑定
                                 sql.Clear();
-                                sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");
+                                sql.Append("update craftmaterial set cm_status=-1,cm_dropman='" + User.UserCode + "',");
                                 sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
                                 sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
                                 dh.ExecuteSql(sql.GetString(), "update");