|
|
@@ -204,6 +204,11 @@ namespace UAS_MES.OQC
|
|
|
IfContainNG = true;
|
|
|
}
|
|
|
}
|
|
|
+ if (!IfContainNG && ChoosedDGV.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>全部通过不允许勾选不良代码\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ((IfContainNG && ChoosedDGV.RowCount > 0) || !IfContainNG)
|
|
|
{
|
|
|
//用于存放更新的数据
|
|
|
@@ -263,10 +268,10 @@ namespace UAS_MES.OQC
|
|
|
bc_name.Add(ChoosedDGV.Rows[i].Cells["bc_name1"].Value.ToString());
|
|
|
bg_code.Add(ChoosedDGV.Rows[i].Cells["bg_code1"].Value.ToString());
|
|
|
}
|
|
|
+ dh.ExecuteSql("delete from OQCNGReason where or_sncode='" + sncode.Text + "' and or_checkno='" + ob_checkno.Text + "'", "delete");
|
|
|
if (bc_name.Count > 0)
|
|
|
{
|
|
|
//dh.UpdateByCondition("makeserial", "ms_badtimes=ms_badtimes+1", "ms_sncode='" + sncode.Text + "'");
|
|
|
- dh.ExecuteSql("delete from OQCNGReason where or_sncode='" + sncode.Text + "' and or_checkno='" + ob_checkno.Text + "'", "delete");
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into OQCNGReason(or_id, or_checkno, or_makecode, or_sncode, or_badcode, or_description, or_remark,or_bgcode)");
|
|
|
sql.Append("values (OQCNGReason_seq.nextval,'" + ob_checkno.Text + "','" + ob_makecode.Text + "','" + sncode.Text + "',:a,:b,'" + ob_remark.Text + "',:c)");
|
|
|
@@ -284,7 +289,11 @@ namespace UAS_MES.OQC
|
|
|
else
|
|
|
dh.ExecuteSql("update makeserial set ms_status=1 where ms_sncode='" + sncode.Text + "'", "update");
|
|
|
//更新检验状态,如果是待检验的更新为检验中
|
|
|
- dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' where ob_checkno='" + ob_checkno.Text + "' and ob_status='UNCHECK'", "update");
|
|
|
+ if (ob_status.Text == "待检验")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' where ob_checkno='" + ob_checkno.Text + "' and ob_status='UNCHECK'", "update");
|
|
|
+ dh.ExecuteSql("update makecraftdetail set mcd_inqty=mcd_inqty+" + ob_nowcheckqty.Text + " where mcd_macode='" + ob_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'","select");
|
|
|
+ }
|
|
|
//更新批次中的合格数不合格数:用抽检批检验项目表获取最大的抽检数和不合格数
|
|
|
sql.Clear();
|
|
|
sql.Append("select count(1)from (select ois_sncode from OQCITEMSAMPLES where ");
|
|
|
@@ -389,7 +398,7 @@ namespace UAS_MES.OQC
|
|
|
{
|
|
|
for (int i = 0; i < wait.Rows.Count; i++)
|
|
|
{
|
|
|
- if (!Chooseed.Contains( wait.Rows[i]["bc_code"].ToString()))
|
|
|
+ if (!Chooseed.Contains(wait.Rows[i]["bc_code"].ToString()))
|
|
|
{
|
|
|
DataRow dr1 = choose.NewRow();
|
|
|
dr1["bc_code"] = wait.Rows[i]["bc_code"];
|