|
@@ -16,6 +16,24 @@ namespace UAS_MES.PublicMethod
|
|
|
static StringBuilder sql = new StringBuilder();
|
|
|
//用于存放批量执行的SQL
|
|
|
static List<string> sqls = new List<string>();
|
|
|
+ /// <summary>
|
|
|
+ /// 记录复判记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="iSN"></param>
|
|
|
+ /// <param name="iMakeCode"></param>
|
|
|
+ /// <param name="iSource"></param>
|
|
|
+ /// <param name="iFileName"></param>
|
|
|
+ /// <param name="iLineCode"></param>
|
|
|
+ /// <param name="iCombine"></param>
|
|
|
+ public static void AutoPassJudge(string iSN, string iMakeCode, string iSource, string iFileName, string iLineCode, string iCombine)
|
|
|
+ {
|
|
|
+ //插入不良判断记录
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("insert into AUTOSCAN_REJUDGE(asr_id,asr_indate,asr_filename,asr_combinecode,asr_sourcecode,");
|
|
|
+ sql.Append("asr_linecode,asr_makecode,asr_sncode) values(AUTOSCAN_REJUDGE_seq.nextval,sysdate,");
|
|
|
+ sql.Append("'" + iFileName + "','" + iCombine + "','" + iSource + "','" + iLineCode + "','" + iMakeCode + "','" + iSN + "')");
|
|
|
+ dh.ExecuteSql(sql.ToString(), "insert");
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 检测当前的岗位资源对应的工序
|
|
@@ -845,9 +863,15 @@ namespace UAS_MES.PublicMethod
|
|
|
oErrorMessage = "";
|
|
|
string StepCode = "";
|
|
|
string StepName = "";
|
|
|
+ string ScanType = "";
|
|
|
+ string LineCode = "";
|
|
|
if (iResult == "" || iResult == null)
|
|
|
iResult = "检查未通过";
|
|
|
- GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
|
|
|
+ GetStepCodeAndNameAndTypAndLineCodeBySource(iSourceCode, ref StepCode, ref StepName, ref ScanType, ref LineCode);
|
|
|
+ if (ScanType == "REJUDGE")
|
|
|
+ {
|
|
|
+ AutoPassJudge(iSnCode, iMakeCode, iSourceCode, "", LineCode, "");
|
|
|
+ }
|
|
|
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_bgcode,mb_badtable,mb_soncode,mb_status,mb_badremark,mb_bgname,mb_badname)");
|
|
@@ -1069,13 +1093,15 @@ namespace UAS_MES.PublicMethod
|
|
|
/// <param name="Source"></param>
|
|
|
/// <param name="StepCode"></param>
|
|
|
/// <param name="StepName"></param>
|
|
|
- private static void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
|
|
|
+ private static void GetStepCodeAndNameAndTypAndLineCodeBySource(string Source, ref string StepCode, ref string StepName, ref string ScanType, ref string LineCode)
|
|
|
{
|
|
|
- DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
|
|
|
+ DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_scantype", "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
StepCode = dt.Rows[0]["sc_stepcode"].ToString();
|
|
|
StepName = dt.Rows[0]["sc_stepname"].ToString();
|
|
|
+ ScanType = dt.Rows[0]["sc_scantype"].ToString();
|
|
|
+ LineCode = dt.Rows[0]["sc_linecode"].ToString();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1158,7 +1184,7 @@ namespace UAS_MES.PublicMethod
|
|
|
//若有多个,以|分割
|
|
|
string[] pres = iPrefix.Split('|');
|
|
|
bool f = false;
|
|
|
- for (int i=0;i<pres.Length;i++)
|
|
|
+ for (int i = 0; i < pres.Length; i++)
|
|
|
{
|
|
|
if (pres[i] == "" ? true : iSN.StartsWith(pres[i]))
|
|
|
{
|