From 351cb734a84c10e90144551f7e7d6dd9a5c4abd2 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期日, 22 十一月 2020 13:40:57 +0800
Subject: [PATCH] 1. 数据库脚本添加启动大复位报警提示 2. 开放上传数据时间限制 3. 添加软件报警输出配置,目前提供连续NG报警和启动时大复位报警

---
 DetectionData.cs |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/DetectionData.cs b/DetectionData.cs
index e0d4cb3..2544663 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;
             }
         }
 
@@ -205,8 +218,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