Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightAggregationManager
This commit is contained in:
commit
919e0b662b
2 files changed
+55
-1
No files matched your search
@@ -249,14 +249,67 @@ namespace SunlightAggregationManager.UserClass
|
||||
var groups = MainWindowViewModel.Selet_Memory(MainWindowViewModel._userData,
|
||||
"Groups", "User='" + person?.User + "'");
|
||||
|
||||
var resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("" +
|
||||
DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("" +
|
||||
"select * from Notification WHERE Groups='" + groups + "' and Time>'" +
|
||||
s_ + "' and Time<'" + e_ + "'", null)?.Tables[0] ?? new DataTable();
|
||||
if(resultTable.Rows.Count==0) resultTable.Rows.Add();
|
||||
|
||||
//格式化返回信息
|
||||
data_.Add("Notification", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
ret = JsonSerializer.Serialize(data_);
|
||||
}
|
||||
if (Command == "InfoMachine")//回复Notification请求的信息
|
||||
{
|
||||
string t_ = deserialized.GetValue("Type").ToString()!;
|
||||
string? m_ =null, f_ = "*";
|
||||
|
||||
if (deserialized.TryGetValue("MachinName", out var MachinName) && MachinName != null) m_ = MachinName.ToString();
|
||||
if (deserialized.TryGetValue("Field", out var Field) && Field != null) f_ = Field.ToString();
|
||||
|
||||
if (t_ == "10")
|
||||
{
|
||||
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " +
|
||||
f_ + " FROM [dbo].[WaitDispenseDyestuff] WHERE DispenseMachine='" + m_ + "'");
|
||||
data_.Add("Type", "10");
|
||||
data_.Add("InfoMachine", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
}
|
||||
else if (t_ == "12")
|
||||
{
|
||||
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " +
|
||||
f_ + " FROM [dbo].[ShelfInfo] ");
|
||||
data_.Add("Type", "12");
|
||||
data_.Add("InfoMachine", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
}
|
||||
else if (t_ == "20")
|
||||
{
|
||||
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " +
|
||||
f_ + " FROM [dbo].[WaitChemical] WHERE DispenseMachine='" + m_ + "'");
|
||||
data_.Add("Type", "20");
|
||||
data_.Add("InfoMachine", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
}
|
||||
else
|
||||
{
|
||||
data_.Add("InfoMachine", "");
|
||||
}
|
||||
|
||||
//格式化返回信息
|
||||
ret = JsonSerializer.Serialize(data_);
|
||||
}
|
||||
if (Command == "InfoMachinePipes")//回复Notification请求的信息
|
||||
{
|
||||
string? m_ = null, f_ = "*";
|
||||
|
||||
if (deserialized.TryGetValue("MachinName", out var MachinName) && MachinName != null) m_ = MachinName.ToString();
|
||||
if (deserialized.TryGetValue("Field", out var Field) && Field != null) f_ = Field.ToString();
|
||||
|
||||
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " +
|
||||
f_ + " FROM [dbo].[Pipes] WHERE Dispenser='" + m_ + "'");
|
||||
data_.Add("InfoMachinePipes", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
|
||||
//格式化返回信息
|
||||
ret = JsonSerializer.Serialize(data_);
|
||||
}
|
||||
|
||||
|
||||
person!.Dat = ret.ToString();
|
||||
var jsdat = JsonSerializer.Serialize(person);
|
||||
|
||||
Reference in new issue
Block a user