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

版本:3.1.1.1 印度小米工厂对接抄写事项处理。

jianfeng1.wang 2 жил өмнө
parent
commit
7f71b33bb9

+ 17 - 0
FactoryTool_CShare/Business/CommonMethod.cs

@@ -40,6 +40,18 @@ namespace MOKA_Factory_Tools
 
         private static LoginInput loginInput = new LoginInput();
 
+        private static FunctionSetting functionSetting  = null;
+
+        private static MidList midList  = null;
+
+
+        public static void SetCommonsData(FunctionSetting function, MidList mid)
+        {
+            if ( function != null )
+                functionSetting = function;
+            if ( mid != null)
+                midList = mid;
+        }
         /// <summary>
         /// 保存登录信息;
         /// </summary>
@@ -1838,6 +1850,11 @@ end:
                 PostEncoding = Encoding.UTF8,
                 KeepAlive = false
             };
+
+            // 如果是墨西哥和印度工厂,白平衡地址为本地;
+            if (functionSetting != null && (functionSetting.Mexican_IDM || functionSetting.IndiaMITVEnable))
+                item.URL = midList.host + "/order/getBalanceMessage";
+
             item.ContentType = "application/json;charset=utf-8";
             System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
             stopwatch.Start();

+ 2 - 3
FactoryTool_CShare/Business/V2Method.cs

@@ -32,10 +32,9 @@ namespace MOKA_Factory_Tools
                 url_getMessage = "http://test.scbc.qhmoka.com/scbc-server/clientType/getMessage.do";
         }
 
-        public static void SetTestUrl()
+        public static void SetGetMessageUrl(string url = "https://cn.uc.qhmoka.com/scbc-server/clientType/getMessage.do")
         {
-            if (TestMode.testMode)
-                url_getMessage = "http://test.scbc.qhmoka.com/scbc-server/clientType/getMessage.do";
+                url_getMessage = url;
         }
 
         public static RokuCustomer GetRokuInfo(string strRokuInfo)

+ 4 - 0
FactoryTool_CShare/Models/StructList.cs

@@ -237,6 +237,10 @@ namespace MOKA_Factory_Tools
 
         public string MIKeyUrl { get; set; } = "http://smes-app-prod.tclking.com:9006/api/SMESCustomer/GetXMCard";
         public string MIKeyReportUrl { get; set; } = "http://smes-app-prod.tclking.com:9006/api/SMESCustomer/UploadXMDataControl";
+        /// <summary>
+        /// 印度小米功能启用;
+        /// </summary>
+        public bool IndiaMITVEnable { get; set; } = false;
         #endregion
 
         #region 离线EDID

+ 1 - 1
FactoryTool_CShare/Properties/AssemblyInfo.cs

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.1.1.0")]
+[assembly: AssemblyVersion("3.1.1.1")]
 [assembly: AssemblyFileVersion("1.0.0.1")]

+ 2 - 1
FactoryTool_CShare/Views/Login.cs

