|
|
@@ -37,7 +37,7 @@ namespace UAS.MES
|
|
|
[ProgId("DllService.MESHelper")]
|
|
|
public class MESHelper : IMESHelper
|
|
|
{
|
|
|
- //用于拼接SQL
|
|
|
+ //用于拼接SQL
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
//用于存放批量执行的SQL
|
|
|
List<string> sqls = new List<string>();
|
|
|
@@ -76,7 +76,7 @@ namespace UAS.MES
|
|
|
oMsid = param[5];
|
|
|
oErrMessage = param[6];
|
|
|
DataTable dt = null;
|
|
|
- if (oMsid == "" || oMsid == null || oMsid == "null")
|
|
|
+ if (oMsid == "" || oMsid == null || oMsid == "null" || oMsid == "0")
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("select max(ms_id) from makeserial where ms_sncode in (select '" + iSN + "' from dual union select sn from makesnrelation where ");
|
|
|
@@ -84,7 +84,7 @@ namespace UAS.MES
|
|
|
dt = (DataTable)ExecuteSql(sql.ToString(), "select");
|
|
|
oMsid = dt.Rows[0][0].ToString();
|
|
|
}
|
|
|
- dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id='" + oMsid + "'","select");
|
|
|
+ dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id='" + oMsid + "'", "select");
|
|
|
string ms_status = "";
|
|
|
string ms_stepcode = "";
|
|
|
string ms_nextstepcode = "";
|
|
|
@@ -95,11 +95,11 @@ namespace UAS.MES
|
|
|
ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
|
|
|
}
|
|
|
string stepcode = GetStepCodeBySource(iResCode);
|
|
|
- if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
|
|
|
- {
|
|
|
- oErrMessage = "序列号下一工序" + ms_nextstepcode + ",前岗位资源不允许采集";
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
|
|
|
+ //{
|
|
|
+ // oErrMessage = "序列号下一工序" + ms_nextstepcode + ",前岗位资源不允许采集";
|
|
|
+ // return false;
|
|
|
+ //}
|
|
|
if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
|
|
|
{
|
|
|
if (ms_status == "3")
|
|
|
@@ -475,7 +475,7 @@ namespace UAS.MES
|
|
|
}
|
|
|
|
|
|
[Description("执行过站")]
|
|
|
- public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
|
|
|
+ private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
|
|
|
{
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
@@ -498,6 +498,7 @@ namespace UAS.MES
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "' and mb_stepcode='" + CurrentStep + "' and mb_status=0");
|
|
|
string[] BadCode = iErrCode.Split(',');
|
|
|
sql.Length = 0;
|
|
|
sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
|
|
|
@@ -511,7 +512,6 @@ namespace UAS.MES
|
|
|
InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + BadCode[i] + "'"));
|
|
|
}
|
|
|
ExecuteSQLTran(InsertSQL.ToArray());
|
|
|
- oErrMessage = "测试NG,请重新测试或者判定为不良";
|
|
|
//将不良的序列号的状态码设为3
|
|
|
ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
|
|
|
}
|