Procházet zdrojové kódy

修复ntfBLL空的问题;修复上报MES打印乱码的问题;添加Sql语句log打印

sat23 před 3 roky
rodič
revize
93626fb394
3 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. 2 2
      Business/CommonMethod.cs
  2. 3 0
      DAL/DAL_AMResult.cs
  3. 4 2
      Views/OperationPanel.cs

+ 2 - 2
Business/CommonMethod.cs

@@ -2269,7 +2269,7 @@ namespace MOKA_Factory_Tools
             HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
-                Encoding = Encoding.Default,
+                Encoding = Encoding.UTF8,
                 Method = "post",
                 ContentType = "application/json",
                 KeepAlive = false
@@ -2343,7 +2343,7 @@ namespace MOKA_Factory_Tools
 
                         bool bResult = jObject["Result"].Value<bool>();
                         msg = jObject["EroMsg"].Value<string>();
-                        string returnObject = jObject["returnObject"].Value<string>();
+                        string returnObject = jObject["returnObject"].ToString();
 
                         if (bResult)
                         {

+ 3 - 0
DAL/DAL_AMResult.cs

@@ -1,5 +1,6 @@
 using MOKA_Factory_Tools.Database;
 using MOKA_Factory_Tools.Models;
+using SXLibrary;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -193,6 +194,7 @@ namespace MOKA_Factory_Tools.DAL
                 strSql.Append("from " + this.TableName);
                 strSql.Append(" where  " + whereString);
 
+                Log.WriteInfoLog(strSql.ToString());
                 DataSet ds = DbHelper.Query(cps.ConnectionString, strSql.ToString());
                 if (ds.Tables[0].Rows.Count > 0)
                 {
@@ -439,6 +441,7 @@ namespace MOKA_Factory_Tools.DAL
                 strSql.Append("from " + this.TableName);
                 strSql.Append(" where  " + whereString);
 
+                Log.WriteInfoLog(strSql.ToString());
                 DataSet ds = DbHelper.Query(cps.ConnectionString, strSql.ToString());
                 if (ds.Tables[0].Rows.Count > 0)
                 {

+ 4 - 2
Views/OperationPanel.cs

@@ -104,7 +104,8 @@ namespace MOKA_Factory_Tools
             this.mainform.KeyDownEvent += new KeyDownHandler(SetFocus);
             if (midListNow.rokuCustomer != null)
                 ProductMsg_Text.Text = "Roku:";
-            if (functionSetting.NTF)
+            //if (functionSetting.NTF)
+            if (CommonMethod.GetLoginAccout().Equals("HuiZhou",StringComparison.OrdinalIgnoreCase))
                 ntfBLL = new NTFBLL();
         }
 
@@ -792,7 +793,7 @@ namespace MOKA_Factory_Tools
                     string strErrorMsg;
                     if (!CommonMethod.GetOrderTypeFromSN(SN, out strOrderType, out strErrorMsg))
                     {
-                        Verify dlg = new Verify("根据SN获取订单类型失败,停止测试!" + "\r\n" + SN);
+                        Verify dlg = new Verify("根据SN获取订单类型失败,停止测试!" + "\r\nSN:" + SN);
                         dlg.ShowDialog();
                         Log.WriteErrorLog(string.Format("SN={0},错误={1}",SN, strErrorMsg));
                         SNText.Enabled = true;
@@ -2396,6 +2397,7 @@ namespace MOKA_Factory_Tools
                 {
                     ErrMsg = string.Format("Mac format error!\r\n{0}", mac);
                     Log.WriteErrorLog(ErrMsg);
+                    goto end;
                 }
                 byte[] MacData = SerialInit.HexToByte(mac);
                 Log.WriteInfoLog("Write Mac...");