|
|
@@ -25,7 +25,7 @@ namespace MES_Interface
|
|
|
/// <param name="iSourceCode"></param>
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
- public bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode, string iUserCode,out string oMacode, out string oMSID, out string oErrMessage)
|
|
|
+ public bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode, string iUserCode, out string oMacode, out string oMSID, out string oErrMessage)
|
|
|
{
|
|
|
oErrMessage = "";
|
|
|
oMSID = "";
|
|
|
@@ -129,7 +129,7 @@ namespace MES_Interface
|
|
|
return true;
|
|
|
else
|
|
|
return false;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 分配Mac地址和BT地址
|
|
|
@@ -356,11 +356,39 @@ namespace MES_Interface
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
|
|
|
+ private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrorMessage)
|
|
|
{
|
|
|
oErrorMessage = "";
|
|
|
string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
|
|
|
string CurrentStep = GetStepCodeBySource(iSourceCode);
|
|
|
+ switch (iResult)
|
|
|
+ {
|
|
|
+ case "OK":
|
|
|
+ break;
|
|
|
+ case "NG":
|
|
|
+ if (iErrCode == "")
|
|
|
+ {
|
|
|
+ oErrorMessage = "测试结果为NG时必须传递不良代码";
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string[] BadCode = iErrCode.Split(',');
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
|
|
|
+ sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status) select makebad_seq.nextval");
|
|
|
+ sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,'',");
|
|
|
+ sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
|
|
|
+ sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSN + "'");
|
|
|
+ dh.BatchInsert(sql.ToString(), new string[] { "bc_code"}, BadCode);
|
|
|
+ dh.BatchInsert("",new string[] { "BadCode"},BadCode);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oErrorMessage = "测试结果必须为NG或者OK";
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if (StepCode == CurrentStep)
|
|
|
{
|
|
|
InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
|
|
|
@@ -383,9 +411,9 @@ namespace MES_Interface
|
|
|
/// <param name="iUserCode"></param>
|
|
|
/// <param name="oErrorMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
- public bool SetTestResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
|
|
|
+ public bool SetTestResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrorMessage)
|
|
|
{
|
|
|
- return SetStepFinish(iMakeCode, iSourceCode, iSN, iMPKind, iResult, iUserCode, out oErrorMessage);
|
|
|
+ return SetStepFinish(iMakeCode, iSourceCode, iSN, iMPKind, iResult, iUserCode, iErrCode, out oErrorMessage);
|
|
|
}
|
|
|
|
|
|
private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oErrorMessage)
|