Эх сурвалжийг харах

NTF相关接口调用规则变更:一个批次只调用一个GetMaInfo.

JeffWang 2 жил өмнө
parent
commit
cc229b2708

+ 2 - 2
FactoryTool_CShare/BLL/NTFBLL.cs

@@ -37,13 +37,13 @@ namespace MOKA_Factory_Tools.BLL
         /// <param name="bResult">抄写结果:成功或失败</param>
         /// <param name="bResult">抄写结果:成功或失败</param>
         /// <param name="strErrMsg">抄写失败时的描述</param>
         /// <param name="strErrMsg">抄写失败时的描述</param>
         /// <returns></returns>
         /// <returns></returns>
-        public bool SetDataBuringResult(string strLine, string strStation, string strSN, string strDSN, bool bResult, string strLastSN, int nOrderType, string strErrMsg = "")
+        public bool SetDataBuringResult(string strLine, string strStation, string strSN, string strOrder, string strDSN, bool bResult, string strLastSN, int nOrderType, string strErrMsg = "")
         {
         {
             MaInfo maInfo;
             MaInfo maInfo;
             _strLastSN = strLastSN;
             _strLastSN = strLastSN;
             DateTime dateNow = DateTime.Now;
             DateTime dateNow = DateTime.Now;
             // 通过SN获取MES服务器中记录的ODF、Model、Dissemination信息;            
             // 通过SN获取MES服务器中记录的ODF、Model、Dissemination信息;            
-            if (GMethod.GetMaInfo(strSN, out maInfo, null))
+            if (GMethod.GetMaInfo(strSN, strOrder, out maInfo, null))
             {
             {
                 // 1.通过SN查询出订单类型;
                 // 1.通过SN查询出订单类型;
                 if (nOrderType == 1)    // 量产;
                 if (nOrderType == 1)    // 量产;

+ 11 - 2
FactoryTool_CShare/Business/GMethod.cs

@@ -14,6 +14,7 @@ namespace MOKA_Factory_Tools
 {
 {
     internal class GMethod
     internal class GMethod
     {
     {
+        public static MaInfo s_maInfo = null;
         private static Dictionary<string, string> LastKaylaOrderInfo = new Dictionary<string, string>();
         private static Dictionary<string, string> LastKaylaOrderInfo = new Dictionary<string, string>();
 
 
         private static string url_MaInfo = "http://smes-prd-app01.tclking.com:9002/SAPService.asmx";
         private static string url_MaInfo = "http://smes-prd-app01.tclking.com:9002/SAPService.asmx";
@@ -30,10 +31,16 @@ namespace MOKA_Factory_Tools
             }
             }
         }
         }
 
 
-        public static bool GetMaInfo(string sn, out MaInfo maInfo, SQLiteConnection errorDBNow)
+        public static bool GetMaInfo(string sn, string order, out MaInfo maInfo, SQLiteConnection errorDBNow)
         {
         {
             string desc;
             string desc;
             maInfo = null;
             maInfo = null;
+            if (s_maInfo != null && s_maInfo.ODF.Equals(order, StringComparison.InvariantCultureIgnoreCase) )
+            {
+                maInfo = s_maInfo;
+                return true;
+            }
+
             string strPost = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
             string strPost = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                             "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                             "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                             "<soap:Body>" +
                             "<soap:Body>" +
@@ -70,6 +77,8 @@ namespace MOKA_Factory_Tools
                 return false;
                 return false;
             }
             }
 
 
+            s_maInfo = maInfo;
+
             return true;
             return true;
         }
         }
 
 
@@ -283,7 +292,7 @@ namespace MOKA_Factory_Tools
             {
             {
                 // 请求新的订单信息;
                 // 请求新的订单信息;
                 MaInfo maInfo;
                 MaInfo maInfo;
-                if (!GetMaInfo(sn, out maInfo, null))
+                if (!GetMaInfo(sn, order, out maInfo, null))
                 {
                 {
                     Log.WriteErrorLog("Kayla GetMaInfo失败");
                     Log.WriteErrorLog("Kayla GetMaInfo失败");
                     return false;
                     return false;

+ 1 - 1
FactoryTool_CShare/Business/V2Method.cs

@@ -47,7 +47,7 @@ namespace MOKA_Factory_Tools
                     SetEnable(keys.CI_plus);
                     SetEnable(keys.CI_plus);
                     SetEnable(keys.Playready);
                     SetEnable(keys.Playready);
 
 
-                    ReportOnlineData(mid.host, "TEST_WJF", GetReportJson("TEST_WJF", "SN0321-test9999", false, ref keys), null, false, "", 1000);
+                    ReportOnlineData(mid.host, "TEST_WJF", GetReportJson("TEST_WJF", "SN0321-test9999", false, "", "", "", ref keys), null, false, "", 1000);
 
 
                     ReportOfflineData(mid.host, "2022-07-18 14:40:42", "SN0321-test9999", null, null, false, "");
                     ReportOfflineData(mid.host, "2022-07-18 14:40:42", "SN0321-test9999", null, null, false, "");
                 }
                 }

+ 1 - 1
FactoryTool_CShare/Views/OperationPanel.cs

@@ -4897,7 +4897,7 @@ namespace MOKA_Factory_Tools
                     TestResult = 2;
                     TestResult = 2;
                 }
                 }
 
 
-                if (!ntfBLL.SetDataBuringResult(FunctionSettingNow.Line, FunctionSettingNow.Station, SN, keyInfo.DSN, TestResult == 0 ? false : true, strLastSN, nOrderType, TestResult == 0 ? ErrMsg : ""))
+                if (!ntfBLL.SetDataBuringResult(FunctionSettingNow.Line, FunctionSettingNow.Station, SN, orderNow, keyInfo.DSN, TestResult == 0 ? false : true, strLastSN, nOrderType, TestResult == 0 ? ErrMsg : ""))
                 {
                 {
                     //ntf失败,也需要提示;
                     //ntf失败,也需要提示;
                     ErrMsg = string.Format("统计NTF失败:{0}", SN);
                     ErrMsg = string.Format("统计NTF失败:{0}", SN);