ソースを参照

不良可以重复测试,不良重新测试可测试为良品

章政 8 年 前
コミット
4d038c54c4
1 ファイル変更14 行追加34 行削除
  1. 14 34
      UAS_MesInterface(4.0)/MesHelper.cs

+ 14 - 34
UAS_MesInterface(4.0)/MesHelper.cs

@@ -13,7 +13,7 @@ namespace BenQGuru.eMES.DLLService
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
     {
-        [DispId(13)]
+        [DispId(12)]
         bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
         bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
         bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
@@ -26,7 +26,6 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
-        bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -40,7 +39,7 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
+        private string ConnectionStrings = "Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串
@@ -71,19 +70,16 @@ namespace BenQGuru.eMES.DLLService
             string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
             CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
             oErrMessage = param[6];
-            string MSID = param[5];
-            if (MSID == "" || MSID == null || MSID == "null")
-            {
-                MSID = "0";
-            }
-            string StepCode = getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + iResCode + "'").ToString();
-            string MS_StepCode = getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + MSID + "'").ToString();
-            if (StepCode != MS_StepCode && MS_StepCode != "")
+            oErrMessage = param[6];
+            string ms_status = getFieldDataByCondition("makeserial", "ms_status", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSN + "')").ToString();
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || ms_status == "3")
             {
-                oErrMessage = "当前岗位资源所属工序不正确,下一工序" + MS_StepCode;
-            }
-            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                if (ms_status == "3")
+                {
+                    oErrMessage = "";
+                }
                 return true;
+            }
             else
                 return false;
         }
@@ -272,16 +268,6 @@ namespace BenQGuru.eMES.DLLService
                 return false;
         }
 
-        [Description("获取工单软件版本")]
-        public bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage)
-        {
-            string oMakeCode = "";
-            oErrMessage = "";
-            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
-            oSoftVersion = getFieldDataByCondition("make", "ma_softversion", "ma_code='" + oMakeCode + "'").ToString();
-            return true;
-        }
-
         /// <summary>
         /// 获取工单的最近一条执行记录
         /// </summary>
@@ -656,14 +642,10 @@ namespace BenQGuru.eMES.DLLService
                 return false;
             }
             oErrMessage = "";
-            string omakecode = "";
-            string[] param = new string[] { "", iResCode, iSN, iOperator, omakecode, "", oErrMessage };
-            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
-            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
-            oErrMessage = param[6];
-            omakecode = param[4];
+            string oMakeCode = "";
+            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
-                return SetStepFinish(omakecode, iResCode, iSN, "", iResult, iOperator, iErrCode, out oErrMessage);
+                return SetStepFinish(oMakeCode, iResCode, iSN, "", iResult, iOperator, iErrCode, out oErrMessage);
             else
                 return false;
         }
@@ -970,7 +952,6 @@ namespace BenQGuru.eMES.DLLService
                 case "INSERT":
                     try
                     {
-                        Console.WriteLine(sql);
                         result = command.ExecuteNonQuery();
                     }
                     catch (Exception)
@@ -1001,10 +982,9 @@ namespace BenQGuru.eMES.DLLService
             {
                 foreach (string sql in SQL)
                 {
-                    if (!String.IsNullOrEmpty(sql))
+                    if (!string.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;
-                        Console.WriteLine(sql);
                         command.ExecuteNonQuery();
                     }
                 }