From ee5b362447f3223d0af6adc60807fa63f707e796 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期三, 25 十一月 2020 10:45:42 +0800
Subject: [PATCH] opf文件中将unloadbatterydone的扫描周期修改为10ms

---
 DetectionData.cs |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/DetectionData.cs b/DetectionData.cs
index e0d4cb3..40c0f37 100644
--- a/DetectionData.cs
+++ b/DetectionData.cs
@@ -15,6 +15,7 @@
         private SqlConnection connForUpload;
         private string _standardCheckMode;
 
+        int enableUploadMinutes = 10;
         private static readonly object synObj = new object();
         public DetectionData()
         {
@@ -39,6 +40,18 @@
             catch (Exception)
             {
                 CommonUtil.WriteLog(LogType.Err, "DataUpload杩炴帴鏁版嵁搴撳け璐ワ紒");
+            }
+
+            string enableUploadMinutesStr = ConfigurationManager.AppSettings["EnableUploadMinutes"];
+
+            int temp = 0;
+            if (int.TryParse(enableUploadMinutesStr, out temp))
+            {
+                enableUploadMinutes = temp;
+            }
+            else
+            {
+                enableUploadMinutes = 10;
             }
         }
 
@@ -135,7 +148,8 @@
         #region add by Patrick 2018-07-13
         public void SaveTrayBarcode(int detectID)
         {
-            string trayCode = CarrierBarcodeCtrl.GlobalCarrierBarcode;
+            string trayCode = "";
+            trayCode = CarrierBarcodeCtrl.GlobalCarrierBarcode;
 
             if (string.IsNullOrEmpty(trayCode))
             {
@@ -205,8 +219,8 @@
                                         AND ProductNoStatus  = 'OK' 
                                         AND ProductStatus<>'NA'
                                         AND (ISNULL(CarrierBarcode,'')<>'' OR ProductStatus  = 'NG')
-                                        AND DATEDIFF(DAY,'{0}',DetectTime)>=-1
-                                        ORDER BY DetectTime DESC", DateTime.Now.ToString("yyyy-MM-dd"));
+                                        AND DATEDIFF(MINUTE,DetectTime,'{0}')<={1}
+                                        ORDER BY DetectTime DESC", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), enableUploadMinutes.ToString());
 
             SqlDataReader dr = null;
             using (SqlCommand cmd = new SqlCommand(sql, connForUpload))

--
Gitblit v1.8.0