添加指令859获取设备日志
This commit is contained in:
commit
ae749384b1
1 file changed
+69
@@ -608,6 +608,75 @@ namespace DyeingComputer.UserClass
|
|||||||
}
|
}
|
||||||
else { client.SendAsync("SC999"); }
|
else { client.SendAsync("SC999"); }
|
||||||
}//系统设置表
|
}//系统设置表
|
||||||
|
else if (SYSAPI == "SC859")
|
||||||
|
{
|
||||||
|
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Dictionary<string, object> dat_859;
|
||||||
|
dat_859 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
|
||||||
|
|
||||||
|
if (dat_859.GetValue("INSTRUCTION").ToString() == "SERVER")
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
DataTable dt_ = SQLiteHelpers.ExecuteDataSet("select * from SERVER where TIME >"+
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <"+
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0];
|
||||||
|
SQLiteHelpers.Close();//关闭数据库
|
||||||
|
|
||||||
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
||||||
|
|
||||||
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||||
|
}
|
||||||
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "OperationLog")
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
DataTable dt_ = SQLiteHelpers.ExecuteDataSet("select * from OperationLog where TIME >" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0];
|
||||||
|
SQLiteHelpers.Close();//关闭数据库
|
||||||
|
|
||||||
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
||||||
|
|
||||||
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||||
|
}
|
||||||
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "IOLog")
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
DataTable dt_ = SQLiteHelpers.ExecuteDataSet("select * from IOLog where TIME >" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0];
|
||||||
|
SQLiteHelpers.Close();//关闭数据库
|
||||||
|
|
||||||
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
||||||
|
|
||||||
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||||
|
}
|
||||||
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "ERRLog")
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
DataTable dt_ = SQLiteHelpers.ExecuteDataSet("select * from ERRLog where TIME >" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" +
|
||||||
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0];
|
||||||
|
SQLiteHelpers.Close();//关闭数据库
|
||||||
|
|
||||||
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
||||||
|
|
||||||
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
client.SendAsync("SC959" + "[" + MainWindowViewModel.S01 + "]" + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { client.SendAsync("SC999"); }
|
||||||
|
}//读取设备日志
|
||||||
else if (SYSAPI == "SC861")
|
else if (SYSAPI == "SC861")
|
||||||
{
|
{
|
||||||
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||||
|
|||||||
Reference in new issue
Block a user