Browse Source

添加按照上料信息获取序列号的方法

章政 7 years ago
parent
commit
0e4407783a
1 changed files with 23 additions and 2 deletions
  1. 23 2
      UAS_MesInterface/MESHelper.cs

+ 23 - 2
UAS_MesInterface/MESHelper.cs

@@ -12,7 +12,7 @@ namespace BenQGuru.eMES.DLLService
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
     {
-        [DispId(12)]
+        [DispId(13)]
         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);
@@ -24,6 +24,7 @@ namespace BenQGuru.eMES.DLLService
         bool GetMobileAllInfo(string iSnCode, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrorMessage);
         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 GetSNBtMaterialCode(string iMaterialCode, out string oSN, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
     }
 
@@ -182,6 +183,24 @@ namespace BenQGuru.eMES.DLLService
             return false;
         }
 
+        public bool GetSNBtMaterialCode(string iMaterialCode, out string oSN, out string oErrMessage)
+        {
+            oErrMessage = "";
+            oSN = "";
+            //获取最新的SN号,防止转号后查询不到
+            DataTable dt = (DataTable)ExecuteSql("select ms_sncode from craftmaterial left join makeserial on ms_firstsn=cm_firstsn and cm_makecode=ms_makecode where cm_barcode='" + iMaterialCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                oSN = dt.Rows[0][0].ToString();
+            }
+            else
+            {
+                oErrMessage = "物料" + iMaterialCode + "无上料关联SN信息";
+                return false;
+            }
+            return true;
+        }
+
         /// <summary>
         /// 分配Mac地址和BT地址
         /// </summary>
@@ -442,7 +461,7 @@ namespace BenQGuru.eMES.DLLService
                 return false;
         }
 
-        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 == "")
             {
@@ -1084,5 +1103,7 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
             }
         }
+
+
     }
 }