|
@@ -31,6 +31,7 @@ namespace MOKA_Factory_Tools
|
|
|
FunctionSetting functionSetting1 = new FunctionSetting();
|
|
|
SQLiteConnection LocalDB = null;
|
|
|
SQLiteConnection ErrorDB = null;
|
|
|
+ SQLiteConnection ReportDB = null;
|
|
|
|
|
|
Dictionary<string, string> ChannelMapList = new Dictionary<string, string>();
|
|
|
Dictionary<string, string> LanguageMapList = new Dictionary<string, string>();
|
|
@@ -38,6 +39,7 @@ namespace MOKA_Factory_Tools
|
|
|
string Custom_ProjectID = "";
|
|
|
ArrayList formlocationmsg = new ArrayList();
|
|
|
string ErrorDBPath = AppDomain.CurrentDomain.BaseDirectory + "\\Error.db";
|
|
|
+ string ReportDBPath = AppDomain.CurrentDomain.BaseDirectory + "\\DB\\ReportData.db";
|
|
|
Thread uploadbackground;
|
|
|
|
|
|
bool LocalWrite = false;//离线抄写开关
|
|
@@ -78,6 +80,12 @@ namespace MOKA_Factory_Tools
|
|
|
ErrorDB.Open();
|
|
|
}
|
|
|
|
|
|
+ if (ReportDB == null)
|
|
|
+ {
|
|
|
+ ReportDB = new SQLiteConnection("data source=" + ReportDBPath);
|
|
|
+ ReportDB.Open();
|
|
|
+ }
|
|
|
+
|
|
|
#region 研发账号
|
|
|
if (CommonMethod.GetLoginAccout().Equals("RD", StringComparison.OrdinalIgnoreCase))
|
|
|
{
|
|
@@ -1448,6 +1456,28 @@ namespace MOKA_Factory_Tools
|
|
|
Log.WriteErrorLog(ex.Message);
|
|
|
}
|
|
|
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string url;
|
|
|
+ string content;
|
|
|
+ string id;
|
|
|
+ if (SQLiteHelper.GetReportData(ReportDB, out id, out url, out content))
|
|
|
+ {
|
|
|
+ if ( V2Method.ReportOnlineDataSQL(url, content, 5000) )
|
|
|
+ {
|
|
|
+ // 删除该记录;
|
|
|
+ SQLiteCommand cmd = new SQLiteCommand();
|
|
|
+ cmd.Connection = ReportDB;
|
|
|
+ cmd.CommandText = string.Format("delete from ReportData where id = {0}", id);
|
|
|
+ cmd.Dispose();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Log.WriteErrorLog(ex.Message);
|
|
|
+ }
|
|
|
+
|
|
|
// 频率5秒一次;
|
|
|
Thread.Sleep(5000);
|
|
|
}
|