From 0a5bc1d574adce254becfd3f598f505fbfbe27c3 Mon Sep 17 00:00:00 2001 From: congmu <congmu2024@163.com> Date: 星期六, 02 十一月 2024 13:53:25 +0800 Subject: [PATCH] Merge branch 'master' of ssh://115.28.86.8:29418/~admin/昆仑_1025 --- Client/朱航/log/朱航1031.doc | 0 Client/李宵增/document/历史查询分析模块需求分析.docx | 0 Server/马渝杭/log/日志_马渝杭_20241031.doc | 0 Client/宋昊昳/log/日志_宋昊昳_1102.doc | 0 Client/冀浩昶/log/日志_冀浩昶_1101.doc | 0 Server/王琨元/log/日志模板_王琨元_1031 .doc | 0 Server/马渝杭/log/日志_马渝杭_20241101.doc | 0 Client/朱航/log/朱航1101.doc | 0 Server/王琨元/document/表.docx | 0 Server/马渝杭/log/20241101昆仑日报.doc | 0 Client/刘子航/log/日志_刘子航_1102.doc | 0 Server/王琨元/document/~$表.docx | 0 Server/胡家明/log/日志_胡家明_1101.doc | 0 /dev/null | 67 ---------------- Client/冀浩昶/log/日志_冀浩昶_1102.doc | 0 Client/朱航/log/朱航1030.doc | 0 Server/李转转/log/配置管理_1102.doc | 0 Client/龚启祥/log/日志模板_龚启祥_1102.doc | 0 Client/黎弘霖/log/设备管理_黎弘霖_1102.doc | 0 Client/黎弘霖/code/Devices_Management_Struct.h | 131 ++++++++++++-------------------- common.h | 25 +++++- Client/李宵增/log/历史查询_李宵增_1101.doc | 0 22 files changed, 70 insertions(+), 153 deletions(-) diff --git "a/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1101.doc" "b/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1101.doc" new file mode 100644 index 0000000..3c27051 --- /dev/null +++ "b/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1101.doc" Binary files differ diff --git "a/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1102.doc" "b/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1102.doc" new file mode 100644 index 0000000..05961ca --- /dev/null +++ "b/Client/\345\206\200\346\265\251\346\230\266/log/\346\227\245\345\277\227_\345\206\200\346\265\251\346\230\266_1102.doc" Binary files differ diff --git "a/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1102.doc" "b/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1102.doc" new file mode 100644 index 0000000..b942f8d --- /dev/null +++ "b/Client/\345\210\230\345\255\220\350\210\252/log/\346\227\245\345\277\227_\345\210\230\345\255\220\350\210\252_1102.doc" Binary files differ diff --git "a/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1102.doc" "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1102.doc" new file mode 100644 index 0000000..7b40336 --- /dev/null +++ "b/Client/\345\256\213\346\230\212\346\230\263/log/\346\227\245\345\277\227_\345\256\213\346\230\212\346\230\263_1102.doc" Binary files differ diff --git "a/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521030.doc" "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521030.doc" new file mode 100644 index 0000000..f1496da --- /dev/null +++ "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521030.doc" Binary files differ diff --git "a/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521031.doc" "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521031.doc" new file mode 100644 index 0000000..ee2e85f --- /dev/null +++ "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521031.doc" Binary files differ diff --git "a/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521101.doc" "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521101.doc" new file mode 100644 index 0000000..55be380 --- /dev/null +++ "b/Client/\346\234\261\350\210\252/log/\346\234\261\350\210\2521101.doc" Binary files differ diff --git "a/Client/\346\235\216\345\256\265\345\242\236/document/\345\216\206\345\217\262\346\237\245\350\257\242\345\210\206\346\236\220\346\250\241\345\235\227\351\234\200\346\261\202\345\210\206\346\236\220.docx" "b/Client/\346\235\216\345\256\265\345\242\236/document/\345\216\206\345\217\262\346\237\245\350\257\242\345\210\206\346\236\220\346\250\241\345\235\227\351\234\200\346\261\202\345\210\206\346\236\220.docx" index deffe06..51eece8 100644 --- "a/Client/\346\235\216\345\256\265\345\242\236/document/\345\216\206\345\217\262\346\237\245\350\257\242\345\210\206\346\236\220\346\250\241\345\235\227\351\234\200\346\261\202\345\210\206\346\236\220.docx" +++ "b/Client/\346\235\216\345\256\265\345\242\236/document/\345\216\206\345\217\262\346\237\245\350\257\242\345\210\206\346\236\220\346\250\241\345\235\227\351\234\200\346\261\202\345\210\206\346\236\220.docx" Binary files differ diff --git "a/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1101.doc" "b/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1101.doc" new file mode 100644 index 0000000..86bb847 --- /dev/null +++ "b/Client/\346\235\216\345\256\265\345\242\236/log/\345\216\206\345\217\262\346\237\245\350\257\242_\346\235\216\345\256\265\345\242\236_1101.doc" Binary files differ diff --git "a/Client/\351\273\216\345\274\230\351\234\226/code/Devices_Management_Struct.h" "b/Client/\351\273\216\345\274\230\351\234\226/code/Devices_Management_Struct.h" index 67b38a2..28278eb 100644 --- "a/Client/\351\273\216\345\274\230\351\234\226/code/Devices_Management_Struct.h" +++ "b/Client/\351\273\216\345\274\230\351\234\226/code/Devices_Management_Struct.h" @@ -1,121 +1,88 @@ #pragma once enum TypeInfo { - AD_Req,//添加设备请求 - AD_Res,//添加设备响应 - CD_Req,//关闭设备请求 - CD_Res,//关闭设备请求 - PD_Req,//暂停设备请求 - PD_Res,//暂停设备请求 + AD_REQ,//添加设备请求 + AD_RES,//添加设备响应 + MD_REQ,//修改设备请求 + MD_RES,//修改设备响应 + QD_REQ,//查询设备请求 + QD_RES,//查询设备响应 }; struct Head { int type; int len; }; - +struct DevicesInfo +{ + int deviceID; + char deviceName[32];//设备名称 + char deviceStatus[32];//设备状态 + char manufacturer[100];//厂家 + char devicesType[32];//设备类型 + double longitude;//经度 + double latitude;//纬度 + char purchasingTime[15];//购买时间 + char installTime[15];//安装时间 + char devicesSerialNumber[32];//设备编码 +}; //添加设备 -struct ADReq +struct ADReq//添加请求 { Head head; - char Device_Name[32]; + char deviceName[32]; ADReq() { - head.type = AD_Req; - head.len = sizeof(AD_Req); + head.type = AD_REQ; + head.len = sizeof(ADReq); } }; -struct ADPermission -{ - char Device_Name[32]; - char Device_Status[32]; - char Manufacturer[100]; - char Devices_Type[32]; - double Longitude; - double Latitude; -}; -struct ADRes + +struct ADRes//添加响应 { Head head; - char Device_Name[32]; - char Device_Status[32]; - char Start_Time[32]; - char Work_Time[32]; - char Manufacturer[100]; - char Devices_Type[32]; - double Longitude; - double Latitude; - ADPermission per; + int type; ADRes() { - head.type = AD_Res; + head.type = AD_RES; head.len = sizeof(ADRes); } }; - -//关闭设备 -struct CDReq +//修改设备 +struct MDRes//修改请求 { Head head; - char Device_Name[32]; - CDReq() { - head.type = CD_Req; - head.len = sizeof(CDReq); + DevicesInfo info; + MDRes() { + head.type = MD_RES; + head.len = sizeof(MDRes); } }; -struct CDPermission -{ - char Device_Name[32]; - char Device_Status[32]; - char Start_Time[32]; - char Work_Time[32]; - char Manufacturer[100]; - char Devices_Type[32]; - double Longitude; - double Latitude; -}; -struct CDRes +struct MDReq//修改响应 { Head head; - char Device_Status[32]; - int status; - CDPermission per; - CDRes() { - head.type = CD_Res; - head.len = sizeof(CDRes); + int type; + MDReq() { + head.type = MD_REQ; + head.len = sizeof(MDReq); } }; - -//暂停设备 -struct PDReq +//查询设备 +struct QDReq//查询请求 { Head head; - char Device_Name[32]; - PDReq() { - head.type = PD_Req; - head.len = sizeof(PDReq); + DevicesInfo info; + QDReq() { + head.type = QD_REQ; + head.len = sizeof(QDReq); } }; -struct PDPermission -{ - char Device_Name[32]; - char Device_Status[32]; - char Start_Time[32]; - char Work_Time[32]; - char Manufacturer[100]; - char Devices_Type[32]; - double Longitude; - double Latitude; -}; -struct PDRes +struct QDRes//查询响应 { Head head; - char Device_Status[32]; - char Work_Time[32]; - int status; - PDPermission per; - PDRes() { - head.type = PD_Res; - head.len = sizeof(PDRes); + int type; + QDRes() { + head.type = QD_RES; + head.len = sizeof(QDRes); } }; \ No newline at end of file diff --git "a/Client/\351\273\216\345\274\230\351\234\226/log/\350\256\276\345\244\207\347\256\241\347\220\206_\351\273\216\345\274\230\351\234\226_1102.doc" "b/Client/\351\273\216\345\274\230\351\234\226/log/\350\256\276\345\244\207\347\256\241\347\220\206_\351\273\216\345\274\230\351\234\226_1102.doc" new file mode 100644 index 0000000..a5753d6 --- /dev/null +++ "b/Client/\351\273\216\345\274\230\351\234\226/log/\350\256\276\345\244\207\347\256\241\347\220\206_\351\273\216\345\274\230\351\234\226_1102.doc" Binary files differ diff --git "a/Client/\351\276\232\345\220\257\347\245\245/log/\346\227\245\345\277\227\346\250\241\346\235\277_\351\276\232\345\220\257\347\245\245_1102.doc" "b/Client/\351\276\232\345\220\257\347\245\245/log/\346\227\245\345\277\227\346\250\241\346\235\277_\351\276\232\345\220\257\347\245\245_1102.doc" new file mode 100644 index 0000000..638bcb1 --- /dev/null +++ "b/Client/\351\276\232\345\220\257\347\245\245/log/\346\227\245\345\277\227\346\250\241\346\235\277_\351\276\232\345\220\257\347\245\245_1102.doc" Binary files differ diff --git "a/Server/\346\235\216\350\275\254\350\275\254/log/\351\205\215\347\275\256\347\256\241\347\220\206_1102.doc" "b/Server/\346\235\216\350\275\254\350\275\254/log/\351\205\215\347\275\256\347\256\241\347\220\206_1102.doc" new file mode 100644 index 0000000..e89daf5 --- /dev/null +++ "b/Server/\346\235\216\350\275\254\350\275\254/log/\351\205\215\347\275\256\347\256\241\347\220\206_1102.doc" Binary files differ diff --git "a/Server/\347\216\213\347\220\250\345\205\203/document/~$\350\241\250.docx" "b/Server/\347\216\213\347\220\250\345\205\203/document/~$\350\241\250.docx" new file mode 100644 index 0000000..8b245e2 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/document/~$\350\241\250.docx" Binary files differ diff --git "a/Server/\347\216\213\347\220\250\345\205\203/document/\345\244\207\344\273\275\345\257\274\345\207\272.txt" "b/Server/\347\216\213\347\220\250\345\205\203/document/\345\244\207\344\273\275\345\257\274\345\207\272.txt" deleted file mode 100644 index 79c8216..0000000 --- "a/Server/\347\216\213\347\220\250\345\205\203/document/\345\244\207\344\273\275\345\257\274\345\207\272.txt" +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# 鏁版嵁搴撹繛鎺ュ弬鏁� -DB_USER="your_username" -DB_PASS="your_password" -DB_NAME="your_database_name" -BACKUP_DIR="/path/to/backup/directory" - -# 鑾峰彇褰撳墠鏃ユ湡锛岀敤浜庢枃浠跺悕 -DATE=$(date +%Y%m%d%H%M%S) - -# 澶囦唤鏂囦欢鍚� -BACKUP_FILE="${BACKUP_DIR}/backup_${DATE}.sql" - -# 鍒涘缓澶囦唤鐩綍锛堝鏋滀笉瀛樺湪锛� -mkdir -p $BACKUP_DIR - -# 浣跨敤mysqldump杩涜鏁版嵁搴撳浠� -mysqldump -u $DB_USER -p$DB_PASS $DB_NAME > $BACKUP_FILE - -if [ $? -eq 0 ]; then - echo "鏁版嵁搴撳浠芥垚鍔燂細$BACKUP_FILE" -else - echo "鏁版嵁搴撳浠藉け璐�" -fi - -# 娣诲姞瀹氭椂浠诲姟锛堜娇鐢╟rontab -e鏉ョ紪杈戝畾鏃朵换鍔★級 -# 渚嬪锛屾瘡澶╁噷鏅�2鐐规墽琛屽浠� -# 0 2 * * * /path/to/this/script.sh \ No newline at end of file diff --git "a/Server/\347\216\213\347\220\250\345\205\203/document/\345\273\272\350\241\250.docx" "b/Server/\347\216\213\347\220\250\345\205\203/document/\345\273\272\350\241\250.docx" deleted file mode 100644 index ed3cc7a..0000000 --- "a/Server/\347\216\213\347\220\250\345\205\203/document/\345\273\272\350\241\250.docx" +++ /dev/null Binary files differ diff --git "a/Server/\347\216\213\347\220\250\345\205\203/document/\350\241\250.docx" "b/Server/\347\216\213\347\220\250\345\205\203/document/\350\241\250.docx" new file mode 100644 index 0000000..4c098dd --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/document/\350\241\250.docx" Binary files differ diff --git "a/Server/\347\216\213\347\220\250\345\205\203/document/\351\230\262\346\263\250\345\205\245.txt" "b/Server/\347\216\213\347\220\250\345\205\203/document/\351\230\262\346\263\250\345\205\245.txt" deleted file mode 100644 index 19a2f6c..0000000 --- "a/Server/\347\216\213\347\220\250\345\205\203/document/\351\230\262\346\263\250\345\205\245.txt" +++ /dev/null @@ -1,67 +0,0 @@ -#include <iostream> -#include <mysql_driver.h> -#include <mysql_connection.h> -#include <cppconn/statement.h> -#include <cppconn/prepared_statement.h> -#include <cppconn/resultset.h> -#include <string> -#include <regex> - -class DatabaseUtils { -public: - // 杩炴帴鏁版嵁搴� - static sql::Connection* connect() { - try { - sql::mysql::MySQL_Driver* driver = sql::mysql::get_mysql_driver_instance(); - sql::Connection* con = driver->connect("tcp://127.0.0.1:3306", "mayi", "123456"); - con->setSchema("your_database"); - return con; - } catch (sql::SQLException& e) { - std::cerr << "鏁版嵁搴撹繛鎺ラ敊璇�: " << e.what() << std::endl; - return nullptr; - } - } - - // 妫�鏌QL璇彞鏄惁瀛樺湪娼滃湪娉ㄥ叆椋庨櫓锛堢畝鍗曟鍒欐牎楠岋級 - static bool isSafeSQL(const std::string& sql) { - // 绠�鍗曠殑姝e垯琛ㄨ揪寮忥紝闃叉甯歌鐨勬敞鍏ュ叧閿瘝 - std::regex injectionRegex("(drop|delete|update|insert|select\\s+\\*\\s+from)", std::regex_constants::icase); - return!std::regex_search(sql, injectionRegex); - } - - // 浣跨敤鍙傛暟鍖栨煡璇㈡墽琛孲QL璇彞 - static sql::ResultSet* executeSafeQuery(sql::Connection* con, const std::string& sql, const std::vector<std::string>& params) { - try { - sql::PreparedStatement* pstmt = con->prepareStatement(sql); - for (size_t i = 0; i < params.size(); ++i) { - pstmt->setString(i + 1, params[i]); - } - return pstmt->executeQuery(); - } catch (sql::SQLException& e) { - std::cerr << "鏌ヨ鎵ц閿欒: " << e.what() << std::endl; - return nullptr; - } - } -}; - -int main() { - sql::Connection* con = DatabaseUtils::connect(); - if (con) { - std::string sql = "SELECT * FROM your_table WHERE column_name =?"; - std::vector<std::string> params = {"test_value"}; - if (DatabaseUtils::isSafeSQL(sql)) { - sql::ResultSet* res = DatabaseUtils::executeSafeQuery(con, sql, params); - if (res) { - while (res->next()) { - // 澶勭悊缁撴灉 - std::cout << res->getString(1) << std::endl; - } - delete res; - } - } else { - std::cerr << "娼滃湪鐨凷QL娉ㄥ叆椋庨櫓" << std::endl; - } - delete con; - } - return 0; -} \ No newline at end of file diff --git "a/Server/\347\216\213\347\220\250\345\205\203/log/\346\227\245\345\277\227\346\250\241\346\235\277_\347\216\213\347\220\250\345\205\203_1031 .doc" "b/Server/\347\216\213\347\220\250\345\205\203/log/\346\227\245\345\277\227\346\250\241\346\235\277_\347\216\213\347\220\250\345\205\203_1031 .doc" new file mode 100644 index 0000000..45c9110 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/log/\346\227\245\345\277\227\346\250\241\346\235\277_\347\216\213\347\220\250\345\205\203_1031 .doc" Binary files differ diff --git "a/Server/\350\203\241\345\256\266\346\230\216/log/\346\227\245\345\277\227_\350\203\241\345\256\266\346\230\216_1101.doc" "b/Server/\350\203\241\345\256\266\346\230\216/log/\346\227\245\345\277\227_\350\203\241\345\256\266\346\230\216_1101.doc" new file mode 100644 index 0000000..ffdb92b --- /dev/null +++ "b/Server/\350\203\241\345\256\266\346\230\216/log/\346\227\245\345\277\227_\350\203\241\345\256\266\346\230\216_1101.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/log/20241101\346\230\206\344\273\221\346\227\245\346\212\245.doc" "b/Server/\351\251\254\346\270\235\346\235\255/log/20241101\346\230\206\344\273\221\346\227\245\346\212\245.doc" new file mode 100644 index 0000000..27eef8f --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/log/20241101\346\230\206\344\273\221\346\227\245\346\212\245.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241030.doc" "b/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241031.doc" similarity index 100% rename from "Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241030.doc" rename to "Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241031.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241101.doc" "b/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241101.doc" new file mode 100644 index 0000000..75600f2 --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/log/\346\227\245\345\277\227_\351\251\254\346\270\235\346\235\255_20241101.doc" Binary files differ diff --git a/common.h b/common.h index 664c4bd..f334c31 100644 --- a/common.h +++ b/common.h @@ -561,10 +561,11 @@ // 璀︽姤璇锋眰缁撴瀯浣� struct WarningReq { Head head; - float oxygen; // 姘ф皵娴撳害 - float carbon; // 涓�姘у寲纰虫祿搴� - float temp; // 娓╁害 - float humidity; // 婀垮害 + + float oxygenWarning; + float carbonWarning; + float tempWarning; + float humidityWarning; WarningReq() { head.type = WARNING_REQ; @@ -572,6 +573,22 @@ } }; + +struct DataThreshold{ + //闃堝�� + float oxygenThreshold; + float carbonThreshold; + float tempThreshold; + float humidityThreshold; +}; + +struct Data{ + float oxygen; // 姘ф皵娴撳害 + float carbon; // 涓�姘у寲纰虫祿搴� + float temp; // 娓╁害 + float humidity; // 婀垮害 +}; + // 璀︽姤鍝嶅簲缁撴瀯浣� struct WarningRes { Head head; -- Gitblit v1.8.0