From 2303163f4c0109057af678ca49428653ee8c6dfd Mon Sep 17 00:00:00 2001 From: wangky <m1561510467@163.com> Date: 星期四, 31 十月 2024 15:27:55 +0800 Subject: [PATCH] Merge branch 'master' of ssh://115.28.86.8:29418/~admin/昆仑_1025 --- Client/李宵增/document/历史查询分析模块需求分析.docx | 0 Client/姜可庚/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user | 2 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.cpp | 10 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave | 109 ++++++++++++++++++ Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.h | 18 +- Client/王鑫鑫/log/昆仑_1031项目日报.doc | 0 Client/申烜/document/注册登录数据库表.docx | 0 Server/马渝杭/code/common.h | 164 +++++++++++++++++++++++++++ Client/宋昊昳/log/日志_宋昊昳_1031.doc | 0 /dev/null | 0 Server/马渝杭/log/日志_马渝杭_20241030.doc | 0 Client/宋昊昳/document/系统设置需求分析.docx | 0 Client/姜可庚/code/2024kunlun_project_permisson/permissonwindow.cpp | 2 Server/李转转/log/log_1031.doc | 0 Client/李宵增/log/历史查询_李宵增_1030.doc | 0 15 files changed, 288 insertions(+), 17 deletions(-) diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user" index 07f68c6..1e45d46 100644 --- "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user" +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user" @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.5.0, 2024-10-31T13:04:10. --> +<!-- Written by QtCreator 4.5.0, 2024-10-31T15:06:39. --> <qtcreator> <data> <variable>EnvironmentId</variable> diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" index 264c552..7a533e6 100644 --- "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" @@ -2,7 +2,7 @@ #include <QMessageBox> -PmsClientSocket::PmsClientSocket(QObject * parent):QObject(parent) +PmsClientSocket::PmsClientSocket(QWidget * parent):QWidget(parent) { client = new QTcpSocket(this); @@ -70,8 +70,8 @@ vector<PmsQueryResult> vecs; for(int i =0;i<100;i++){ - if(*(int *)&res->pmsList[i]){ - PmsRes structRes = res->pmsList[i]; + PmsRes structRes =res->pmsList[i]; + if(*(int *)&structRes){ PmsQueryResult res; res.setName(string(structRes.name)); res.setUserNo(string(structRes.userNo)); @@ -100,8 +100,8 @@ if(res->success){ QString dlgTitle = "鏇存柊缁撴灉"; QString strInfo = "鏉冮檺淇℃伅鏇存柊鎴愬姛"; -// QMessageBox::information(this,dlgTitle,strInfo, -// QMessageBox::Ok, QMessageBox::NoButton); + QMessageBox::information(this,dlgTitle,strInfo, + QMessageBox::Ok, QMessageBox::NoButton); }else{ // QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触"); } diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave" new file mode 100644 index 0000000..bf4d8d6 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave" @@ -0,0 +1,109 @@ +锘�#include "PmsClientSocket.h" + +#include <QMessageBox> + +PmsClientSocket::PmsClientSocket(QWidget * parent):QWidget(parent) +{ + client = new QTcpSocket(this); + + client->connectToHost(targetIp,port); + if(!client->waitForConnected(3000)){ + + qDebug()<< "QT缃戠粶閫氫俊,杩炴帴鏈嶅姟绔け璐ワ紒"; + return; + } + connectSuccess = true; + qDebug()<< "QT缃戠粶閫氫俊鎴愬姛宸茶繛鎺ユ湇鍔″櫒锛�"; + connect(client,SIGNAL(connected()),this,SLOT(connected_Slot())); + +} + +void PmsClientSocket::queryAllUserAboutUser() +{ + if(connectSuccess){ + QueryPmsRequest req; + client->write((char *)&req,req.head.len); + qDebug() << "鏌ヨ鍏ㄩ儴鏉冮檺璇锋眰鍙戦�佹垚鍔�"; + } + +} +void PmsClientSocket::queryPmsByParam(PmsParam param) +{ + if(connectSuccess){ + QueryPmsRequest req; + strcpy(req.name,param.getName().c_str()); + strcpy(req.permissonType,param.getPermissonType().c_str()); + strcpy(req.userNo,param.getUserNo().c_str()); + client->write((char *)&req,req.head.len); + qDebug() << "鏉′欢鏌ヨ鏉冮檺璇锋眰鍙戦�佹垚鍔�"; + } +} + +void PmsClientSocket::updatePmsByParam(PmsPlusParma param) +{ + UpdatePmsRequest upReq; + upReq.devManage = param.getDevManage(); + upReq.loggerSearch = param.getLoggerSearch(); + upReq.mapMark = param.getMapMark(); + upReq.productPlan = param.getProductPlan(); + upReq.roleId = param.getRoleId(); + client->write((char *)&upReq,upReq.head.len); + qDebug() << "鏇存柊鏉冮檺璇锋眰鍙戦�佹垚鍔�"; +} + +void PmsClientSocket::connected_Slot() +{ + connect(client,SIGNAL(readyRead()),this,SLOT(readyRead_Slot())); +} + +void PmsClientSocket::readyRead_Slot() +{ + QByteArray buf = client->readAll(); + QString recvData = QString::fromLocal8Bit(buf); + qDebug()<< "client鏀跺埌鐨勬暟鎹�" << recvData; + QueryPmsResponse * res; + UpdatePmsResponse * upRes; + int type = *(int *)buf.data(); + if(type == QUERY_PMS_REQ){ + res = (QueryPmsResponse *)buf.data(); + if(res->success){ + vector<PmsQueryResult> vecs; + + for(int i =0;i<100;i++){ + PmsRes structRes =res->pmsList[i]; + if(*(int *)&structRes){ + PmsQueryResult res; + res.setName(string(structRes.name)); + res.setUserNo(string(structRes.userNo)); + res.setRoleId(structRes.roleId); + res.setStartDateTime(string(structRes.startDateTime)); + res.setEndDateTime(string(structRes.endDateTime)); + res.setLoggerSearch(structRes.loggerSearch); + res.setMapMark(structRes.mapMark); + res.setDevManage(structRes.devManage); + res.setProductPlan(structRes.productPlan); + res.setQueryHistory(structRes.queryHistory); + + res.setPermissonType(string(structRes.permissonType)); + + vecs.push_back(res); + + }else break; + } + if(!vecs.empty()){ + emit notifyDateChange(vecs); + } + } + } + if(type == UPDATE_PMS_REQ){ + res = (QueryPmsResponse *)buf.data(); + if(res->success){ + QString dlgTitle = "鏇存柊缁撴灉"; + QString strInfo = "鏉冮檺淇℃伅鏇存柊鎴愬姛"; + QMessageBox::information(this,dlgTitle,strInfo, + QMessageBox::Ok, QMessageBox::NoButton); + }else{ + QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触"); + } + } +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.h" index df200ba..2795585 100644 --- "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.h" +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.h" @@ -6,6 +6,7 @@ #include <vector> #include "pmsplusparam.h" #include <QDebug> +#include <QWidget> using namespace std; @@ -30,9 +31,9 @@ char permissonType[32]; QueryPmsRequest(){ head.type=QUERY_PMS_REQ; - userNo[32] = {0}; - name[32] = {0}; - permissonType[32] = {0}; + memset(userNo,0,32); + memset(permissonType,0,32); + memset(name,0,32); head.len = sizeof(QueryPmsRequest); } } QueryPmsRequest; @@ -54,7 +55,6 @@ // 鍗曚釜浜哄憳鏉冮檺缁撴瀯浣� typedef struct UserAboutPms{ - int queryHistory; int loggerSearch; int mapMark; @@ -66,18 +66,16 @@ char permissonType[32]; char startDateTime[32]; char endDateTime[32]; - } PmsRes; // 鏌ヨ浜哄憳鍜岃鑹蹭俊鎭殑鍝嶅簲缁撴瀯浣� typedef struct UserAboutPmsResponse{ Head head; int success; // 1涓烘垚鍔� ,0涓哄け璐� - PmsRes *pmsList; + PmsRes pmsList[100]; UserAboutPmsResponse(){ head.type=QUERY_PMS_RES; - pmsList = (PmsRes *)malloc(sizeof(PmsRes)*100); - pmsList = {0}; + memset(pmsList,0,sizeof(PmsRes)); head.len = sizeof(UserAboutPmsResponse); } } QueryPmsResponse; @@ -94,7 +92,7 @@ } UpdatePmsResponse ; -class PmsClientSocket : public QObject +class PmsClientSocket : public QWidget { Q_OBJECT @@ -106,7 +104,7 @@ bool connectSuccess= false; public: - PmsClientSocket(QObject * parent=0); + PmsClientSocket(QWidget * parent=0); void queryAllUserAboutUser(); void queryPmsByParam(PmsParam param); diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.cpp" index 7ba0016..cd23094 100644 --- "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.cpp" +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.cpp" @@ -11,7 +11,7 @@ ui(new Ui::PermissonWindow) { ui->setupUi(this); - clientSocket = new PmsClientSocket; + clientSocket = new PmsClientSocket(this); dia = new PermissonDialog(this,clientSocket); diff --git "a/Client/\345\256\213\346\230\212\346\230\263/document/\347\263\273\347\273\237\350\256\276\347\275\256\351\234\200\346\261\202\345\210\206\346\236\220.docx" "b/Client/\345\256\213\346\230\212\346\230\263/document/\347\263\273\347\273\237\350\256\276\347\275\256\351\234\200\346\261\202\345\210\206\346\236\220.docx" index 7ff6bde..58cade1 100644 --- "a/Client/\345\256\213\346\230\212\346\230\263/document/\347\263\273\347\273\237\350\256\276\347\275\256\351\234\200\346\261\202\345\210\206\346\236\220.docx" +++ "b/Client/\345\256\213\346\230\212\346\230\263/document/\347\263\273\347\273\237\350\256\276\347\275\256\351\234\200\346\261\202\345\210\206\346\236\220.docx" 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_1031.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_1031.doc" new file mode 100644 index 0000000..a58b65e --- /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_1031.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 a778b7f..6b3025b 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_1030.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_1030.doc" index 8f20d6e..8158c3a 100644 --- "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_1030.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_1030.doc" Binary files differ diff --git "a/Client/\347\216\213\351\221\253\351\221\253/log/\346\230\206\344\273\221_1031\351\241\271\347\233\256\346\227\245\346\212\245.doc" "b/Client/\347\216\213\351\221\253\351\221\253/log/\346\230\206\344\273\221_1031\351\241\271\347\233\256\346\227\245\346\212\245.doc" new file mode 100644 index 0000000..a07a550 --- /dev/null +++ "b/Client/\347\216\213\351\221\253\351\221\253/log/\346\230\206\344\273\221_1031\351\241\271\347\233\256\346\227\245\346\212\245.doc" Binary files differ diff --git "a/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\346\225\260\346\215\256\345\272\223\350\241\250.docx" "b/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\346\225\260\346\215\256\345\272\223\350\241\250.docx" new file mode 100644 index 0000000..a37ff65 --- /dev/null +++ "b/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\346\225\260\346\215\256\345\272\223\350\241\250.docx" Binary files differ diff --git "a/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\351\234\200\346\261\202\345\210\206\346\236\220.docx" "b/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\351\234\200\346\261\202\345\210\206\346\236\220.docx" deleted file mode 100644 index 366835e..0000000 --- "a/Client/\347\224\263\347\203\234/document/\346\263\250\345\206\214\347\231\273\345\275\225\351\234\200\346\261\202\345\210\206\346\236\220.docx" +++ /dev/null Binary files differ diff --git "a/Server/\346\235\216\350\275\254\350\275\254/log/log_1031.doc" "b/Server/\346\235\216\350\275\254\350\275\254/log/log_1031.doc" new file mode 100644 index 0000000..08ede4d --- /dev/null +++ "b/Server/\346\235\216\350\275\254\350\275\254/log/log_1031.doc" Binary files differ diff --git "a/Server/\351\251\254\346\270\235\346\235\255/code/common.h" "b/Server/\351\251\254\346\270\235\346\235\255/code/common.h" new file mode 100644 index 0000000..b6c770d --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/code/common.h" @@ -0,0 +1,164 @@ +#ifndef COMMON_H +#define COMMON_H +#include <string.h> +//绉佹湁鍗忚灏佽 + +//璇锋眰鍝嶅簲缁撴瀯浣撴湁鏁版嵁澶�+鏁版嵁浣� + +//浣跨敤鏋氫妇鏉ョ粺涓�鍚勭鍔熻兘绫诲瀷銆� + +enum TypeInfo{ + LOGIN_REQ, //鐧诲綍璇锋眰 + LOGIN_RES, + VERSIONUPDATA_REQ, // 鐗堟湰鏇存柊璇锋眰 + VERSIONUPDATA_RES, + VERSIONNUM_REQ, //鐗堟湰鍙疯姹� + VERSIONNUM_RES, + UPLOAD_FILE_REQ, + UPLOAD_FILE_RES, + VERSIONINFOENTRY_REQ, //鐗堟湰淇℃伅鏉$洰 + VERSIONINFOENTRY_RES +}; + +struct Head +{ + int type; // 鍔熻兘绫诲瀷锛岃В鍐虫瘡涓寘鐨勫叿浣撲綔鐢紝鍖哄垎涓氬姟 + int len; //灏佸寘闀垮害 + +}; +// 鐧诲綍涓氬姟 +// 鐧诲綍璇锋眰 +struct LoginReq +{ + Head head; + + char user_name[32]; + char password[32]; + LoginReq(){ + head.type=LOGIN_REQ; + head.len=sizeof(LoginReq); + } +}; +//鐧诲綍鏉冮檺缁撴瀯浣� +struct PermissionInfo +{ + int admin; //绠$悊鍛� + int history; //鍘嗗彶鏌ョ湅 + int version_manager;//鐗堟湰绠$悊 + int log_search; //鏃ュ織鏌ョ湅 + int flaw_mark ; //缂洪櫡鏍囪 + +}; + +//鐧诲綍鍝嶅簲 +struct LoginRes +{ + Head head; + char user_name[32]; + int state; // 鐧诲綍鐘舵�� + PermissionInfo per; + LoginRes(){ + head.type=LOGIN_RES; + head.len=sizeof(LoginRes); + } +}; +struct VersionUpdataReq //鐗堟湰鏇存柊璇锋眰鐨勭粨鏋勪綋 +{ + Head head; + VersionUpdataReq(){ + head.type=VERSIONUPDATA_REQ; + head.len=sizeof(VersionUpdataReq); + } +}; +struct VersionUpdataRes //鐗堟湰鏇存柊鍝嶅簲鐨勭粨鏋勪綋 +{ + Head head; + char version_id[64]; // 鐗堟湰鍙� + char update_date[32]; //鏇存柊鏃堕棿 + char file_path[128]; //鏈嶅姟绔彁渚涙渶鏂扮増鏈殑鏈湴璺緞 + VersionUpdataRes(){ + head.type=VERSIONUPDATA_REQ; + head.len=sizeof(VersionUpdataReq); + } +}; +struct VersionNumReq //鐗堟湰鍙疯姹� +{ + Head head; + VersionNumReq(){ + head.type=VERSIONNUM_REQ; + head.len=sizeof(VersionNumReq); + } +}; +struct VersionNumRes +{ + Head head; + char version_id[64]; + VersionNumRes(){ + head.type=VERSIONNUM_RES; + head.len=sizeof(VersionNumRes); + } +}; +//鏂囦欢浼犺緭鍔熻兘 +struct FileInfo +{ + char file_name[256]; + long long file_size; + char s_filepath[32]; + char content[0]; //鏌旀�ф暟缁勭粨鏋勪綋 +}; +struct UploadFileReq +{ + Head head; + FileInfo fileInfo; + UploadFileReq(){ + head.type=UPLOAD_FILE_REQ; + head.len=sizeof(UploadFileReq); + } +}; +struct UploadFileRes +{ + Head head; + int status; + long long file_size; //鎬诲ぇ灏� + long long file_cuesize; //鏂囦欢宸蹭紶澶у皬 + UploadFileRes(){ + head.type=UPLOAD_FILE_RES; + head.len=sizeof(UploadFileRes); + } +}; +//鐗堟湰淇℃伅褰曞叆---鐗堟湰淇℃伅鏉$洰 +struct VersionInfoEntryReq +{ + Head head; + char version_id[64]; + char version_id_old[64]; + char s_filepath[32]; //鏈嶅姟鍣ㄦ斁鏈�鏂扮増鏈殑璺緞 + char version_description[256]; //鏇存柊鎻忚堪 + char version_creattime[32]; //鏇存柊鏃堕棿 + char filename[16][128]; //鏀寔澶氭枃浠朵笂浼� + long long filesize[16]; //鏂囦欢缁勭殑澶у皬 + char c_filepath[16][128]; //瀹㈡埛绔殑瀹夎璺緞 + int filenum; //涓�娆$増鏈洿鏂版墍闇�鏂囦欢涓暟 + + VersionInfoEntryReq(){ + head.type=VERSIONINFOENTRY_REQ; + head.len=sizeof(VersionInfoEntryReq); + } +}; +//鍝嶅簲 +struct VersionInfoEntryRes { + Head head; + char version_id_old[64]; // 鐗堟湰鍙� + VersionInfoEntryRes() + { + head.type = VERSIONINFOENTRY_RES; + head.len = sizeof(VersionInfoEntryRes); + } +}; + + + + + + +#endif // COMMON_H 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_20241030.doc" new file mode 100644 index 0000000..3171038 --- /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_20241030.doc" Binary files differ -- Gitblit v1.8.0