sat23 3 tahun lalu
induk
melakukan
4f23195b15

+ 15 - 0
SCBC Factory Tools/Business/CommonMethod.cs

@@ -33,6 +33,9 @@ namespace MOKA_Factory_Tools
 
         public static string FactoryName = "Unknown";
 
+        private static string lastOrder = "";
+        private static Dictionary<string, string> AsacSNDict = new Dictionary<string, string>();
+
         //public static string LocalMacAddress = GetMacAddress();
         /// <summary>
         /// 获取活动网卡硬件地址
@@ -1987,6 +1990,18 @@ namespace MOKA_Factory_Tools
                 Directory.CreateDirectory(path);
             }
 
+            if ( !lastOrder.Equals(ordernum) )
+            {
+                lastOrder = ordernum;
+                AsacSNDict.Clear();
+            }
+
+            if ( AsacSNDict.ContainsKey(sn) )
+            {
+                if ( AsacSNDict[sn].Equals(acasid) )
+                    return;
+            }
+
             string fileName = path + "\\" + ordernum + ".txt";
             string msg = string.Format("{0};{1}", sn, acasid);
             var stream = new StreamWriter(fileName, true);

+ 1 - 2
SCBC Factory Tools/Views/Main.cs

@@ -86,7 +86,7 @@ namespace MOKA_Factory_Tools
                 return;
 
             // 设置条码限制默认打上勾;
-            if ( midList1.keytype.ContainsKey("DSN") )
+            if (midList1.keytype != null && midList1.keytype.ContainsKey("DSN") )
             {
                 BarcodeLimit.Checked = true;
                 BarCodeKeyCodeText.Text = OrderText.Text;
@@ -260,7 +260,6 @@ namespace MOKA_Factory_Tools
                                         }
                                     case "1"://未预置或预置LR数据
                                         {
-                                        
                                             CommonMethod.GetWhiteBalanceInfo(TestMode.getWhiteBalanceInfoUrl, OrderText.Text.Trim(), TestMode.MAC, ErrorDB, out WhiteBalanceListNow);
                                             if (WhiteBalanceListNow.whiteBalanceInfo == null)
                                             {