Administrator 1 month ago
parent
commit
cb1e7a2e65
  1. 23
      EX/Configini.ini
  2. BIN
      EX/SunlightAggregationManager.db
  3. 4
      UserClass/AsyncTcpClient.cs
  4. 2
      View/imgQR.xaml.cs
  5. 8
      ViewModel/MainWindowViewModel.cs

23
EX/Configini.ini

@ -0,0 +1,23 @@
[SYS]
Language=zh-CN
Name=YZ
Enterprise=YONGZHAO
[SQL_SERVER]
SQL1=192.168.15.248
SQL2=BatchDyeingCentral
SQL3=SQL SERVER
SQL4=sa
SQL5=yf888999
[NETWORK]
TCP=1
HTTP=1
TLS=0
TCP_PORT1=7789
TCP_PORT2=7790
HTTP_PORT=7791
[SERVER]
SERVERIP=www.scserverddns.top:7795
SERVERNAME=SUNLIGHT
SERVERUSER=SUNLIGHT
SERRVERPASWORD=SUNLIGHT

BIN
EX/SunlightAggregationManager.db

Binary file not shown.

4
UserClass/AsyncTcpClient.cs

@ -264,8 +264,8 @@ namespace SunlightAggregationManager.UserClass
"Groups", "User='" + person?.User + "'"); "Groups", "User='" + person?.User + "'");
DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("" + DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("" +
"select * from Notification WHERE Groups='" + groups + "' and Time>'" + "select * from Notification WHERE Groups='" + groups + "' and Id>'" +
s_ + "' and Time<'" + e_ + "'", null)?.Tables[0] ?? new DataTable(); s_ + "'", null)?.Tables[0] ?? new DataTable();
if(resultTable.Rows.Count==0) resultTable.Rows.Add(); if(resultTable.Rows.Count==0) resultTable.Rows.Add();
//格式化返回信息 //格式化返回信息

2
View/imgQR.xaml.cs

@ -99,7 +99,7 @@ namespace SunlightAggregationManager.View
{ {
string text_APP = "TEST"; // string text_APP = "TEST"; //
string text_LINK = MainWindowViewModel.MachineIP + ":"+ MainWindowViewModel.MachineIPP1 + string text_LINK = MainWindowViewModel.MachineIP + ":"+ MainWindowViewModel.MachineIPP1 +
"," + MainWindowViewModel.SERVERIP + "/"+ MainWindowViewModel.Enterprise; "," + MainWindowViewModel.SERVERIP + ":7791/"+ MainWindowViewModel.Enterprise;
// 要生成二维码的内容 // 要生成二维码的内容
imgQR_CREATE(text_APP, imgQR_app); imgQR_CREATE(text_APP, imgQR_app);

8
ViewModel/MainWindowViewModel.cs

@ -44,6 +44,7 @@ namespace SunlightAggregationManager.ViewModel
private static Timer? _timer; private static Timer? _timer;
public static DataTable ChemicalStatistics = new DataTable(); public static DataTable ChemicalStatistics = new DataTable();
public static DataTable DBC_Machines = new DataTable();
public static DataBase dataBase = new DataBase(); public static DataBase dataBase = new DataBase();
public static UserClass.SqliteHelper SQLiteHelpers = null!; //定义数据库 public static UserClass.SqliteHelper SQLiteHelpers = null!; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SunlightAggregationManager.db"; //数据库路径 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SunlightAggregationManager.db"; //数据库路径
@ -67,7 +68,7 @@ namespace SunlightAggregationManager.ViewModel
TCP_E = Configini.IniReadvalue("NETWORK", "TCP"); TCP_E = Configini.IniReadvalue("NETWORK", "TCP");
HTTP_E = Configini.IniReadvalue("NETWORK", "HTTP"); HTTP_E = Configini.IniReadvalue("NETWORK", "HTTP");
TLS_E = Configini.IniReadvalue("NETWORK", "TLS"); TLS_E = Configini.IniReadvalue("NETWORK", "TLS");
SERVERIP = Configini.IniReadvalue("SERVER", "SERVERIP"); SERVERIP = Configini.IniReadvalue("SERVER", "SERVERIP") + ":7795";
SERVERNAME = Configini.IniReadvalue("SERVER", "SERVERNAME"); SERVERNAME = Configini.IniReadvalue("SERVER", "SERVERNAME");
SERVERUSER = Configini.IniReadvalue("SERVER", "SERVERUSER"); SERVERUSER = Configini.IniReadvalue("SERVER", "SERVERUSER");
SERRVERPASWORD = Configini.IniReadvalue("SERVER", "SERRVERPASWORD"); SERRVERPASWORD = Configini.IniReadvalue("SERVER", "SERRVERPASWORD");
@ -388,11 +389,14 @@ namespace SunlightAggregationManager.ViewModel
private static int EXTime = 0; private static int EXTime = 0;
private static async void TimeTask(object? state) private static async void TimeTask(object? state)
{ {
if (EXTime >= 120)//1小时 if (EXTime == 120)//1小时
{ {
EXTask();//统计配送消息 EXTask();//统计配送消息
EXTime = 0;
} }
DBC_Machines = await dataBase.ExecuteQueryAsync("SELECT *FROM [BatchDyeingCentral].[dbo].[Machines]");
EXTime++; EXTime++;
} }

Loading…
Cancel
Save