|
|
@@ -229,29 +229,45 @@ namespace UAS_MES.OQC
|
|
|
/// <returns></returns>
|
|
|
private bool CheckBefore()
|
|
|
{
|
|
|
- //如果AQL标准为空
|
|
|
- if (ob_aqlcode.Text == "")
|
|
|
+ if (ob_maxngacceptqty.Text == "" || ob_maxngacceptqty.Text=="0")
|
|
|
{
|
|
|
- if (ob_maxngacceptqty.Text == "")
|
|
|
- OperateResult.AppendText(">>AQL标准为空的时候必须填写最大不合格允许通过数\n", Color.Red);
|
|
|
+ if (ob_aqlcode.Text == "")
|
|
|
+ OperateResult.AppendText(">>最大不合格允许通过数为空的时候必须填写维护AQL标准\n", Color.Red);
|
|
|
else
|
|
|
{
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
|
|
|
- sql.Append("nvl(oi_checkqty,0)<oi_sampleqty and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
|
|
|
- dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select nvl(ad_minqty,0)ad_minqty,nvl(ad_maxqty,0)ad_maxqty,nvl(ad_maxngacceptqty,0)ad_maxngacceptqty from QUA_Aql left join qua_aqldetail on ad_alid=al_id where al_code='" + ob_aqlcode.Text + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- if (dt.Rows[0]["codes"].ToString() != "")
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号['" + ob_makecode.Text + "']\n", Color.Red);
|
|
|
- return false;
|
|
|
+ int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
|
|
|
+ int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
|
|
|
+ int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
|
|
|
+ if (batchqty > minqty && batchqty <= maxqty)
|
|
|
+ {
|
|
|
+ ob_maxngacceptqty.Text = dt.Rows[i]["ad_maxngacceptqty"].ToString();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
- return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
|
|
|
+ sql.Append("nvl(oi_checkqty,0)<oi_sampleqty and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["codes"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号[" + dt.Rows[0]["codes"].ToString() + "]\n", Color.Red);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -285,7 +301,7 @@ namespace UAS_MES.OQC
|
|
|
string ErrorMessage = "";
|
|
|
LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text, "OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
|
|
|
//记录操作日志
|
|
|
- LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, User.UserSourceCode,"批结果判定", Operate, User.UserName);
|
|
|
+ LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, User.UserSourceCode, "批结果判定", Operate, User.UserName);
|
|
|
}
|
|
|
}
|
|
|
}
|