@@ -74,7 +74,8 @@ namespace MOKA_Factory_Tools
             {
                 TestMode.testMode = true;
                 TestMode.SetTestMode(true);
-                V2Method.SetTestUrl();
+                // 设置测试地址;
+                V2Method.SetGetMessageUrl("http://test.scbc.qhmoka.com/scbc-server/clientType/getMessage.do");
                 // 开启了测试模式;
                 CommonMethod.GetProfileString("MOKAFactoryTools", "VirMAC", "B0-00-00-00-00-0B", MyString, 256);
                 if (MyString.ToString().Equals("B0-00-00-00-00-0B"))

+ 18 - 0
FactoryTool_CShare/Views/Main.cs

@@ -268,6 +268,7 @@ namespace MOKA_Factory_Tools
                         // 预绑定模式下:没有db数据库时需要下载json包;
                         if (V2Method.GetMidInfo(OrderText.Text.Trim(), TestMode.MAC, ErrorDB, out midList1))
                         {
+                            CommonMethod.SetCommonsData(functionSetting1, midList1);
                             if (V2Method.GetOfflineData(midList1.host, OrderText.Text.Trim(), ErrorDB, out List<MidAddress> midAddress2))
                             {
                                 WhiteBalanceList WhiteBalanceListNow;
@@ -459,6 +460,7 @@ namespace MOKA_Factory_Tools
                 {
                     if (V2Method.GetMidInfo(OrderText.Text.Trim(), TestMode.MAC, ErrorDB, out midList1))
                     {
+                        CommonMethod.SetCommonsData(functionSetting1, midList1);
                         CommonMethod.CheckKeyType(midList1.keytype, cfg_writedone, out key2Write);
                         OperationPanel.key2Write = key2Write;
 
@@ -888,6 +890,22 @@ namespace MOKA_Factory_Tools
                 {
                     SaveJsonConfig("MIKeyReportUrl", functionSetting1.MIKeyReportUrl);
                 }
+
+                if (jObject["IndiaMITVEnable"] != null)
+                {
+                    functionSetting1.IndiaMITVEnable = jObject["IndiaMITVEnable"].Value<bool>();
+                }
+                else
+                {
+                    SaveJsonConfig("IndiaMITVEnable", false);
+                }
+
+                // 变更接口地址;
+                if (functionSetting1.IndiaMITVEnable)
+                {
+                    functionSetting1.MIKeyUrl = "http://10.40.7.61:9006/api/SMESCustomer/GetXMCard";
+                    functionSetting1.MIKeyReportUrl = "http://10.40.7.61:9006/api/SMESCustomer/UploadXMDataControl";
+                }
                 #endregion
 
                 #region 串口重试机制;

+ 10 - 10
FactoryTool_CShare/Views/OperationPanel.cs

@@ -1605,7 +1605,7 @@ namespace MOKA_Factory_Tools
         public string GenerateReportInfo()
         {
             #region 移除非IDM抄写的Key;
-            if (FunctionSettingNow.MITVEnable && _MiKey != null)
+            if ((FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable) && _MiKey != null)
             {
                 // 配置要抄写的选项;
                 if (_MiKey.EthernetMac != null)
@@ -2368,7 +2368,7 @@ namespace MOKA_Factory_Tools
             }
 
 #region 小米FireTV功能启用;
-            if (FunctionSettingNow.MITVEnable)
+            if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
             {
                 // 获取Key;
                 if (!CommonMethod.GetMIKey(FunctionSettingNow.MIKeyUrl, SN, out _MiKey, out error))
@@ -2539,7 +2539,7 @@ namespace MOKA_Factory_Tools
             if (WriteMac.Checked)
             {
                 string mac = keyInfo.Mac.data.Replace("-", "");
-                if (FunctionSettingNow.MITVEnable == true)
+                if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
                     mac = keyInfo.Mac.data.Replace(":", "");
                 if (!CommonMethod.IsNumberAndWord(mac))
                 {
@@ -2605,7 +2605,7 @@ namespace MOKA_Factory_Tools
             if (WriteWifiMac.Checked)
             {
                 string wifimac = keyInfo.WiFi_MAC.data.Replace("-", "");
-                if (FunctionSettingNow.MITVEnable == true)
+                if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
                     wifimac = wifimac.Replace(":", "");
                 if (!CommonMethod.IsNumberAndWord(wifimac))
                 {
@@ -2671,7 +2671,7 @@ namespace MOKA_Factory_Tools
             if (WriteBTMac.Checked)
             {
                 string btmac = keyInfo.BT_MAC.data.Replace("-", "");
-                if (FunctionSettingNow.MITVEnable == true)
+                if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
                     btmac = btmac.Replace(":", "");
                 if (!CommonMethod.IsNumberAndWord(btmac))
                 {
@@ -4642,7 +4642,7 @@ namespace MOKA_Factory_Tools
             // DSN抄写;
             if (WriteDSN.Checked)
             {
-                if (FunctionSettingNow.MITVEnable)
+                if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
                 {// 小米的DSN抄写不用这么多处理;
                     if (!CommonMethod.IsNumberAndWord(keyInfo.DSN.data))
                     {
@@ -4767,7 +4767,7 @@ namespace MOKA_Factory_Tools
             }
 
 #region 小米FireTV功能;
-            if (FunctionSettingNow.MITVEnable)
+            if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
             {
 #if true
                 // 读取PSN;
@@ -4946,7 +4946,7 @@ namespace MOKA_Factory_Tools
             {// 在线抄写;
                 if (WriteDID.Checked)
                 {
-                    string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable, ref _MiKey);
+                    string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable, ref _MiKey);
                     if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow,  false, "", FunctionSettingNow.ReportTimeOut))
                     {
                         TestResult = 1;
@@ -4969,7 +4969,7 @@ namespace MOKA_Factory_Tools
                         if (SN.Trim().Length > 0)
                         {
                             keycontent += "nodid=true&";
-                            string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: true, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable, ref _MiKey);
+                            string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: true, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo, FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable, ref _MiKey);
                             if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow, false, "", FunctionSettingNow.ReportTimeOut))
                             {
                                 TestResult = 1;
@@ -5033,7 +5033,7 @@ namespace MOKA_Factory_Tools
             }
 
 #region 小米FireTV功能;
-            if (FunctionSettingNow.MITVEnable)
+            if (FunctionSettingNow.MITVEnable || FunctionSettingNow.IndiaMITVEnable)
             {
                 if (!ReportMIInfo(out error))
                 {