|
|
@@ -1202,7 +1202,7 @@ namespace UAS_MES.PublicMethod
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static bool UpdateOQCMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
|
|
|
+ public static bool UpdateOQCMessage(string iSnCode,string iCheckno, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
|
|
|
{
|
|
|
oErrorMessage = "";
|
|
|
string StepCode = "";
|
|
|
@@ -1215,38 +1215,36 @@ namespace UAS_MES.PublicMethod
|
|
|
GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
|
|
|
//查询批次和批数量
|
|
|
int batchqty = 0;
|
|
|
- string checkno = "";
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select count(ms_checkno) count,ms_checkno from makeserial where ms_checkno=(select ms_checkno from makeserial where ms_sncode='" + iSnCode + "') group by ms_checkno", "select");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select count(ms_checkno) count,ms_checkno from makeserial where ms_checkno='"+ iCheckno + "' group by ms_checkno", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
batchqty = int.Parse(dt.Rows[0]["count"].ToString());
|
|
|
- checkno = dt.Rows[0]["ms_checkno"].ToString();
|
|
|
}
|
|
|
- object nextstepcode = dh.getFieldDataByCondition("makecraftdetail", "mcd_nextstepcode", "mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
|
|
|
+ string nextstepcode = dh.getFieldDataByCondition("make left join craft on ma_craftcode=cr_code and ma_prodcode=cr_prodcode left join craftdetail on cr_id = cd_crid", "cd_nextstepcode", "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'").ToString();
|
|
|
if (iResult.Contains("批次通过") && dt.Rows.Count > 0)
|
|
|
{
|
|
|
//更新执行的数量
|
|
|
sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
|
|
|
//更新makeSerial 的下一工序
|
|
|
- sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_checkno='" + checkno + "'");
|
|
|
+ sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode+ "' where ms_checkno='" + iCheckno + "'");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//更新执行的数量
|
|
|
sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
|
|
|
//更新makeSerial 的下一工序
|
|
|
- sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
|
|
|
+ sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
|
|
|
}
|
|
|
//更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
|
|
|
dh.ExecuteSQLTran(sqls.ToArray());
|
|
|
sqls.Clear();
|
|
|
//检测下道工序是否存在,不存在 更新状态为已完成
|
|
|
- if (nextstepcode == null || nextstepcode.ToString() == "")
|
|
|
+ if (nextstepcode == null || nextstepcode == "")
|
|
|
{
|
|
|
if (iResult.Contains("批次通过"))
|
|
|
{
|
|
|
sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
|
|
|
- sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + checkno + "'");
|
|
|
+ sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "'");
|
|
|
}
|
|
|
else
|
|
|
{
|