Преглед изворни кода

接口参数新增:上报接口参数添加4字段。

JeffWang пре 2 година
родитељ
комит
bf70891718
2 измењених фајлова са 10 додато и 5 уклоњено
  1. 6 1
      FactoryTool_CShare/Business/V2Method.cs
  2. 4 4
      FactoryTool_CShare/Views/OperationPanel.cs

+ 6 - 1
FactoryTool_CShare/Business/V2Method.cs

@@ -477,7 +477,7 @@ namespace MOKA_Factory_Tools
             return result;
         }
 
-        public static string GetReportJson(string order, string sn, bool isNodid, ref KeyInfo keyinfo)
+        public static string GetReportJson(string order, string sn, bool isNodid, string clientType, string swVer, string pid, ref KeyInfo keyinfo)
         {
             Func<string, string, JObject, bool> AddJsonItem = (name, value, jobj) =>
             {
@@ -528,6 +528,11 @@ namespace MOKA_Factory_Tools
                 AddJsonItem("sn", sn, postJson);
                 AddJsonItem("nodid", isNodid.ToString().ToLower(), postJson);
 
+                AddJsonItem("toolVersion", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), postJson);
+                AddJsonItem("clienttype", clientType, postJson);
+                AddJsonItem("sversionid", swVer, postJson);
+                AddJsonItem("projectid", pid, postJson);
+
                 if (keyinfo != null)
                 {
                     AddKeyJson2(keyinfo.DID, postJson, "deviceid");

+ 4 - 4
FactoryTool_CShare/Views/OperationPanel.cs

@@ -4739,8 +4739,8 @@ namespace MOKA_Factory_Tools
             {// 在线抄写;
                 if (WriteDID.Checked)
                 {
-                    //if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host, errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
-                    if (V2Method.ReportOnlineData(midListNow.host, orderNow, V2Method.GetReportJson(orderNow, SN, isNodid:false, ref keyInfo), errorDBNow,  false, "", FunctionSettingNow.ReportTimeOut))
+                    string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo);
+                    if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow,  false, "", FunctionSettingNow.ReportTimeOut))
                     {
                         TestResult = 1;
                     }
@@ -4759,8 +4759,8 @@ namespace MOKA_Factory_Tools
                     if (SN.Trim().Length > 0)
                     {
                         keycontent += "nodid=true&";
-                        //if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host, errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
-                        if (V2Method.ReportOnlineData(midListNow.host, orderNow, V2Method.GetReportJson(orderNow, SN, isNodid: true, ref keyInfo), errorDBNow, false, "", FunctionSettingNow.ReportTimeOut))
+                        string postjson = V2Method.GetReportJson(orderNow, SN, isNodid: false, midListNow.clienttype, midListNow.version, ProjectIDText.Text, ref keyInfo);
+                        if (V2Method.ReportOnlineData(midListNow.host, orderNow, postjson, errorDBNow, false, "", FunctionSettingNow.ReportTimeOut))
                         {
                             TestResult = 1;
                         }