瀏覽代碼

修改批次号箱号为空的bug

章政 8 年之前
父節點
當前提交
669e000f92
共有 2 個文件被更改,包括 44 次插入19 次删除
  1. 29 19
      UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.cs
  2. 15 0
      UAS-MES/PublicMethod/LogicHandler.cs

+ 29 - 19
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.cs

@@ -90,7 +90,7 @@ namespace UAS_MES.OQC
                     sqls[4] = "update OQCBatch set ob_nowcheckqty=(select count(1) from oqcbatchdetail where obd_checkno='" + ob_checkno.Text + "') where ob_checkno='" + ob_checkno.Text + "'";
                     dh.ExecuteSQLTran(sqls);
                     GetBatch.PerformClick();
-                    OperateResult.AppendText("批次" + ob_checkno.Text + "拆解成功!");
+                    OperateResult.AppendText(">>批次" + ob_checkno.Text + "拆解成功\n ",Color.Green);
                 }
                 else OperateResult.AppendText(">>批次状态必须是待检验\n", Color.Red);
             }
@@ -103,27 +103,34 @@ namespace UAS_MES.OQC
             {
                 if (OutBoxDGV.Columns[e.ColumnIndex].Name == "choose")
                 {
-                    string Checked = OutBoxDGV.Rows[e.RowIndex].Cells[0].FormattedValue.ToString();
-                    for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
+                    if (OutBoxDGV.Rows[e.RowIndex].Cells["obd_outboxcode1"].Value.ToString() != "")
                     {
-                        if (OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[e.RowIndex].Cells["obd_outboxcode1"].Value.ToString())
+                        string Checked = OutBoxDGV.Rows[e.RowIndex].Cells[0].EditedFormattedValue.ToString();
+                        for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
                         {
-                            if (Checked != "True")
-                                OutBoxDGV.Rows[i].Cells[0].Value = true;
-                            else
-                                OutBoxDGV.Rows[i].Cells[0].Value = false;
+                            if (OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[e.RowIndex].Cells["obd_outboxcode1"].Value.ToString())
+                            {
+                                if (Checked == "True")
+                                    OutBoxDGV.Rows[i].Cells[0].Value = true;
+                                else
+                                    OutBoxDGV.Rows[i].Cells[0].Value = false;
+                            }
                         }
                     }
                     int ChoosedNum = 0;
+                    CheckSn = "";
                     for (int i = 0; i < OutBoxDGV.Rows.Count; i++)
                     {
-                        if (OutBoxDGV.Rows[i].Cells[0].FormattedValue.ToString() == "True")
+                        if (OutBoxDGV.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                         {
                             ChoosedNum = ChoosedNum + 1;
                             CheckSn += "'" + OutBoxDGV.Rows[i].Cells["obd_sncode"].Value.ToString() + "',";
                         }
                     }
-                    CheckSn = CheckSn.Substring(0, CheckSn.Length - 1);
+                    if (CheckSn != "")
+                        CheckSn = CheckSn.Substring(0, CheckSn.Length - 1);
+                    else
+                        CheckSn = "''";
                     choosedsn.Text = ChoosedNum.ToString();
                 }
             }
@@ -138,19 +145,22 @@ namespace UAS_MES.OQC
                 {
                     if (sncode.Text == OutBoxDGV.Rows[i].Cells["obd_sncode"].Value.ToString())
                     {
-                        string Checked = OutBoxDGV.Rows[i].Cells[0].FormattedValue.ToString();
-                        for (int j = 0; j < OutBoxDGV.Rows.Count; j++)
+                        if (OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString() != "")
                         {
-                            if (OutBoxDGV.Rows[j].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString())
+                            string Checked = OutBoxDGV.Rows[i].Cells[0].EditedFormattedValue.ToString();
+                            for (int j = 0; j < OutBoxDGV.Rows.Count; j++)
                             {
-                                if (Checked != "True")
-                                    OutBoxDGV.Rows[j].Cells[0].Value = true;
-                                else
-                                    OutBoxDGV.Rows[j].Cells[0].Value = false;
+                                if (OutBoxDGV.Rows[j].Cells["obd_outboxcode1"].Value.ToString() == OutBoxDGV.Rows[i].Cells["obd_outboxcode1"].Value.ToString())
+                                {
+                                    if (Checked == "True")
+                                        OutBoxDGV.Rows[j].Cells[0].Value = true;
+                                    else
+                                        OutBoxDGV.Rows[j].Cells[0].Value = false;
+                                }
                             }
+                            FindSN = true;
+                            break;
                         }
-                        FindSN = true;
-                        break;
                     }
                 }
                 if (!FindSN)

+ 15 - 0
UAS-MES/PublicMethod/LogicHandler.cs

@@ -817,6 +817,21 @@ namespace UAS_MES.PublicMethod
                         oErrorMessage = "抽检批次" + iCheckNo + "不存在";
                     }
                     break;
+                case "OQCCHECKNOSPLIT":
+                    sql.Clear();
+                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_nowcheckqty,pr_spec||'|'||pr_detail pr_spec,ob_ngqty,ob_okqty,");
+                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode,ob_aqlcode,ob_maxngacceptqty from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode left join oqcitems on oi_checkno =ob_checkno and oi_projectcode =ob_projectcode where ob_checkno='" + iCheckNo + "' and ob_status='UNCHECK'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    //状态为UNCHECK或者CHECKING并且有抽样计划的才能操作
+                    if (Form.Rows.Count > 0)
+                    {
+                        sql.Clear();
+                        sql.Append("select obd_outboxcode,obd_builddate,obd_makecode,obd_sncode from oqcbatchdetail where obd_checkno='" + Form.Rows[0]["ob_checkno"].ToString() + "'");
+                        Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    }
+                    else oErrorMessage = "抽检批次" + iCheckNo + "不存在或者状态不处于待检验";
+                    break;
                 default:
                     break;
             }