From 74a7faf2cbde2efdc02df4f96cf4e15a33b5750c Mon Sep 17 00:00:00 2001 From: lzh <3394874942@qq.com> Date: 星期五, 01 十一月 2024 10:46:10 +0800 Subject: [PATCH] Merge branch 'master' of ssh://115.28.86.8:29418/~admin/昆仑_1025 --- Client/李宵增/document/历史查询分析模块需求分析.docx | 0 Server/王琨元/code/MysqlConn.h | 63 Server/马渝杭/log/20241031昆仑日报.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/mainwindow.cpp | 14 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave | 109 + Client/王鑫鑫/log/昆仑_1031项目日报.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/main.cpp | 13 Client/黎弘霖/log/设备管理_黎弘霖_1031.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/syncdatatodb.h | 48 Client/宋昊昳/log/日志_宋昊昳_1031.doc | 0 Server/王琨元/code/ConnectionPool.cpp | 131 + Client/姜可庚/code/2024kunlun_project_permisson/permissonwindow.h | 57 Server/王琨元/document/建表.docx | 0 Client/姜可庚/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user | 809 +++++++++++ Client/姜可庚/code/2024kunlun_project_permisson/modeldisplay.h | 22 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.cpp | 104 + Client/姜可庚/code/2024kunlun_project_permisson/permissondialog.h | 38 Client/郑凯文/document/昆仑1031_项目日报.doc | 0 Server/陈楚丹/log/日志_陈楚丹_1031.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/mainwindow.ui | 24 Client/姜可庚/code/2024kunlun_project_permisson/permissondialog.cpp | 88 + Client/申烜/document/注册登录数据库表.docx | 0 Server/马渝杭/code/common.h | 164 ++ Server/王琨元/log/日志模板_王琨元_1030.doc | 0 Server/王琨元/code/MysqlConn.cpp | 174 ++ Server/马渝杭/log/日志_马渝杭_20241030.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/mainwindow.h | 22 Server/马丽萍/code/log/log.cpp | 209 ++ Client/黎弘霖/code/Devices_Management_Struct.h | 107 + common.h | 714 ++++++++++ Client/姜可庚/code/2024kunlun_project_permisson/permissondialog.ui | 302 ++++ Server/胡家明/log/日志_胡家明_1031.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/qcomboxdelegate.h | 27 Client/申烜/log/日志_注册登录_2024.10.31.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/permissonwindow.ui | 86 + Client/姜可庚/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro | 56 Client/郑凯文/log/郑凯文1031.doc | 0 Client/冀浩昶/log/日志_冀浩昶_1031.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/qcomboxdelegate.cpp | 40 Client/姜可庚/code/2024kunlun_project_permisson/modeldisplay.cpp | 14 Server/王琨元/code/ConnectionPool.h | 54 Client/姜可庚/code/2024kunlun_project_permisson/modeldisplay.ui | 32 Client/姜可庚/code/2024kunlun_project_permisson/pmsqueryresult.h | 73 + Client/姜可庚/code/2024kunlun_project_permisson/pmsparam.h | 43 Client/姜可庚/code/2024kunlun_project_permisson/pmsplusparam.h | 65 Client/郑凯文/log/郑凯文1030.doc | 0 Server/马丽萍/log/log_1031.doc | 0 Client/王鑫鑫/log/日志_王鑫鑫_1031.doc | 0 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.h | 122 + Client/姜可庚/log/姜可庚_1031.doc | 0 Server/马丽萍/document/日志需求分析文档.docx | 0 Client/姜可庚/code/2024kunlun_project_permisson/syncdatatodb.cpp | 94 + /dev/null | 0 Client/宋昊昳/document/系统设置需求分析.docx | 0 Client/姜可庚/code/2024kunlun_project_permisson/permissonwindow.cpp | 166 ++ Client/姜可庚/log/姜可庚_1030.doc | 0 Server/马丽萍/code/log/log.h | 46 Server/李转转/log/log_1031.doc | 0 Client/冀浩昶/document/生产计划管理_需求分析.docx | 0 Client/李宵增/log/历史查询_李宵增_1030.doc | 0 60 files changed, 4,068 insertions(+), 62 deletions(-) diff --git "a/Client/\345\206\200\346\265\251\346\230\266/document/\347\224\237\344\272\247\350\256\241\345\210\222\347\256\241\347\220\206_\351\234\200\346\261\202\345\210\206\346\236\220.docx" "b/Client/\345\206\200\346\265\251\346\230\266/document/\347\224\237\344\272\247\350\256\241\345\210\222\347\256\241\347\220\206_\351\234\200\346\261\202\345\210\206\346\236\220.docx" index 9d55fac..8b40728 100644 --- "a/Client/\345\206\200\346\265\251\346\230\266/document/\347\224\237\344\272\247\350\256\241\345\210\222\347\256\241\347\220\206_\351\234\200\346\261\202\345\210\206\346\236\220.docx" +++ "b/Client/\345\206\200\346\265\251\346\230\266/document/\347\224\237\344\272\247\350\256\241\345\210\222\347\256\241\347\220\206_\351\234\200\346\261\202\345\210\206\346\236\220.docx" 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_1031.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_1031.doc" new file mode 100644 index 0000000..f77c0ed --- /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_1031.doc" Binary files differ diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro" new file mode 100644 index 0000000..e11cc5c --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro" @@ -0,0 +1,56 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2024-10-29T15:47:42 +# +#------------------------------------------------- + +QT += core gui network + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = 2024kunlun_project_permisson +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + + + + + + +unix|win32: LIBS += -L$$PWD/../ThreeExmapleDisplay/mysql-connector-c-noinstall-6.0.2-win32/lib/ -llibmysql + +INCLUDEPATH += $$PWD/../ThreeExmapleDisplay/mysql-connector-c-noinstall-6.0.2-win32/include +DEPENDPATH += $$PWD/../ThreeExmapleDisplay/mysql-connector-c-noinstall-6.0.2-win32/include + +FORMS += \ + permissondialog.ui \ + permissonwindow.ui + +HEADERS += \ + permissondialog.h \ + permissonwindow.h \ + pmsparam.h \ + pmsplusparam.h \ + pmsqueryresult.h \ + qcomboxdelegate.h \ + syncdatatodb.h \ + PmsClientSocket.h + +SOURCES += \ + main.cpp \ + permissondialog.cpp \ + permissonwindow.cpp \ + qcomboxdelegate.cpp \ + syncdatatodb.cpp \ + PmsClientSocket.cpp 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" new file mode 100644 index 0000000..afa3031 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user" @@ -0,0 +1,809 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by QtCreator 4.5.0, 2024-10-31T16:02:45. --> +<qtcreator> + <data> + <variable>EnvironmentId</variable> + <value type="QByteArray">{46516c51-2f4e-4d5d-a484-8049bf7097d3}</value> + </data> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value type="bool" key="EditorConfiguration.AutoIndent">true</value> + <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> + <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> + <value type="QString" key="language">Cpp</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> + </valuemap> + </valuemap> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> + <value type="QString" key="language">QmlJS</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> + </valuemap> + </valuemap> + <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> + <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> + <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> + <value type="int" key="EditorConfiguration.IndentSize">4</value> + <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> + <value type="int" key="EditorConfiguration.MarginColumn">80</value> + <value type="bool" key="EditorConfiguration.MouseHiding">true</value> + <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> + <value type="int" key="EditorConfiguration.PaddingMode">1</value> + <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> + <value type="bool" key="EditorConfiguration.ShowMargin">false</value> + <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> + <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> + <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> + <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> + <value type="int" key="EditorConfiguration.TabSize">8</value> + <value type="bool" key="EditorConfiguration.UseGlobal">true</value> + <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> + <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> + <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> + <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> + <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.PluginSettings</variable> + <valuemap type="QVariantMap"/> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.4 MinGW 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.4 MinGW 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.594.win32_mingw53_kit</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MinGW_32bit-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MinGW_32bit-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MinGW_32bit-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">閮ㄧ讲</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鍦ㄦ湰鍦伴儴缃�</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">2</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">2024kunlun_project_permisson</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Qt/project/2024kunlun_project_permisson/2024kunlun_project_permisson.pro</value> + <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">2024kunlun_project_permisson.pro</value> + <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MinGW_32bit-Debug</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.Target.1</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.4 MSVC2015 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.4 MSVC2015 32bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.594.win32_msvc2015_kit</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_32bit-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_32bit-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_32bit-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">閮ㄧ讲</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鍦ㄦ湰鍦伴儴缃�</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">2</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">2024kunlun_project_permisson</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Qt/project/2024kunlun_project_permisson/2024kunlun_project_permisson.pro</value> + <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">2024kunlun_project_permisson.pro</value> + <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> + <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MinGW_32bit-Debug</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.Target.2</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.4 MSVC2015 64bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.4 MSVC2015 64bit</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.594.win64_msvc2015_64_kit</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_64bit-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_64bit-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/project/build-2024kunlun_project_permisson-Desktop_Qt_5_9_4_MSVC2015_64bit-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鏋勫缓</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">娓呯悊</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">閮ㄧ讲</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">鍦ㄦ湰鍦伴儴缃�</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">-1</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">3</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">18</value> + </data> + <data> + <variable>Version</variable> + <value type="int">18</value> + </data> +</qtcreator> 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" new file mode 100644 index 0000000..8449947 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" @@ -0,0 +1,104 @@ +锘�#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; + int pmsLen = res->head.len-sizeof(QueryPmsResponse); + for(int i =0;i<pmsLen;i+=sizeof(PmsRes)){ + PmsRes structRes = *(PmsRes*)(res + sizeof(QueryPmsResponse) + i*sizeof(PmsRes)); + 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); + } + 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.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" new file mode 100644 index 0000000..0a0e535 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.h" @@ -0,0 +1,122 @@ +锘�#ifndef PMSCLINETSOCKET_H +#define PMSCLINETSOCKET_H +#include <QTcpSocket> +#include <string> +#include "pmsqueryresult.h" +#include <vector> +#include "pmsplusparam.h" +#include <QDebug> +#include <QWidget> + +using namespace std; + +struct Head{ + int type; + int len; +}; + +enum option{ + QUERY_PMS_REQ, + UPDATE_PMS_REQ, + QUERY_PMS_RES, + UPDATE_PMS_RES, +}; + + +// 鎸夊憳宸ョ紪鍙枫�佸悕瀛楁垨鑱屼綅鏌ヨ浜哄憳鏉冮檺淇℃伅璇锋眰 +typedef struct QueryPmsRequest{ + Head head; + char userNo[32]; + char name[32]; + char permissonType[32]; + QueryPmsRequest(){ + head.type=QUERY_PMS_REQ; + memset(userNo,0,32); + memset(permissonType,0,32); + memset(name,0,32); + head.len = sizeof(QueryPmsRequest); + } +} QueryPmsRequest; + +// 鎸夎鑹瞚d鏇存柊鏉冮檺淇℃伅璇锋眰 +typedef struct UpdatePmsRequest{ + Head head; + int roleId; + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; + UpdatePmsRequest(){ + head.type=QUERY_PMS_RES; + head.len = sizeof(UpdatePmsRequest); + } +} UpdatePmsRequest; + +// 鍗曚釜浜哄憳鏉冮檺缁撴瀯浣� +typedef struct UserAboutPms{ + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; + int roleId; + char userNo[32]; + char name[32]; + char permissonType[32]; + char startDateTime[32]; + char endDateTime[32]; +} PmsRes; + +// 鏌ヨ浜哄憳鍜岃鑹蹭俊鎭殑鍝嶅簲缁撴瀯浣� +typedef struct UserAboutPmsResponse{ + Head head; + int success; // 1涓烘垚鍔� ,0涓哄け璐� + //PmsRes pmsList[100]; + char pmsList[0]; + UserAboutPmsResponse(){ + head.type=QUERY_PMS_RES; +// memset(pmsList,0,sizeof(PmsRes)); +// head.len = sizeof(UserAboutPmsResponse); + } +} QueryPmsResponse; + +// 鏉冮檺鏇存柊缁撴灉鍝嶅簲浣� +typedef struct UpdatePmsResponse{ + Head head; + int success; // 1涓烘垚鍔� ,0涓哄け璐� + UpdatePmsResponse(){ + head.type = UPDATE_PMS_RES; + head.len = sizeof(UpdatePmsResponse); + } + +} UpdatePmsResponse ; + + +class PmsClientSocket : public QWidget +{ + Q_OBJECT + + QTcpSocket *client; + + int port=88888; + QString targetIp = "127.0.0.1"; + + bool connectSuccess= false; + +public: + PmsClientSocket(QWidget * parent=0); + void queryAllUserAboutUser(); + + void queryPmsByParam(PmsParam param); + + void updatePmsByParam(PmsPlusParma param); +signals: + void notifyDateChange(vector<PmsQueryResult>); + +private slots: + void connected_Slot(); //澹版槑妲藉嚱鏁� + void readyRead_Slot(); +}; + +#endif // PMSCLINETSOCKET_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/main.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/main.cpp" new file mode 100644 index 0000000..9200eaf --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/main.cpp" @@ -0,0 +1,13 @@ +锘�#include "permissonwindow.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + PermissonWindow w; + w.show(); + QString dlgTitle = "鏇存柊缁撴灉"; + QString strInfo = "鏉冮檺淇℃伅鏇存柊鎴愬姛"; + + return a.exec(); +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.cpp" new file mode 100644 index 0000000..9a2b266 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.cpp" @@ -0,0 +1,14 @@ +锘�#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.h" new file mode 100644 index 0000000..10c706e --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.h" @@ -0,0 +1,22 @@ +锘�#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.ui" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.ui" new file mode 100644 index 0000000..0a06936 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/mainwindow.ui" @@ -0,0 +1,24 @@ +<ui version="4.0"> + <author/> + <comment/> + <exportmacro/> + <class>MainWindow</class> + <widget name="MainWindow" class="QMainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <widget name="menubar" class="QMenuBar"/> + <widget name="centralwidget" class="QWidget"/> + <widget name="statusbar" class="QStatusBar"/> + </widget> + <pixmapfunction/> + <connections/> +</ui> diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.cpp" new file mode 100644 index 0000000..e645808 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.cpp" @@ -0,0 +1,14 @@ +#include "modeldisplay.h" +#include "ui_modeldisplay.h" + +modelDisplay::modelDisplay(QWidget *parent) : + QWidget(parent), + ui(new Ui::modelDisplay) +{ + ui->setupUi(this); +} + +modelDisplay::~modelDisplay() +{ + delete ui; +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.h" new file mode 100644 index 0000000..7d94869 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.h" @@ -0,0 +1,22 @@ +#ifndef MODELDISPLAY_H +#define MODELDISPLAY_H + +#include <QWidget> + +namespace Ui { +class modelDisplay; +} + +class modelDisplay : public QWidget +{ + Q_OBJECT + +public: + explicit modelDisplay(QWidget *parent = 0); + ~modelDisplay(); + +private: + Ui::modelDisplay *ui; +}; + +#endif // MODELDISPLAY_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.ui" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.ui" new file mode 100644 index 0000000..5fe7e47 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/modeldisplay.ui" @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>modelDisplay</class> + <widget class="QWidget" name="modelDisplay"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>120</x> + <y>160</y> + <width>72</width> + <height>15</height> + </rect> + </property> + <property name="text"> + <string>妯℃��</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.cpp" new file mode 100644 index 0000000..98d0f81 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.cpp" @@ -0,0 +1,88 @@ +锘�#include "permissondialog.h" +#include "ui_permissondialog.h" + +PermissonDialog::PermissonDialog(QWidget *parent,PmsClientSocket * client) : + QDialog(parent), + client(client), + ui(new Ui::PermissonDialog) +{ + ui->setupUi(this); + + map<int,QRadioButton *> map1; + map1[0]=ui->radioButton; + map1[1]=ui->radioButton_2; + map1[2]=ui->radioButton_3; + + map<int,QRadioButton *> map2; + map2[0]=ui->radioButton_4; + map2[1]=ui->radioButton_5; + map2[2]=ui->radioButton_6; + + map<int,QRadioButton *> map3; + map3[0]=ui->radioButton_7; + map3[1]=ui->radioButton_8; + map3[2]=ui->radioButton_9; + + map<int,QRadioButton *> map4; + map4[0]=ui->radioButton_10; + map4[1]=ui->radioButton_11; + map4[2]=ui->radioButton_12; + + map<int,QRadioButton *> map5; + map5[0]=ui->radioButton_13; + map5[1]=ui->radioButton_14; + map5[2]=ui->radioButton_15; + + + btnList.push_back(map1); + btnList.push_back(map2); + btnList.push_back(map3); + btnList.push_back(map4); + btnList.push_back(map5); + +} + +PermissonDialog::~PermissonDialog() +{ + delete ui; +} + +int PermissonDialog::findBoxCheck(map<int, QRadioButton *> map) +{ + for(int i =0;i<map.size();i++){ + if(btnList[0][i]->isChecked()){ + return i; + } + } +} + +void PermissonDialog::recvUserNo(PmsQueryResult res) +{ + + // 濉厖checkbox + btnList[0][res.getQueryHistory()]->setChecked(true); + btnList[1][res.getLoggerSearch()]->setChecked(true); + btnList[2][res.getMapMark()]->setChecked(true); + btnList[3][res.getDevManage()]->setChecked(true); + btnList[4][res.getProductPlan()]->setChecked(true); + + curRes = res; + +} + + +void PermissonDialog::on_buttonBox_accepted() +{ + qDebug()<< "鍙戦�佹洿鏂拌姹�"; + PmsPlusParma param; + + param.setQueryHistory(findBoxCheck(btnList[0])); + param.setLoggerSearch(findBoxCheck(btnList[1])); + param.setMapMark(findBoxCheck(btnList[2])); + param.setDevManage(findBoxCheck(btnList[3])); + param.setProductPlan(findBoxCheck(btnList[4])); + + param.setRoleId(curRes.getRoleId()); + client->updatePmsByParam(param); + +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.h" new file mode 100644 index 0000000..ecf68b2 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.h" @@ -0,0 +1,38 @@ +锘�#ifndef PERMISSONDIALOG_H +#define PERMISSONDIALOG_H + +#include <QDialog> +#include "PmsClientSocket.h" +#include <qradiobutton.h> +#include <vector> +#include <map> +#include <QDebug> +using namespace std; + +namespace Ui { +class PermissonDialog; +} + +class PermissonDialog : public QDialog +{ + Q_OBJECT +public: + explicit PermissonDialog(QWidget *parent,PmsClientSocket * client); + ~PermissonDialog(); +private: + Ui::PermissonDialog *ui; + + PmsClientSocket * client; + + vector<map<int,QRadioButton *>> btnList; + + int findBoxCheck(map<int,QRadioButton *> map); + + PmsQueryResult curRes; + +private slots: + void recvUserNo(PmsQueryResult pms); + void on_buttonBox_accepted(); +}; + +#endif // PERMISSONDIALOG_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.ui" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.ui" new file mode 100644 index 0000000..2701441 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissondialog.ui" @@ -0,0 +1,302 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PermissonDialog</class> + <widget class="QDialog" name="PermissonDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>421</width> + <height>361</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>鍘嗘椂鏌ヨ</string> + </property> + <widget class="QRadioButton" name="radioButton"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鏃犳潈闄�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_2"> + <property name="geometry"> + <rect> + <x>150</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙煡鐪�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_3"> + <property name="geometry"> + <rect> + <x>280</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙慨鏀�</string> + </property> + </widget> + </widget> + </item> + <item row="1" column="0"> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>鏃ュ織鏌ヨ</string> + </property> + <widget class="QRadioButton" name="radioButton_4"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鏃犳潈闄�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_5"> + <property name="geometry"> + <rect> + <x>150</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙煡鐪�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_6"> + <property name="geometry"> + <rect> + <x>280</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙慨鏀�</string> + </property> + </widget> + </widget> + </item> + <item row="2" column="0"> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>鍦板浘鏍囨敞</string> + </property> + <widget class="QRadioButton" name="radioButton_7"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鏃犳潈闄�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_8"> + <property name="geometry"> + <rect> + <x>150</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙煡鐪�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_9"> + <property name="geometry"> + <rect> + <x>280</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙慨鏀�</string> + </property> + </widget> + </widget> + </item> + <item row="3" column="0"> + <widget class="QGroupBox" name="groupBox_4"> + <property name="title"> + <string>璁惧绠$悊</string> + </property> + <widget class="QRadioButton" name="radioButton_10"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鏃犳潈闄�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_11"> + <property name="geometry"> + <rect> + <x>150</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙煡鐪�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_12"> + <property name="geometry"> + <rect> + <x>280</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙慨鏀�</string> + </property> + </widget> + </widget> + </item> + <item row="4" column="0"> + <widget class="QGroupBox" name="groupBox_5"> + <property name="title"> + <string>鐢熶骇璁″垝</string> + </property> + <widget class="QRadioButton" name="radioButton_13"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鏃犳潈闄�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_14"> + <property name="geometry"> + <rect> + <x>150</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙煡鐪�</string> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_15"> + <property name="geometry"> + <rect> + <x>280</x> + <y>20</y> + <width>115</width> + <height>19</height> + </rect> + </property> + <property name="text"> + <string>鍙慨鏀�</string> + </property> + </widget> + </widget> + </item> + </layout> + </item> + <item row="1" column="0"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>PermissonDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>PermissonDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> 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" new file mode 100644 index 0000000..71580ef --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.cpp" @@ -0,0 +1,166 @@ +锘�#include "permissonwindow.h" +#include "qcomboxdelegate.h" +#include "ui_permissonwindow.h" + +#include <QDialog> +#include <QMouseEvent> +#include <QPushButton> + +PermissonWindow::PermissonWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::PermissonWindow) +{ + ui->setupUi(this); + clientSocket = new PmsClientSocket(this); + + dia = new PermissonDialog(this,clientSocket); + + + + connect(this,SIGNAL(sendUserNo(PmsQueryResult)),dia,SLOT(recvUserNo(PmsQueryResult))); + connect(clientSocket,SIGNAL(notifyDateChange(vector<PmsQueryResult>)),this,SLOT(renderItemData(vector<PmsQueryResult>))); + + roleMap["鏅�氶噰鐭垮憳宸�"] = 1; + roleMap["鎶�鏈淮鎶や汉鍛�"] = 2; + roleMap["绯荤粺绠$悊鍛�"] = 3; + roleMap["瀹夊叏绠$悊浜哄憳"] = 4; + + this->setWindowTitle("鏉冮檺绠$悊"); + vector<QString> lableList; + lableList.push_back("鍛樺伐缂栧彿"); + lableList.push_back("濮撳悕"); + lableList.push_back("褰撳ぉ宸ヤ綔鏃堕棿"); + lableList.push_back("褰撳ぉ缁撴潫鏃堕棿"); + lableList.push_back("鑱屼綅"); + + + + m_model = new QStandardItemModel(globalPms.size(),lableList.size(),this); + + ui->tableView->setModel(m_model); + + for(int i=0;i<m_model->rowCount();i++){ + PmsQueryResult curRes = globalPms[i]; + m_model->setItem(i,0,new QStandardItem(QString::fromStdString(curRes.getUserNo()))); + m_model->setItem(i,1,new QStandardItem(QString::fromLocal8Bit(curRes.getName().c_str()))); + m_model->setItem(i,2,new QStandardItem(QString::fromStdString(curRes.getStartDateTime()))); + m_model->setItem(i,3,new QStandardItem(QString::fromStdString(curRes.getEndDateTime()))); + m_model->setItem(i,4,new QStandardItem(QString::fromLocal8Bit(curRes.getPermissonType().c_str()))); + + } + + ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + ui->tableView->verticalHeader()->hide(); + + + QStringList lable; + for(int i=0;i<m_model->columnCount();i++){ + lable << lableList.at(i); + } + + m_model->setHorizontalHeaderLabels(lable); + + QComBoxDelegate * qc = new QComBoxDelegate(this); + + + + ui->tableView->setItemDelegateForColumn(4,qc); + + + m = new QMenu(this); + QAction * ac1 = new QAction("缂栬緫褰撳墠鍛樺伐鏉冮檺"); + + + m->addAction(ac1); + + + ui->tableView->viewport()->installEventFilter(this); + + + + + connect(ac1,&QAction::triggered,[=]{ + int row = ui->tableView->currentIndex().row(); + qDebug() << "鏇存柊褰撳墠鍛樺伐淇℃伅" + << QString::fromStdString( globalPms[row].getUserNo()); + // 鍙戦�佸憳宸ョ紪鍙蜂俊鎭� + emit sendUserNo(globalPms[row]); + + dia->setModal(true); + dia->show(); + }); + + + connect(m_model,SIGNAL(itemChanged(QStandardItem*)),this,SLOT(listenItemChange(QStandardItem*))); + + +} + +bool PermissonWindow::eventFilter(QObject *watch, QEvent *event) +{ + if(watch == ui->tableView->viewport() || watch == ui->tableView->verticalHeader()->viewport() + + || watch == ui->tableView->horizontalHeader()->viewport()){ + if(event->type()==QEvent::MouseButtonPress + && ((QMouseEvent *)event)->button()==Qt::RightButton + && m_model->rowCount() > 0){ + m->exec(QCursor::pos()); + } + + } + return QMainWindow::eventFilter(watch,event); +} + + +PermissonWindow::~PermissonWindow() +{ + delete dbInfo; + delete dia; + delete m_model; + delete m; + delete ui; +} + +void PermissonWindow::on_pushButton_clicked() +{ + qDebug() << "鍙戦�佹煡璇㈣姹�"; + PmsParam pm; + pm.setName(ui->lineEdit->text().toStdString()); + pm.setPermissonType(ui->lineEdit_2->text().toStdString()); + pm.setUserNo(ui->lineEdit_3->text().toStdString()); + + clientSocket->queryPmsByParam(pm); + qDebug() << "鏌ヨ涓�"; + +} + +void PermissonWindow::listenItemChange(QStandardItem *item) +{ + QString localText = item->text(); + if(roleMap.count(localText.toStdString())){ + qDebug() << "鍙戣捣鑱屼綅鏇存柊璇锋眰"; + PmsPlusParma pm; + pm.setPermissonType(localText.toStdString()); + pm.setRoleId(roleMap[localText.toStdString()]); + clientSocket->updatePmsByParam(pm); + } +} + +void PermissonWindow::renderItemData(vector<PmsQueryResult> res) +{ + globalPms = res; + m_model->setRowCount(globalPms.size()); + + for(int i=0;i<m_model->rowCount();i++){ + PmsQueryResult curRes = globalPms[i]; + m_model->setItem(i,0,new QStandardItem(QString::fromStdString(curRes.getUserNo()))); + m_model->setItem(i,1,new QStandardItem(QString::fromLocal8Bit(curRes.getName().c_str()))); + m_model->setItem(i,2,new QStandardItem(QString::fromStdString(curRes.getStartDateTime()))); + m_model->setItem(i,3,new QStandardItem(QString::fromStdString(curRes.getEndDateTime()))); + m_model->setItem(i,4,new QStandardItem(QString::fromLocal8Bit(curRes.getPermissonType().c_str()))); + + } + ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + qDebug() << "鏌ヨ鍒扮殑鏁伴噺 " << globalPms.size(); +} + diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.h" new file mode 100644 index 0000000..a9f57be --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.h" @@ -0,0 +1,57 @@ +锘�#ifndef PERMISSONWINDOW_H +#define PERMISSONWINDOW_H + +#include <QMainWindow> +#include <QMenu> +#include <qstandarditemmodel.h> +#include <QDebug> +#include <map> +#include "permissondialog.h" +#include "syncdatatodb.h" +#include "PmsClientSocket.h" + +#include <QMessageBox> + + + +using namespace std; + +namespace Ui { +class PermissonWindow; +} + +class PermissonWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit PermissonWindow(QWidget *parent = 0); + ~PermissonWindow(); + + bool eventFilter(QObject *watch, QEvent *event); + +signals: + void sendUserNo(PmsQueryResult); +private slots: + void on_pushButton_clicked(); + + void listenItemChange(QStandardItem * item); + + void renderItemData(vector<PmsQueryResult> res); + + + +private: + Ui::PermissonWindow *ui; + QStandardItemModel * m_model; + QMenu * m; + PermissonDialog *dia; + SyncDataToDB * dbInfo; + map<string,int> roleMap; + + vector<PmsQueryResult> globalPms; + PmsClientSocket * clientSocket; + + +}; + +#endif // PERMISSONWINDOW_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.ui" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.ui" new file mode 100644 index 0000000..1e82783 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/permissonwindow.ui" @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PermissonWindow</class> + <widget class="QMainWindow" name="PermissonWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>803</width> + <height>461</height> + </rect> + </property> + <property name="windowTitle"> + <string>PermissonWindow</string> + </property> + <widget class="QWidget" name="centralWidget"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>鐢ㄦ埛鍚�</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit"/> + </item> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>鑱屼綅</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_2"/> + </item> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>鍛樺伐缂栧彿</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_3"/> + </item> + </layout> + </item> + <item row="1" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pushButton"> + <property name="text"> + <string>鏌ヨ</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="2" column="0"> + <widget class="QTableView" name="tableView"/> + </item> + </layout> + </widget> + <widget class="QStatusBar" name="statusBar"/> + </widget> + <layoutdefault spacing="6" margin="11"/> + <resources/> + <connections/> +</ui> diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsparam.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsparam.h" new file mode 100644 index 0000000..0683706 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsparam.h" @@ -0,0 +1,43 @@ +锘�#ifndef PMSPARAM_H +#define PMSPARAM_H +#include <string> +using namespace std; + + +class PmsParam { +protected: + string userNo; + string name; + string permissonType; +public: + void setUserNo(string id){ + this->userNo = id; + } + void setName(string name){ + this->name = name; + } + void setPermissonType(string permissonType){ + this->permissonType = permissonType; + } + + string getUserNo(){ + return userNo; + } + string getName(){ + return name; + } + string getPermissonType(){ + return permissonType; + } + + PmsParam(){ + this->userNo=""; + this->name = ""; + this->permissonType = ""; + } + + +}; + + +#endif // PMSPARAM_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsplusparam.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsplusparam.h" new file mode 100644 index 0000000..23885dd --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsplusparam.h" @@ -0,0 +1,65 @@ +#ifndef PMSPLUSPARAM_H +#define PMSPLUSPARAM_H +#include "pmsparam.h" + +class PmsPlusParma : public PmsParam{ + int roleId; + + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; +public: + void setQueryHistory(int val){ + this->queryHistory = val; + } + void setLoggerSearch(int val){ + this->loggerSearch = val; + } + void setMapMark(int val){ + this->mapMark = val; + } + void setDevManage(int val){ + this->devManage = val; + } + void setProductPlan(int val){ + this->productPlan = val; + } + + void setRoleId(int val){ + this->roleId = val; + } + + int getQueryHistory(){ + return queryHistory; + } + int getLoggerSearch(){ + return loggerSearch; + } + int getMapMark(){ + return mapMark; + } + int getDevManage(){ + return devManage; + } + int getProductPlan(){ + return productPlan; + } + + int getRoleId(){ + return roleId; + } + + + PmsPlusParma(){ + roleId = -1; + queryHistory = -1; + loggerSearch = -1; + mapMark = -1; + devManage = -1; + productPlan = -1; + } +}; + +#endif // PMSPLUSPARAM_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsqueryresult.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsqueryresult.h" new file mode 100644 index 0000000..e35b54f --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/pmsqueryresult.h" @@ -0,0 +1,73 @@ +#ifndef PMSQUERYRESULT_H +#define PMSQUERYRESULT_H + +#include "pmsparam.h" +class PmsQueryResult : public PmsParam{ + string startDateTime; + string endDateTime; + + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; + + int roleId; +public: + void setStartDateTime(string time){ + this->startDateTime = time; + } + void setEndDateTime(string time){ + this->endDateTime = time; + } + + void setQueryHistory(int val){ + this->queryHistory = val; + } + void setLoggerSearch(int val){ + this->loggerSearch = val; + } + void setMapMark(int val){ + this->mapMark = val; + } + void setDevManage(int val){ + this->devManage = val; + } + void setProductPlan(int val){ + this->productPlan = val; + } + void setRoleId(int val){ + this->roleId = val; + } + + + string getStartDateTime(){ + return startDateTime; + } + string getEndDateTime(){ + return endDateTime; + } + int getQueryHistory(){ + return queryHistory; + } + int getLoggerSearch(){ + return loggerSearch; + } + int getMapMark(){ + return mapMark; + } + int getDevManage(){ + return devManage; + } + int getProductPlan(){ + return productPlan; + } + int getRoleId(){ + return roleId; + } + + +}; + + +#endif // PMSQUERYRESULT_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.cpp" new file mode 100644 index 0000000..8eab6b3 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.cpp" @@ -0,0 +1,40 @@ +锘�#include "qcomboxdelegate.h" + + + +QComBoxDelegate::QComBoxDelegate() +{ + +} + +QComBoxDelegate::QComBoxDelegate(QObject *p):QItemDelegate(p) +{ + +} + +QWidget *QComBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QComboBox * box = new QComboBox(parent); + QStringList text; + text << "鏅�氶噰鐭垮憳宸�" << "鎶�鏈淮鎶や汉鍛�" << "绯荤粺绠$悊鍛�"<< "瀹夊叏绠$悊浜哄憳"; + box->addItems(text); + + return box; +} + +void QComBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QRect rec = option.rect; + editor->setGeometry(rec); +} + +void QComBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const +{ + +} + +void QComBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const +{ + QString val = static_cast<QComboBox *>(editor)->currentText(); + model->setData(index,val); +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.h" new file mode 100644 index 0000000..d9e575e --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/qcomboxdelegate.h" @@ -0,0 +1,27 @@ +#ifndef QCOMBOXDELEGATE_H +#define QCOMBOXDELEGATE_H + +#include <QItemDelegate> +#include <QComboBox> +#pragma execution_character_set("utf-8") + +class QComBoxDelegate : public QItemDelegate +{ +public: + QComBoxDelegate(); + QComBoxDelegate(QObject * p=0); + + + // 鍒涘缓缂栬緫鍣� + QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; + + // 鏄剧ず缂栬緫鍣紝鏇存柊鍑犱綍浣嶇疆 + void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; + + // 璁惧畾缂栬緫鍣ㄦ暟鎹� + void setEditorData(QWidget *editor, const QModelIndex &index) const; + // 璁惧畾妯″瀷鏁版嵁 + void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; +}; + +#endif // QCOMBOXDELEGATE_H diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.cpp" new file mode 100644 index 0000000..96ca144 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.cpp" @@ -0,0 +1,94 @@ +锘�#include "syncdatatodb.h" + + + +vector<PmsQueryResult> SyncDataToDB::queryAllUserAboutUser() +{ + string sql = "SELECT * FROM user_info AS u, employee_permisson AS e WHERE u.role_id=e.id"; + + mysql_real_query(&mysql, sql.c_str(), sql.size()); + res = mysql_store_result(&mysql); + + vector<PmsQueryResult> resv; + while ((row = mysql_fetch_row(res)) != NULL) { + + PmsQueryResult res; + setPmsResult(res,row); + resv.push_back(res); + } + return resv; +} + +vector<PmsQueryResult> SyncDataToDB::queryPmsByParam(PmsParam param) +{ + string sql = "SELECT * FROM user_info AS u, employee_permisson AS e WHERE u.role_id=e.id"; + + if(!param.getUserNo().empty()){ + sql += " and u.user_no='" + param.getUserNo() + "'"; + } + + if(!param.getName().empty()){ + sql += " and u.name='" + param.getName()+ "'"; + } + + if(!param.getPermissonType().empty()){ + sql += " and e.permission_type='" + param.getPermissonType()+ "'"; + } + + qDebug() << "sql璇彞" << QString::fromStdString(sql); + + mysql_real_query(&mysql, sql.c_str(), sql.size()); + res = mysql_store_result(&mysql); + + vector<PmsQueryResult> resv; + while ((row = mysql_fetch_row(res)) != NULL) { + + PmsQueryResult res; + setPmsResult(res,row); + resv.push_back(res); + } + return resv; +} + +int SyncDataToDB::updatePmsByParam(PmsPlusParma param) +{ + + string sql = "update employee_permisson"; + + // 鍙洿鏀硅亴浣� + if(!param.getPermissonType().empty()){ + sql.append(" set permission_type='" + param.getPermissonType())+ "'"; + }else{ + sql.append(" set query_history=") + to_string(param.getQueryHistory()); + sql.append(",logger_search=") + to_string(param.getLoggerSearch()); + sql.append(",map_mark=") + to_string(param.getMapMark()); + sql.append(",dev_manage=") + to_string(param.getDevManage()); + sql.append(",product_plan=") + to_string(param.getProductPlan()); + } + sql.append(" where e.id=" + param.getRoleId()); + + mysql_real_query(&mysql, sql.c_str(), sql.size()); + mysql_store_result(&mysql); + //qDebug() << res->row_count; + return res->row_count; + +} + +void SyncDataToDB::setPmsResult(PmsQueryResult &res, char **row) +{ + res.setName(string(row[1])); + res.setUserNo(string(row[5])); + res.setStartDateTime(string(row[2])); + res.setEndDateTime(string(row[3])); + res.setRoleId(stoi(string(row[4]))); + + res.setPermissonType(string(row[8])); + res.setQueryHistory(stoi(string(row[9]))); + res.setLoggerSearch(stoi(string(row[10]))); + res.setMapMark(stoi(string(row[11]))); + res.setDevManage(stoi(string(row[12]))); + res.setProductPlan(stoi(string(row[13]))); + + + qDebug() << QString::fromStdString(res.getUserNo()); +} diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.h" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.h" new file mode 100644 index 0000000..ed52a26 --- /dev/null +++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/syncdatatodb.h" @@ -0,0 +1,48 @@ +锘�#ifndef SYNCDATATODB_H +#define SYNCDATATODB_H + +#include <WinSock2.h> +#include <mysql.h> +#include <string> +#include "pmsqueryresult.h" +#include <vector> +#include "pmsplusparam.h" +#include <QDebug> + +using namespace std; + +class SyncDataToDB{ +private: + MYSQL mysql; + MYSQL_RES * res; + MYSQL_ROW row; + + void DBInit() { + mysql_init(&mysql); + mysql_real_connect(&mysql, "127.0.0.1", "root", "root", "mydb", 3306, NULL, 0); + string sql1 = "set names gbk"; + mysql_real_query(&mysql, sql1.c_str(), sql1.size()); + } + + void DBClose() { + mysql_free_result(res); + mysql_close(&mysql); + } +public: + SyncDataToDB() { + DBInit(); + } + ~SyncDataToDB() { + DBClose(); + } + // 浠庢暟鎹簱鏌ヨ鎵�鏈夊憳宸ョ殑瑙掕壊鏉冮檺淇℃伅 + vector<PmsQueryResult> queryAllUserAboutUser(); + + vector<PmsQueryResult> queryPmsByParam(PmsParam param); + + int updatePmsByParam(PmsPlusParma param); + + void setPmsResult(PmsQueryResult & res,char ** row); +}; + +#endif // SYNCDATATODB_H diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" "b/Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1030.doc" similarity index 80% rename from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" rename to "Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1030.doc" index 0530ea7..2c2d918 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" +++ "b/Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1030.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" "b/Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1031.doc" similarity index 79% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy to "Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1031.doc" index 0530ea7..60ec89f 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" +++ "b/Client/\345\247\234\345\217\257\345\272\232/log/\345\247\234\345\217\257\345\272\232_1031.doc" Binary files differ 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..deffe06 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..cebcc04 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\227\245\345\277\227_\347\216\213\351\221\253\351\221\253_1031.doc" "b/Client/\347\216\213\351\221\253\351\221\253/log/\346\227\245\345\277\227_\347\216\213\351\221\253\351\221\253_1031.doc" new file mode 100644 index 0000000..bd1f6d1 --- /dev/null +++ "b/Client/\347\216\213\351\221\253\351\221\253/log/\346\227\245\345\277\227_\347\216\213\351\221\253\351\221\253_1031.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/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" "b/Client/\347\224\263\347\203\234/log/\346\227\245\345\277\227_\346\263\250\345\206\214\347\231\273\345\275\225_2024.10.31.doc" similarity index 74% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy to "Client/\347\224\263\347\203\234/log/\346\227\245\345\277\227_\346\263\250\345\206\214\347\231\273\345\275\225_2024.10.31.doc" index 0530ea7..c9478d9 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" +++ "b/Client/\347\224\263\347\203\234/log/\346\227\245\345\277\227_\346\263\250\345\206\214\347\231\273\345\275\225_2024.10.31.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/document/\346\230\206\344\273\2211031_\351\241\271\347\233\256\346\227\245\346\212\245.doc" "b/Client/\351\203\221\345\207\257\346\226\207/document/\346\230\206\344\273\2211031_\351\241\271\347\233\256\346\227\245\346\212\245.doc" new file mode 100644 index 0000000..b8194ea --- /dev/null +++ "b/Client/\351\203\221\345\207\257\346\226\207/document/\346\230\206\344\273\2211031_\351\241\271\347\233\256\346\227\245\346\212\245.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071030.doc" "b/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071030.doc" index 1f09eef..24d2fcc 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071030.doc" +++ "b/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071030.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" "b/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071031.doc" similarity index 79% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy to "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071031.doc" index 0530ea7..0731a0d 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" +++ "b/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071031.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" new file mode 100644 index 0000000..70ae3d4 --- /dev/null +++ "b/Client/\351\273\216\345\274\230\351\234\226/code/Devices_Management_Struct.h" @@ -0,0 +1,107 @@ +#pragma once +enum TypeInfo +{ + AD_Req,//添加设备请求 + AD_Res,//添加设备响应 + DD_Req,//关闭设备请求 + DD_Res,//关闭设备请求 + PD_Req,//暂停设备请求 + PD_Res,//暂停设备请求 +}; +struct Head +{ + int type; + int len; +}; + +//添加设备 +struct ADReq +{ + Head head; + char Device_Name[32]; + ADReq() { + head.type = AD_Req; + head.len = sizeof(AD_Req); + } + +}; +struct ADPermission +{ + char Device_Name[32]; + char Device_Status[32]; + char Start_Time[32]; + char Work_Time[32]; + char Manufacturer[100]; + char Devices_Type[32]; +}; +struct ADRes +{ + Head head; + + ADPermission per; + ADRes() { + head.type = AD_Res; + head.len = sizeof(ADRes); + } + +}; + +//关闭设备 +struct DDReq +{ + Head head; + char Device_Name[32]; + DDReq() { + head.type = DD_Req; + head.len = sizeof(DDReq); + } +}; +struct DDPermission +{ + char Device_Name[32]; + char Device_Status[32]; + char Start_Time[32]; + char Work_Time[32]; + char Manufacturer[100]; + char Devices_Type[32]; +}; +struct DDRes +{ + Head head; + + DDPermission per; + DDRes() { + head.type = DD_Res; + head.len = sizeof(DDRes); + } +}; + +//暂停设备 +struct PDReq +{ + Head head; + char Device_Name[32]; + PDReq() { + head.type = PD_Req; + head.len = sizeof(PDReq); + } +}; +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]; +}; +struct PDRes +{ + Head head; + + PDPermission per; + PDRes() { + head.type = PD_Res; + head.len = sizeof(PDRes); + } +}; \ No newline at end of file diff --git "a/Client/\351\273\216\345\274\230\351\234\226/code/device_management.zip" "b/Client/\351\273\216\345\274\230\351\234\226/code/device_management.zip" deleted file mode 100644 index 98e3eae..0000000 --- "a/Client/\351\273\216\345\274\230\351\234\226/code/device_management.zip" +++ /dev/null Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.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_1031.doc" similarity index 75% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy to "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_1031.doc" index 0530ea7..e8f66d0 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.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_1031.doc" 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/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.cpp" "b/Server/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.cpp" new file mode 100644 index 0000000..367a7f1 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.cpp" @@ -0,0 +1,131 @@ +#include "ConnectionPool.h" +ConnectionPool::ConnectionPool() +{ + if (!parseXmlFile()) + return; + for (m_num = 0; m_num < m_minSize;) { + bool flag = addConnection(); + if (!flag) { + return; + } + } + // 如果子线程的任务函数是类的非静态函数,我们需要指定任务函数的地址和任务函数的所有者 + thread producer(&ConnectionPool::productConnection, this); // 创建连接 + thread recycler(&ConnectionPool::recycleConnection, this); // 检测并销毁连接 + // 线程分离,防止阻塞主线程 + producer.detach(); + recycler.detach(); +} +ConnectionPool::~ConnectionPool() +{ + while (!m_connections.empty()) { + MysqlConn* conn = m_connections.front(); + m_connections.pop(); + delete conn; + } +} +bool ConnectionPool::parseXmlFile() +{ + TiXmlDocument xml("mysql.xml"); + // 加载文件 + bool res = xml.LoadFile(); + if (!res) { + return false; // 提示 + } + // 根 + TiXmlElement* rootElement = xml.RootElement(); + TiXmlElement* childElement = rootElement->FirstChildElement("mysql"); + // 读取信息 + m_ip = childElement->FirstChildElement("ip")->GetText(); + m_port = static_cast<unsigned short>(stoi(string(childElement->FirstChildElement("port")->GetText()))); + m_user = childElement->FirstChildElement("username")->GetText(); + m_passwd = childElement->FirstChildElement("password")->GetText(); + m_dbName = childElement->FirstChildElement("dbName")->GetText(); + m_minSize = static_cast<int>(stoi(string(childElement->FirstChildElement("minSize")->GetText()))); + m_maxSize = static_cast<int>(stoi(string(childElement->FirstChildElement("maxSize")->GetText()))); + m_maxIdleTime = static_cast<int>(stoi(string(childElement->FirstChildElement("maxIdleTime")->GetText()))); + m_timeout = static_cast<int>(stoi(string(childElement->FirstChildElement("timeout")->GetText()))); + return true; +} +bool ConnectionPool::addConnection() +{ + MysqlConn* conn = new MysqlConn; + bool res = conn->connect(m_user, m_passwd, m_dbName, m_ip, m_port); + if (res) { + // 刷新空闲时间 + conn->refreashAliveTime(); + m_connections.push(conn); + ++m_num; + return true; + } + else { + delete conn; + return false; // 提示 + } +} +void ConnectionPool::productConnection() +{ + while (true) { + unique_lock<mutex> lc(m_mutex); + m_cond.wait(lc, [this]() {return m_connections.empty(); }); + if (m_num < m_maxSize) { + bool flag = addConnection(); + if (!flag) { + return; + } + } + // 唤醒 + m_cond1.notify_all(); + } +} +void ConnectionPool::recycleConnection() +{ + while (true) { + // 休眠一段时间 0.5s + this_thread::sleep_for(milliseconds(500)); + lock_guard<mutex> lc(m_mutex); + while (!m_connections.empty() && m_num > m_minSize) { + MysqlConn* conn = m_connections.front(); + if (conn->getAliveTime() >= m_maxIdleTime) { + m_connections.pop(); + delete conn; + --m_num; + } + else { + break; + } + } + } +} +ConnectionPool* ConnectionPool::getConnectPool() +{ + // 不使用互斥锁的线程安全的懒汉模式 + static ConnectionPool pool; // 只在第一次调用函数时初始化 + return &pool; +} +shared_ptr<MysqlConn> ConnectionPool::getConnection() +{ + unique_lock<mutex> lc(m_mutex); + while (m_connections.empty()) { + if (cv_status::timeout == m_cond1.wait_for(lc, chrono::milliseconds(m_timeout))) { + if (m_connections.empty()) { + // cout << "out of time" << endl; + return nullptr; // 结束 // 提示 + // continue; // 利用while配合continue 继续阻塞 + } + } + } + // 要指定删除器destructor,来保证连接的归还 + shared_ptr<MysqlConn> conn(m_connections.front(), [this](MysqlConn* conn) { + // 加锁保证队列线程安全 + // m_mutex.lock(); // 1 + unique_lock<mutex> lc(m_mutex); // 2 + // lock_guard<mutex> lc(m_mutex); // 3 + conn->refreashAliveTime(); + m_connections.push(conn); + // m_mutex.unlock(); // 1 + }); + m_connections.pop(); + m_cond.notify_all(); + return conn; +} diff --git "a/Server/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.h" "b/Server/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.h" new file mode 100644 index 0000000..3ad1ee0 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/code/ConnectionPool.h" @@ -0,0 +1,54 @@ +#pragma once +#include "MysqlConn.h" +#include "./tinyxml/tinyxml.h" +#include <queue> +#include <mutex> +#include <thread> +#include <atomic> +#include <condition_variable> + + +#pragma comment(lib, "./tinyxml/x64/Debug/tinyxml.lib") + +// 应用-单例模式:懒汉模式[需要考虑多线程安全问题] +class ConnectionPool +{ +private: + ConnectionPool(); + // 移动拷贝最终还是有且仅有一个对象,所以依旧是属于单例模式。 + // delete 阻止拷贝构造和拷贝赋值的类对象生成 + ConnectionPool(ConnectionPool&) = delete; + ConnectionPool& operator=(ConnectionPool&) = delete; + ~ConnectionPool(); + // 解析xml配置文件 读取数据库及连接池的相关信息 + bool parseXmlFile(); + // 添加连接 + bool addConnection(); + // 线程函数 + void productConnection(); + void recycleConnection(); + + // 存放数据库连接池建立的连接 + queue<MysqlConn*> m_connections; + // 一些基本信息 + string m_ip; // IP + unsigned short m_port; // 端口 + string m_user; // 用户名 + string m_passwd; // 密码 + string m_dbName; // 数据库名称 + int m_minSize; // 初始连接量(最小连接量) + int m_maxSize; // 最大连接量 + int m_timeout; // 超时时长 + int m_maxIdleTime; // 最大空闲时长 + // 线程安全相关 + mutex m_mutex; + condition_variable m_cond; // 仅用一个条件变量来唤醒线程,但并不影响线程运行 + condition_variable m_cond1; + // 连接数量 + atomic_int m_num; // 连接的总数量 +public: + // 获取单例对象的接口 + static ConnectionPool* getConnectPool(); + // 用户获取连接的接口, 如果获取失败,会返回nullptr + shared_ptr<MysqlConn> getConnection(); +}; diff --git "a/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.cpp" "b/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.cpp" new file mode 100644 index 0000000..57ba1c6 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.cpp" @@ -0,0 +1,174 @@ +#include "MysqlConn.h" + +MysqlConn::MysqlConn()//初始化数据库 +{ + m_result = nullptr; + m_mysqlRow = nullptr; + // 传入nullptr空指针时,会自动分配一个MYSQL对象 + m_conn = mysql_init(nullptr); +} +MysqlConn::~MysqlConn()//释放数据库连接 +{ + freeRes(); // 释放结果集 + if (m_conn != nullptr) { + mysql_close(m_conn); + m_conn = nullptr; + } +} +void MysqlConn::freeRes()//结果集释放 +{ + if (m_result) { + mysql_free_result(m_result); + m_result = nullptr; + } +} +bool MysqlConn::connect(const string user, const string passwd, \ + const string dbName, string ip, \ + const unsigned short port)//连接数据库 +{ + MYSQL* res = mysql_real_connect(m_conn, ip.c_str(), user.c_str(), \ + passwd.c_str(), dbName.c_str(), port, nullptr, 0); + // 修改编码 + mysql_set_character_set(m_conn, "gb2312"); + return res != nullptr; +} +bool MysqlConn::update(const string sql) const +{ + // 执行成功返回0; + int res = mysql_real_query(m_conn, sql.c_str(), static_cast<unsigned int>(sql.size())); + if (res != 0) { + return false; // 提示 + } + return true; +} +bool MysqlConn::query(const string sql) +{ + freeRes(); + int res = mysql_real_query(m_conn, sql.c_str(), static_cast<unsigned int>(sql.size())); + if (res != 0) { + return false; // 提示 + } + m_result = mysql_store_result(m_conn); + return true; +} +bool MysqlConn::getRes() +{ + if (m_result != nullptr) { + // char** 获取单行记录 + m_mysqlRow = mysql_fetch_row(m_result); + if (m_mysqlRow != nullptr) { + return true; + } + freeRes(); + } + return false; +} +string MysqlConn::getValue(const int fieldIndex) const +{ + int fieldCount = mysql_num_fields(m_result); + if (fieldIndex >= fieldCount || fieldIndex < 0) { + return string(); // 提示 + } + char* value = m_mysqlRow[fieldIndex]; + // 得到一个保存各字段值长度的数组 + unsigned long* len = mysql_fetch_lengths(m_result); + unsigned long length = len[fieldIndex]; + // 防止结果中存在\0导致数据丢失 + return string(value, length); +} +bool MysqlConn::selectDB(const string dbName) const +{ + int res = mysql_select_db(m_conn, dbName.c_str()); + if (res != 0) { + return false; // 提示 + } + return true; +} +void MysqlConn::backupCurrentDB(const string path) +{ + string sql = "show tables"; + int r = mysql_real_query(m_conn, sql.c_str(), static_cast<unsigned long>(sql.size())); + if (r != 0) { + return; // 提示 + } + MYSQL_RES* tableRes = mysql_store_result(m_conn); + for (int i = 0; i < mysql_num_rows(tableRes); ++i) { + MYSQL_ROW tableName = mysql_fetch_row(tableRes); + backupCurrentTable(path, tableName[0]); + } +} +void MysqlConn::backupCurrentTable(const string path, const string tableName) +{ + string file = path + tableName + ".sql"; + ofstream ofs(file); + if (!ofs.is_open()) { + return; // 提示 + } + // 表结构写入 + string showCreate = "show create table " + tableName + ";"; + bool res = query(showCreate); + if (!res) { + return; // 提示 + } + if (getRes()) { + string writeSQL = getValue(1) + ";\n"; + ofs.write(writeSQL.c_str(), writeSQL.size()); + // cout << writeSQL << endl; + } + // 表数据写入 + string sql = "select * from " + tableName + ";"; + res = query(sql); + if (!res) { + return; // 提示 + } + while (getRes()) { + string writeSQL = "insert into `" + tableName + "` values("; + for (int i = 0; !getValue(i).empty(); ++i) { + if (i != 0) { + writeSQL += ","; + } + MYSQL_FIELD* valueType = mysql_fetch_field_direct(m_result, i); + if (valueType->type == MYSQL_TYPE_DECIMAL + || valueType->type == MYSQL_TYPE_TINY + || valueType->type == MYSQL_TYPE_SHORT + || valueType->type == MYSQL_TYPE_LONG + || valueType->type == MYSQL_TYPE_FLOAT + || valueType->type == MYSQL_TYPE_DOUBLE + || valueType->type == MYSQL_TYPE_TIMESTAMP + || valueType->type == MYSQL_TYPE_LONGLONG + || valueType->type == MYSQL_TYPE_INT24) { + writeSQL += getValue(i); + } + else { + writeSQL += "'" + getValue(i) + "'"; + } + } + writeSQL += ");\n"; + ofs.write(writeSQL.c_str(), writeSQL.size()); + } + ofs.close(); +} +bool MysqlConn::transaction() const +{ + // 将事务提交设置为手动提交 + return mysql_autocommit(m_conn, false); +} +bool MysqlConn::commit() const +{ + return mysql_commit(m_conn); +} +bool MysqlConn::rollback() const +{ + return mysql_rollback(m_conn); +} +void MysqlConn::refreashAliveTime() +{ + m_alivetime = steady_clock::now(); +} +ll MysqlConn::getAliveTime() +{ + // 毫秒 <<= 纳秒:精度降低 + milliseconds res = duration_cast<milliseconds>(steady_clock::now() - m_alivetime); + return res.count(); +} + diff --git "a/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.h" "b/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.h" new file mode 100644 index 0000000..0dbbea9 --- /dev/null +++ "b/Server/\347\216\213\347\220\250\345\205\203/code/MysqlConn.h" @@ -0,0 +1,63 @@ +#pragma once +#include<iostream> +#include <memory> +#include <string> +#include <mysql.h> +#include <chrono> // 时钟 +#include <fstream> + +#pragma comment(lib, "./lib/libmysql.lib") // 加载数据库库文件 +using namespace std; +using namespace chrono; +typedef long long ll; + +class MysqlConn +{ +private: + // 绝对时钟 + steady_clock::time_point m_alivetime; + // 连接 + MYSQL* m_conn; + // 查询的结果集 + MYSQL_RES* m_result; + // 单记录结果集 + MYSQL_ROW m_mysqlRow; + + // 结果集释放 + void freeRes(); + // 导出某一张表中的数据 + void backupCurrentTable(const string path, const string tableName); +public: + // 初始化数据库 + MysqlConn(); + // 数据库连接释放 + ~MysqlConn(); + // 连接数据库, 需提供用户 密码 数据库名称 ip 端口 + bool connect(const string user, const string passwd, \ + const string dbName, string ip, \ + const unsigned short port = 3306U); + // 更新数据库:增删改操作 + bool update(const string sql) const; + // 查询数据库 + bool query(const string sql); + // 遍历查询结果集 + bool getRes(); + // 获取结果集中的字段值 + string getValue(const int fieldIndex) const; + // 切换数据库 + bool selectDB(const string dbName) const; + // 建库 + //bool createDB(const string dbName) const; + // 备份某个库 + void backupCurrentDB(const string path); + // 事务操作 + bool transaction() const; + // 提交事务 + bool commit() const; + // 事务回滚 + bool rollback() const; + // 刷新起始的空闲时间点 + void refreashAliveTime(); + // 计算存活总时长 + ll getAliveTime(); +}; 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" index b777db4..ed3cc7a 100644 --- "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" Binary files differ 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_1030.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_1030.doc" new file mode 100644 index 0000000..c668cfd --- /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_1030.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_1031.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_1031.doc" new file mode 100644 index 0000000..cfb108c --- /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_1031.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" "b/Server/\351\231\210\346\245\232\344\270\271/log/\346\227\245\345\277\227_\351\231\210\346\245\232\344\270\271_1031.doc" similarity index 67% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy to "Server/\351\231\210\346\245\232\344\270\271/log/\346\227\245\345\277\227_\351\231\210\346\245\232\344\270\271_1031.doc" index 0530ea7..409d72e 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" +++ "b/Server/\351\231\210\346\245\232\344\270\271/log/\346\227\245\345\277\227_\351\231\210\346\245\232\344\270\271_1031.doc" Binary files differ diff --git "a/Server/\351\251\254\344\270\275\350\220\215/code/log/log.cpp" "b/Server/\351\251\254\344\270\275\350\220\215/code/log/log.cpp" index 9a0dbea..3c6e62c 100644 --- "a/Server/\351\251\254\344\270\275\350\220\215/code/log/log.cpp" +++ "b/Server/\351\251\254\344\270\275\350\220\215/code/log/log.cpp" @@ -1,21 +1,14 @@ -#include <string.h> #include <time.h> #include <chrono> -#include <ctime> #include <stdarg.h> #include "log.h" -#include <sstream> #include <fstream> #include <iostream> -#include <chrono> using namespace std; // 鏋勯�犲嚱鏁� -Log::Log() { - m_count = 0; // 鍒濆鍖栨棩蹇楄鏁� - m_is_async = false; // 鍒濆鍖栦负鍚屾 -} +Log::Log() : m_count(0), m_is_async(false) {} // 鏋愭瀯鍑芥暟 Log::~Log() { @@ -24,31 +17,82 @@ } } -// 鎺ユ敹鍘熷鏃ュ織骞惰В鏋� -void Log::receiveLog(const std::string &raw_log) { - ParsedLog parsed_log = parseLog(raw_log); - write_log(levelToInt(parsed_log.level), "%s [%s] %s", parsed_log.timestamp.c_str(), parsed_log.device_id.c_str(), parsed_log.content.c_str()); +//寮傛鍐欏叆 +void Log::async_write_log() { + while (m_is_async) { + char* log; + if (m_log_queue->pop(log)) { + ParsedLog parsed_log = parseLog(log); + write_log(INFO, "%s", log); // 鍏堝啓鍏ユ棩蹇楁枃浠� + writeLogToDatabase(parsed_log); // 鍐嶅啓鍏ユ暟鎹簱 + delete[] log; // 閲婃斁鍐呭瓨 + } + } } +bool Log::check_log_size() { + if (m_fp.tellp() >= max_size) { + rotate_logs(); // 濡傛灉鏃ュ織鏂囦欢澶у皬瓒呰繃鏈�澶у�硷紝杞崲鏃ュ織 + return true; + } + return false; +} + + +// 鎺ユ敹鍘熷鏃ュ織骞惰В鏋� +void Log::receiveLog(const char* raw_log) { + ParsedLog parsed_log = parseLog(raw_log); + write_log(levelToInt(parsed_log.level), "%s [%s] %s", + parsed_log.timestamp, + parsed_log.device_id, + parsed_log.content); +} + +//鍐欏叆鏁版嵁搴� +void Log::writeLogToDatabase(const ParsedLog& log) { + const char* sql = "INSERT INTO parsed_logs (timestamp, device_id, level, content, source, user_id) VALUES (?, ?, ?, ?, ?, ?)"; + sqlite3_stmt* stmt; + + if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) != SQLITE_OK) { + cerr << "Error: Failed to prepare statement: " << sqlite3_errmsg(db) << endl; + return; + } + + sqlite3_bind_text(stmt, 1, log.timestamp, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 2, log.device_id, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 3, log.level, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 4, log.content, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 5, log.source, -1, SQLITE_STATIC); + sqlite3_bind_text(stmt, 6, log.user_id, -1, SQLITE_STATIC); + + if (sqlite3_step(stmt) != SQLITE_DONE) { + cerr << "Error: Failed to execute statement: " << sqlite3_errmsg(db) << endl; + } + + sqlite3_finalize(stmt); // 娓呯悊鍑嗗璇彞 +} + + // 瑙f瀽鏃ュ織瀛楃涓� -ParsedLog Log::parseLog(const std::string &log) { +ParsedLog Log::parseLog(const char* log) { ParsedLog parsed_log; - std::istringstream iss(log); - std::string level; + char level[16]; // 璇诲彇鏃堕棿鎴炽�佽澶嘔D鍜屾棩蹇楃骇鍒� - iss >> parsed_log.timestamp >> parsed_log.device_id >> level; - std::getline(iss, parsed_log.content); - parsed_log.level = level; // 璁剧疆瑙f瀽鍚庣殑绾у埆 + sscanf(log, "%s %s %s %[^\n]", parsed_log.timestamp, parsed_log.device_id, level, parsed_log.content); + // 璁剧疆瑙f瀽鍚庣殑绾у埆 + for (int i = 0; i < 16; ++i) { + parsed_log.level[i] = level[i]; + } return parsed_log; } // 鍒濆鍖栨棩蹇楃郴缁� -bool Log::init(const std::string &file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size) { +bool Log::init(const char* file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size) { if (max_queue_size >= 1) { m_is_async = true; // 鍚敤寮傛鍐欏叆 - m_log_queue = new block_queue<string>(max_queue_size); // 鍒涘缓闃诲闃熷垪 + m_log_queue = new block_queue<char*>(max_queue_size); // 鍒涘缓闃诲闃熷垪 std::thread(&Log::flush_log_thread, this).detach(); // 鍒涘缓鍒锋柊鏃ュ織绾跨▼ } @@ -60,43 +104,76 @@ time_t t = time(NULL); struct tm *sys_tm = localtime(&t); - std::string log_full_name; + char log_full_name[256]; // 鏍规嵁鏂囦欢璺緞鍜屽綋鍓嶆棩鏈熺敓鎴愬畬鏁存棩蹇楁枃浠跺悕 - if (file_name.find('/') == std::string::npos) { - log_full_name = to_string(sys_tm->tm_year + 1900) + "_" + to_string(sys_tm->tm_mon + 1) + "_" + to_string(sys_tm->tm_mday) + "_" + file_name; + if (strchr(file_name, '/') == nullptr) { + sprintf(log_full_name, "%d_%d_%d_%s", + sys_tm->tm_year + 1900, sys_tm->tm_mon + 1, sys_tm->tm_mday, file_name); } else { - std::string log_name = file_name.substr(file_name.find_last_of('/') + 1); - std::string dir_name = file_name.substr(0, file_name.find_last_of('/') + 1); - - log_full_name = dir_name + to_string(sys_tm->tm_year + 1900) + "_" + to_string(sys_tm->tm_mon + 1) + "_" + to_string(sys_tm->tm_mday) + "_" + log_name; + char log_name[128]; + char dir_name[128]; + char* last_slash = strrchr(file_name, '/'); + int dir_len = last_slash - file_name + 1; + strncpy(dir_name, file_name, dir_len); + dir_name[dir_len] = '\0'; + strcpy(log_name, last_slash + 1); + + sprintf(log_full_name, "%s%d_%d_%d_%s", + dir_name, sys_tm->tm_year + 1900, sys_tm->tm_mon + 1, sys_tm->tm_mday, log_name); } m_today = sys_tm->tm_mday; // 璁板綍浠婂ぉ鐨勬棩鏈� m_fp.open(log_full_name, std::ios::out | std::ios::app); // 鎵撳紑鏃ュ織鏂囦欢 if (!m_fp.is_open()) { + cerr << "Error: Could not open log file: " << log_full_name << endl; return false; // 鎵撳紑澶辫触 } return true; // 鍒濆鍖栨垚鍔� } -#include <chrono> +//鏌ヨ鏃ュ織鑽夋渶 +void Log::queryLogs(const char *device_id) { + const char* sql = "SELECT * FROM parsed_logs WHERE device_id = ?"; + sqlite3_stmt* stmt; + if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) != SQLITE_OK) { + cerr << "Error: Failed to prepare statement: " << sqlite3_errmsg(db) << endl; + return; + } + + sqlite3_bind_text(stmt, 1, device_id, -1, SQLITE_STATIC); + + while (sqlite3_step(stmt) == SQLITE_ROW) { + cout << "Timestamp: " << sqlite3_column_text(stmt, 1) << ", " + << "Device ID: " << sqlite3_column_text(stmt, 2) << ", " + << "Level: " << sqlite3_column_text(stmt, 3) << ", " + << "Content: " << sqlite3_column_text(stmt, 4) << ", " + << "Source: " << sqlite3_column_text(stmt, 5) << ", " + << "User ID: " << sqlite3_column_text(stmt, 6) << endl; + } + + sqlite3_finalize(stmt); // 娓呯悊鍑嗗璇彞 +} + + + +// 鍐欏叆鏃ュ織 void Log::write_log(int level, const char *format, ...) { auto now = std::chrono::system_clock::now(); auto now_time_t = std::chrono::system_clock::to_time_t(now); struct tm *sys_tm = localtime(&now_time_t); - std::string s; + char s[32]; // 鏍规嵁鏃ュ織绾у埆璁剧疆鍓嶇紑 switch (level) { - case DEBUG: s = "[debug]: "; break; - case INFO: s = "[info]: "; break; - case WARN: s = "[warn]: "; break; - case ERROR: s = "[error]: "; break; - default: s = "[info]: "; break; + case DEBUG: strcpy(s, "[debug]: "); break; + case INFO: strcpy(s, "[info]: "); break; + case WARN: strcpy(s, "[warn]: "); break; + case ERROR: strcpy(s, "[error]: "); break; + default: strcpy(s, "[info]: "); break; } m_mutex.lock(); // 閿佸畾浜掓枼浣� @@ -104,7 +181,7 @@ // 妫�鏌ユ槸鍚﹂渶瑕佽疆鎹㈡棩蹇� if (m_today != sys_tm->tm_mday || m_count % m_split_lines == 0) { - // ... (鏃ュ織杞崲浠g爜) + rotate_logs(); // 璋冪敤鏃ュ織杞崲鍑芥暟 } // 鍐欏叆鏃ュ織鍐呭 @@ -113,6 +190,7 @@ vsnprintf(m_buf, m_log_buf_size, format, valist); // 鍐欏叆鏃ュ織鍐呭 m_fp << s << m_buf << std::endl; // 浣跨敤ofstream鍐欏叆鏂囦欢 + va_end(valist); m_mutex.unlock(); // 瑙i攣浜掓枼浣� @@ -133,18 +211,65 @@ void Log::flush_log_thread() { while (m_is_async) { // 浠庨槦鍒椾腑鑾峰彇鏃ュ織骞跺啓鍏� - string log; + char* log; if (m_log_queue->pop(log)) { - write_log(INFO, "%s", log.c_str()); + write_log(INFO, "%s", log); } } } +//杞崲瀛楃涓� +const char* Log::log_level_to_string(int level) { + switch (level) { + case DEBUG: return "[debug]: "; + case INFO: return "[info]: "; + case WARN: return "[warn]: "; + case ERROR: return "[error]: "; + default: return "[info]: "; // 榛樿杩斿洖INFO + } +} + // 鏃ュ織绾у埆杞崲涓烘暣鏁� -int Log::levelToInt(const std::string &level) { - if (level == "[debug]:") return DEBUG; - if (level == "[info]:") return INFO; - if (level == "[warn]:") return WARN; - if (level == "[error]:") return ERROR; +int Log::levelToInt(const char* level) { + if (strcmp(level, "[debug]:") == 0) return DEBUG; + if (strcmp(level, "[info]:") == 0) return INFO; + if (strcmp(level, "[warn]:") == 0) return WARN; + if (strcmp(level, "[error]:") == 0) return ERROR; return INFO; // 榛樿杩斿洖INFO } + +//鎵撳紑鍏抽棴鏁版嵁搴� +void Log::openDatabase(const char *db_name) { + if (sqlite3_open(db_name, &db) != SQLITE_OK) { + cerr << "鎵撲笉寮�鏁版嵁搴擄紒锛侀敊璇細 " << sqlite3_errmsg(db) << endl; + } +} + +void Log::closeDatabase() { + if (db) { + sqlite3_close(db); + } +} + +// 鏃ュ織杞崲鍑芥暟 +void Log::rotate_logs() { + // 鍏抽棴褰撳墠鏂囦欢 + m_fp.close(); + + // 鐢熸垚鏂版枃浠跺悕 + time_t t = time(NULL); + struct tm *sys_tm = localtime(&t); + char new_log_name[256]; + sprintf(new_log_name, "%d_%d_%d_log.txt", + sys_tm->tm_year + 1900, sys_tm->tm_mon + 1, sys_tm->tm_mday); + + // 鎵撳紑鏂扮殑鏃ュ織鏂囦欢 + m_fp.open(new_log_name, std::ios::out | std::ios::app); + if (!m_fp.is_open()) { + cerr << "Error: Could not open new log file: " << new_log_name << endl; + return; + } + + m_today = sys_tm->tm_mday; // 鏇存柊浠婂ぉ鐨勬棩鏈� + m_count = 0; // 閲嶇疆鏃ュ織璁℃暟 +} diff --git "a/Server/\351\251\254\344\270\275\350\220\215/code/log/log.h" "b/Server/\351\251\254\344\270\275\350\220\215/code/log/log.h" index be28a84..83df983 100644 --- "a/Server/\351\251\254\344\270\275\350\220\215/code/log/log.h" +++ "b/Server/\351\251\254\344\270\275\350\220\215/code/log/log.h" @@ -3,12 +3,12 @@ #include <stdio.h> #include <iostream> -#include <string> #include <stdarg.h> -#include <thread> +#include <thread> #include "block_queue.h" -#include "locker.h" // 纭繚 locker.h 琚寘鍚� +#include "locker.h" #include <fstream> +#include <sqlite3.h> // 娣诲姞 SQLite 鏁版嵁搴撶殑澶存枃浠� using namespace std; @@ -22,10 +22,12 @@ // 瀛樺偍瑙f瀽鏃ュ織鏂囦欢鐨勭粨鏋勪綋 struct ParsedLog { - std::string timestamp; // 鏃堕棿鎴� - std::string device_id; // 璁惧ID - std::string level; // 鏃ュ織绾у埆 - std::string content; // 鏃ュ織鍐呭 + char timestamp[64]; // 鏃堕棿鎴� + char device_id[64]; // 璁惧ID + char level[16]; // 鏃ュ織绾у埆 + char content[256]; // 鏃ュ織鍐呭 + char source[64]; // 鏉ユ簮妯″潡 + char user_id[64]; // 鐢ㄦ埛ID }; class Log @@ -42,17 +44,19 @@ void flush_log_thread(); // 淇敼涓洪潪闈欐�佹垚鍛樺嚱鏁� // 鍒濆鍖栨棩蹇楃郴缁燂紝鍙傛暟鍖呮嫭鏂囦欢鍚嶃�佹槸鍚﹀叧闂棩蹇椼�佺紦鍐插尯澶у皬銆佹渶澶ц鏁板拰鏈�澶ч槦鍒楀ぇ灏� - bool Log::init(const char *file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size); + bool init(const char *file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size); - // 鍐欏叆鏃ュ織 void write_log(int level, const char *format, ...); // 鍒锋柊鏃ュ織鏂囦欢 void flush(void); - //鎺ユ敹鍘熷鐨勮鍏叡绫� - void receiveLog(const std::string& raw_log); // 鎺ユ敹鍘熷鏃ュ織 + // 鎺ユ敹鍘熷鏃ュ織 + void receiveLog(const char* raw_log); + + // 灏嗘棩蹇楀啓鍏ユ暟鎹簱 + void writeLogToDatabase(const ParsedLog& log); private: Log(); // 鏋勯�犲嚱鏁� @@ -62,12 +66,12 @@ bool check_log_size(); // 妫�鏌ユ棩蹇楁枃浠跺ぇ灏� void rotate_logs(); // 杞崲鏃ュ織鏂囦欢 - ParsedLog parseLog(const std::string& log); // 瑙f瀽鏃ュ織 - bool init(const std::string &file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size); - void queryLogs(const std::string &device_id); // 鏌ヨ鏃ュ織 + ParsedLog parseLog(const char* log); // 瑙f瀽鏃ュ織 + bool init(const char *file_name, int close_log, int log_buf_size, int split_lines, int max_queue_size); + void queryLogs(const char *device_id); // 鏌ヨ鏃ュ織 const char* log_level_to_string(int level); // 灏嗘棩蹇楃骇鍒浆鎹负瀛楃涓� - int levelToInt(const std::string &level); + int levelToInt(const char *level); private: char dir_name[128]; // 鏃ュ織鏂囦欢鐩綍 @@ -78,16 +82,18 @@ int m_today; // 璁板綍褰撳墠鏃堕棿 std::ofstream m_fp; // 灏� FILE * m_fp 鏇存敼涓� std::ofstream m_fp char *m_buf; // 鏃ュ織缂撳啿鍖� - block_queue<string> *m_log_queue; // 闃诲闃熷垪 + block_queue<char*> *m_log_queue; // 闃诲闃熷垪 bool m_is_async; // 鏄惁寮傛鏍囧織浣� locker m_mutex; // 浜掓枼閿� int m_close_log; // 鍏抽棴鏃ュ織鐨勬爣蹇� - long max_size = 10 * 1024 * 1024; // 10MB - //娴嬭瘯鏂囦欢閲岄潰鐨� - int m_close_log; // 纭繚鍦ㄨ繖閲屽畾涔� + long max_size = 10 * 1024 * 1024; // 鍗曚釜鏃ュ織鏂囦欢鐨勫ぇ灏� 10MB + + // 鏁版嵁搴撶浉鍏� + sqlite3 *db; // SQLite 鏁版嵁搴撴寚閽� + void openDatabase(const char *db_name); // 鎵撳紑鏁版嵁搴� + void closeDatabase(); // 鍏抽棴鏁版嵁搴� }; -// 瀹忓畾涔夌敤浜庝笉鍚岀骇鍒殑鏃ュ織璁板綍 #define LOG_DEBUG(format, ...) if(0 == m_close_log) {Log::get_instance()->write_log(DEBUG, format, ##__VA_ARGS__); Log::get_instance()->flush();} #define LOG_INFO(format, ...) if(0 == m_close_log) {Log::get_instance()->write_log(INFO, format, ##__VA_ARGS__); Log::get_instance()->flush();} #define LOG_WARN(format, ...) if(0 == m_close_log) {Log::get_instance()->write_log(WARN, format, ##__VA_ARGS__); Log::get_instance()->flush();} diff --git "a/Server/\351\251\254\344\270\275\350\220\215/document/\346\227\245\345\277\227\351\234\200\346\261\202\345\210\206\346\236\220\346\226\207\346\241\243.docx" "b/Server/\351\251\254\344\270\275\350\220\215/document/\346\227\245\345\277\227\351\234\200\346\261\202\345\210\206\346\236\220\346\226\207\346\241\243.docx" index 13a9cda..8ce7464 100644 --- "a/Server/\351\251\254\344\270\275\350\220\215/document/\346\227\245\345\277\227\351\234\200\346\261\202\345\210\206\346\236\220\346\226\207\346\241\243.docx" +++ "b/Server/\351\251\254\344\270\275\350\220\215/document/\346\227\245\345\277\227\351\234\200\346\261\202\345\210\206\346\236\220\346\226\207\346\241\243.docx" Binary files differ diff --git "a/Server/\351\251\254\344\270\275\350\220\215/log/log_1031.doc" "b/Server/\351\251\254\344\270\275\350\220\215/log/log_1031.doc" new file mode 100644 index 0000000..9740cdd --- /dev/null +++ "b/Server/\351\251\254\344\270\275\350\220\215/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/20241031\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/20241031\346\230\206\344\273\221\346\227\245\346\212\245.doc" new file mode 100644 index 0000000..4021a6c --- /dev/null +++ "b/Server/\351\251\254\346\270\235\346\235\255/log/20241031\346\230\206\344\273\221\346\227\245\346\212\245.doc" Binary files differ diff --git "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.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" similarity index 78% copy from "Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.doc" copy 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_20241030.doc" index 0530ea7..3171038 100644 --- "a/Client/\351\203\221\345\207\257\346\226\207/log/\351\203\221\345\207\257\346\226\2071029.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" Binary files differ diff --git a/common.h b/common.h new file mode 100644 index 0000000..a93c4bd --- /dev/null +++ b/common.h @@ -0,0 +1,714 @@ +#ifndef COMMON_H +#define COMMON_H +#include <string.h> +#include <vector> + +enum TypeInfo{ + + //娉ㄥ唽鐧诲綍 + LOGIN_REQ, // 鐧诲綍璇锋眰 + LOGIN_RES, // 鐧诲綍鍝嶅簲 + REGISTER_REQ, //娉ㄥ唽璇锋眰 + REGISTER_RES, //娉ㄥ唽鍝嶅簲 + RESET_REQ, //閲嶇疆瀵嗙爜璇锋眰 + RESET_RES, //閲嶇疆瀵嗙爜鍝嶅簲 + + //鍘嗗彶鏌ヨ鍒嗘瀽 + HISTORY_QUERY_REQ, // 鍘嗗彶鏌ヨ璇锋眰 + HISTORY_QUERY_RES, // 鍘嗗彶鏌ヨ鍝嶅簲 + + //鏉冮檺绠$悊 + QUERY_PMS_REQ, // 鎸夊憳宸ョ紪鍙枫�佸悕瀛楁垨鑱屼綅鏌ヨ浜哄憳鏉冮檺淇℃伅璇锋眰 + UPDATE_PMS_REQ, // 鎸夎鑹瞚d鏇存柊鏉冮檺淇℃伅璇锋眰 + QUERY_PMS_RES, // 鏌ヨ浜哄憳鍜岃鑹蹭俊鎭殑鍝嶅簲缁撴瀯浣� + UPDATE_PMS_RES, // 鏉冮檺鏇存柊缁撴灉鍝嶅簲浣� + + //鍦板浘鏍囨敞 + MAPMARK_REQ,//鍦板浘鏍囨敞璇锋眰 + MAPMARK_RES//鍦板浘鏍囨敞鍝嶅簲 + + //澶у睆鏄剧ず + ENVIRONMENT_REQ,//鐜鏁版嵁璇锋眰 + ENVIRONMENT_RES,//鐜鏁版嵁鍝嶅簲 + DEVICESTATUS_REQ,//璁惧鐘舵�佽姹� + DEVICESTATUS_RES,//璁惧鐘舵�佸搷搴� + MOVEMENTRECORD_REQ,//鎿嶄綔鏃ュ織璇锋眰 + MOVEMENTRECORD_RES,//鎿嶄綔鏃ュ織鍝嶅簲 + ALARMRECORD_REQ,//璀︽姤璁板綍璇锋眰 + ALARMRECORD_RES,//璀︽姤璁板綍鍝嶅簲 + YIELD_REQ,//鐓ょ熆浜ч噺璇锋眰 + YIELD_RES,//鐓ょ熆浜ч噺鍝嶅簲 + + //鐢熶骇璁″垝绠$悊 + ADDPRODUCTIONPLAN_REQ,//娣诲姞涓�琛屾暟鎹殑璇锋眰缁撴瀯浣� + ADDPRODUCTIONPLAN_RES,//娣诲姞涓�琛屾暟鎹殑鍝嶅簲缁撴瀯浣� + UPDATEPRODUCTIONPLANQUANTITY_REQ,// 鏇存柊鐢熶骇璁″垝锛堣鍒掔敓浜ч噺锛夌殑璇锋眰缁撴瀯浣� + UPDATEPRODUCTIONPLANQUANTITY_RES,// 鏇存柊鐢熶骇璁″垝锛堣鍒掔敓浜ч噺锛夌殑鍝嶅簲缁撴瀯浣� + UPDATEPRODUCTIONPLANLOG_REQ,//鏇存柊鐢熶骇璁″垝锛堟棩蹇楋級鐨勮姹傜粨鏋勪綋 + UPDATEPRODUCTIONPLANLOG_RES,//鏇存柊鐢熶骇璁″垝锛堟棩蹇楋級鐨勫搷搴旂粨鏋勪綋 + PRODUCTIONPLAN_REQ,// 鏌ヨ鐢熶骇璁″垝淇℃伅鐨勮姹傜粨鏋勪綋 + PRODUCTIONPLAN_RES,// 鏌ヨ鐢熶骇璁″垝淇℃伅鐨勫搷搴旂粨鏋勪綋 + FORRECENTFOURTEENPRODUCTIONPLANS_REQ,//鏌ヨ杩戝崄鍥涙潯鐨勮姹傜粨鏋勪綋 + FORRECENTFOURTEENPRODUCTIONPLANS_RES //鏌ヨ杩戝崄鍥涙潯鐨勫搷搴旂粨鏋勪綋 + + //鑷姩鍗囩骇&鐗堟湰绠$悊 + VERSIONNUM_REQ, // 鐗堟湰鍙疯姹� + VERSIONNUM_RES, // 鐗堟湰鍙峰搷搴� + UPLOAD_FILE_REQ, // 涓婁紶鏂囦欢鐨勮姹� + UPLOAD_FILE_RES, // 涓婁紶鏂囦欢鐨勫搷搴� + VERSIONINFOENTRY_REQ, // 鐗堟湰淇℃伅褰曞叆璇锋眰 + VERSIONINFOENTRY_RES, //鐗堟湰淇℃伅褰曞叆鍝嶅簲 + VERSIONUPDATE_REQ, // 鐗堟湰鏇存柊璇锋眰 + VERSIONUPDATE_RES, // 鐗堟湰鏇存柊鍝嶅簲 + FILEDOWNLOADS_REQ, // 鐗堟湰鏇存柊鏂囦欢涓嬭浇璇锋眰 + FILEDOWNLOADS_RES, // 鐗堟湰鏇存柊鏂囦欢涓嬭浇鍝嶅簲 + DOWNLOADSUCCESSFULLY_RES // 鏇存柊鏂囦欢涓嬭浇鎴愬姛鐨勫搷搴� + + //鏃ュ織 + LOGSEARCH_REQ;//鏃ュ織鏌ヨ璇锋眰 + LOGSEARCH_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 Permission + { + int admin; + int log_search; //鏃ュ織鏌ヨ + int history; //鍘嗗彶璁板綍 + int map_change;//鍦板浘 + int version_manage; // 鐗堟湰绠$悊 + int warning; //璀︽姤 + int device_manage; //璁惧绠$悊 + int pro_plan;//鐢熶骇璁″垝 + char role_name[32]; // 瑙掕壊鍚� + }; + + //鐧诲綍鍝嶅簲 + struct LoginRes + { + Head head; + char user_name[32]; + int status; // 鐧诲綍鐘舵�� + // 鐧诲綍鎴愬姛鏃讹紝璇ヨ处鍙峰搴旂殑鏉冮檺缁勫悎 + Permission per; + LoginRes() + { + head.type = LOGIN_RES; + head.len = sizeof(LoginRes); + }; + }; + + //娉ㄥ唽璇锋眰 + struct RegisterReq + { + Head head; + char user_name[32]; + char password[32]; + char email[50]; + int telephone; + RegisterReq(){ + head.type = REGISTER_REQ; + head.len = sizeof(RegisterReq); + } + }; + + //娉ㄥ唽鍝嶅簲 + struct RegisterRes + { + Head head; + char user_name[32]; + int status; // 娉ㄥ唽鐘舵�� + //娉ㄥ唽鎴愬姛锛岄粯璁ゆ渶灏忔潈闄愮粍鍚� + Permission per; + RegisterRes() + { + head.type = REGISTER_RES; + head.len = sizeof(RegisterRes); + }; + }; + + //閲嶇疆瀵嗙爜璇锋眰 + struct ResetReq + { + Head head; + char email[50]; + char password[32]; + ResetReq(){ + head.type = RESET_REQ; + head.len = sizeof(ResetReq); + } + }; + + //閲嶇疆瀵嗙爜鍝嶅簲 + struct ResetRes + { + Head head; + char user_name[32]; + int status; // 閲嶇疆瀵嗙爜鐘舵�� + ResetRes() + { + head.type = RESET_RES; + head.len = sizeof(ResetRes); + }; + }; + + +// 鍘嗗彶鏌ヨ璇锋眰缁撴瀯浣� +struct HistoryQueryReq { + Head head; + //鏍规嵁鏃堕棿鑼冨洿鏌ヨ + char start_time[32]; + char end_time[32]; + + HistoryQueryReq() { + // 鍒濆鍖栨暟鎹ご + head.type = HISTORY_QUERY_REQ; + head.len = sizeof(HistoryQueryReq); + // 鍒濆鍖栨煡璇㈡潯浠跺瓧娈� + std::memset(start_time, 0, sizeof(start_time)); + std::memset(end_time, 0, sizeof(end_time)); + } +}; + + +// 鍘嗗彶鏌ヨ鍝嶅簲缁撴瀯浣� +struct HistoryQueryRes { + Head head; + + char results[1024][32]; + int result_count; + + HistoryQueryRes() { + // 鍒濆鍖栨暟鎹ご + head.type = HISTORY_QUERY_RES; + head.len = sizeof(HistoryQueryRes); + // 鍒濆鍖栫粨鏋滅浉鍏冲瓧娈� + result_count = 0; + std::memset(results, 0, sizeof(results)); + } +}; + + +// 鎸夊憳宸ョ紪鍙枫�佸悕瀛楁垨鑱屼綅鏌ヨ浜哄憳鏉冮檺淇℃伅璇锋眰 +typedef struct QueryPmsRequest{ + Head head; + char userNo[32]; + char name[32]; + char permissonType[32]; + QueryPmsRequest(){ + head.type=QUERY_PMS_REQ; + userNo[32] = {0}; + name[32] = {0}; + permissonType[32] = {0}; + head.len = sizeof(QueryPmsRequest); + } +} QueryPmsRequest; + +// 鎸夎鑹瞚d鏇存柊鏉冮檺淇℃伅璇锋眰 +typedef struct UpdatePmsRequest{ + Head head; + int roleId; + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; + UpdatePmsRequest(){ + head.type=QUERY_PMS_RES; + head.len = sizeof(UpdatePmsRequest); + } +} UpdatePmsRequest; + +// 鍗曚釜浜哄憳鏉冮檺缁撴瀯浣� +typedef struct UserAboutPms{ + + int queryHistory; + int loggerSearch; + int mapMark; + int devManage; + int productPlan; + int roleId; + char userNo[32]; + char name[32]; + char permissonType[32]; + char startDateTime[32]; + char endDateTime[32]; + +} PmsRes; + +// 鏌ヨ浜哄憳鍜岃鑹蹭俊鎭殑鍝嶅簲缁撴瀯浣� +typedef struct UserAboutPmsResponse{ + Head head; + int success; // 1涓烘垚鍔� ,0涓哄け璐� + PmsRes pmsList[100]; + UserAboutPmsResponse(){ + head.type=QUERY_PMS_RES; + head.len = sizeof(UserAboutPmsResponse); + } +} QueryPmsResponse; + +// 鏉冮檺鏇存柊缁撴灉鍝嶅簲浣� +typedef struct UpdatePmsResponse{ + Head head; + int success; // 1涓烘垚鍔� ,0涓哄け璐� + UpdatePmsResponse(){ + head.type = UPDATE_PMS_RES; + head.len = sizeof(UpdatePmsResponse); + } + +} UpdatePmsResponse ; + +//鍦板浘鏍囨敞璇锋眰 +struct MapMarkReq +{ + Head head; + int marktype;//鎻掑叆銆佸垹闄ゃ�� + char msg[0];//鏌旀�ф暟缁� + LoginReq(){ + head.type = MAPMARK_REQ; + head.len = sizeof(MapMarkReq); + } +}; + +//鍦板浘鍝嶅簲锛� +struct MarkInfo +{ + int mark_id;//鏍囨敞鐐筰d + string latitude;//绾害 + string longitude;//缁忓害 + int device_id;//璁惧ID + int device_status;//璁惧鐘舵�� + string device_name;//璁惧鍚嶇О +}; + +struct MapMarkRes ////鍦板浘鏍囨敞鍝嶅簲 +{ + Head head; + int marktype;//鎻掑叆杩樻槸鍒犻櫎 + int status; // 鎿嶄綔鐘舵�乢鎴愬姛/澶辫触 + MaskInfo info[0];//鏌旀�ф暟缁� + MapMarkRes() + { + head.type = MAPMARK_RES; + head.len = sizeof(MapMarkRes); + }; +}; + + +//鐜鏁版嵁璇锋眰 +struct EnvironmentReq +{ + Head head; + float temp;//娓╁害 + float humidity;//婀垮害 + float oxygen;//姘ф皵娴撳害 + float carbon;//涓�姘у寲纰虫祿搴� + EnvironmentReq(){ + head.type = ENVIRONMENT_REQ; + head.len = sizeof(EnvironmentReq); + } +}; +//璁惧鐘舵�佽姹� +struct DeviceStatusReq +{ + Head head; + int device_ID;//璁惧缂栧彿 + char device_Name[32];//璁惧鍚嶇О + char device_Status[32];//璁惧鐘舵�� + DeviceStatusReq(){ + head.type = DEVICESTATUS_REQ; + head.len = sizeof(DeviceStatusReq); + } +}; +//鎿嶄綔鏃ュ織璇锋眰 +struct MovementRecordReq +{ + Head head; + char user_Name;//鎿嶄綔鐢ㄦ埛鍚� + char alarm_Time[32];//鎿嶄綔鏃堕棿 + char device_Name[32];//鎿嶄綔璁惧 + char movement[256];//鎿嶄綔鎻忚堪 + MovementRecordReq(){ + head.type = MOVEMENTRECORD_REQ; + head.len = sizeof(MovementRecordReq); + } +}; +//璀︽姤璁板綍璇锋眰 +struct AlarmRecordReq +{ + Head head; + char alarm_Time[32];//璀︽姤鏃堕棿 + char alarm_type[32];//瑙e喅鏃堕棿 + char alarm_Content[256];//璀︽姤鍐呭 + AlarmRecordReq(){ + head.type = ALARMRECORD_REQ; + head.len = sizeof(AlarmRecordReq); + } +}; +//鐓ょ熆浜ч噺璇锋眰 +struct YieldReq +{ + Head head; + int month;//鏈堜唤 + int yield;//浜ч噺 + YieldReq(){ + head.type = YIELD_REQ; + head.len = sizeof(YieldReq); + } +}; + +//娣诲姞涓�琛屾暟鎹殑璇锋眰缁撴瀯浣� +struct AddProductionPlanReq { + Head head; + int type; + char productionDate[32]; + int productionQuantity; + int plannedProductionQuantity; + int predictedProductionQuantity; + char logText[256]; + AddProductionPlanReq() { + head.type = ADDPRODUCTIONPLAN_REQ; + head.len = sizeof(AddProductionPlanReq); + } +}; +//娣诲姞涓�琛屾暟鎹殑鍝嶅簲缁撴瀯浣� +struct AddProductionPlanRes { + Head head; + int type; + int status; // 鍙互琛ㄧず娣诲姞鏄惁鎴愬姛锛� 0 琛ㄧず澶辫触锛�1 琛ㄧず鎴愬姛 + AddProductionPlanRes() { + head.type = ADDPRODUCTIONPLAN_RES; + head.len = sizeof(AddProductionPlanRes); + } +}; + +// 鏇存柊鐢熶骇璁″垝锛堣鍒掔敓浜ч噺锛夌殑璇锋眰缁撴瀯浣� +struct UpdateProductionPlanQuantityReq { + Head head; + int type; + int plannedProductionQuantity; + char productionDate[32]; + UpdateProductionPlanQuantityReq() { + head.type = UPDATEPRODUCTIONPLANQUANTITY_REQ; + head.len = sizeof(UpdateProductionPlanQuantityReq); + } +}; +// 鏇存柊鐢熶骇璁″垝锛堣鍒掔敓浜ч噺锛夌殑鍝嶅簲缁撴瀯浣� +struct UpdateProductionPlanQuantityRes { + Head head; + int type; + int status; // 鍙互琛ㄧず鏇存柊鏄惁鎴愬姛锛屼緥濡� 0 琛ㄧず澶辫触锛�1 琛ㄧず鎴愬姛 + UpdateProductionPlanQuantityRes() { + head.type = UPDATEPRODUCTIONPLANQUANTITY_RES; + head.len = sizeof(UpdateProductionPlanQuantityRes); + } +}; + + +// 鏇存柊鐢熶骇璁″垝锛堟棩蹇楋級鐨勮姹傜粨鏋勪綋 +struct UpdateProductionPlanLogReq { + Head head; + int type; + char logText[256]; + char productionDate[32]; + UpdateProductionPlanLogReq() { + head.type = UPDATEPRODUCTIONPLANLOG_REQ; + head.len = sizeof(UpdateProductionPlanLogReq); + } +}; +// 鏇存柊鐢熶骇璁″垝璇锋眰锛堟棩蹇楋級鐨勫搷搴旂粨鏋勪綋 +struct UpdateProductionPlanLogRes { + Head head; + int type; + int status; // 鍙互琛ㄧず鏇存柊鏄惁鎴愬姛锛屼緥濡� 0 琛ㄧず澶辫触锛�1 琛ㄧず鎴愬姛 + UpdateProductionPlanLogRes() { + head.type = UPDATEPRODUCTIONPLANLOG_RES; + head.len = sizeof(UpdateProductionPlanLogRes); + } +}; + + + +// 鏌ヨ鐢熶骇璁″垝淇℃伅璇锋眰 +struct ProductionPlanReq { + Head head; + int type; + int len; + char productionDate[32]; + int productionQuantity; + int plannedProductionQuantity; + int predictedProductionQuantity; + char logText[256]; + ProductionPlanReq() { + head.type = PRODUCTIONPLAN_REQ; + head.len = sizeof(ProductionPlanReq); + } +}; +// 鏌ヨ鐢熶骇璁″垝淇℃伅鐨勫搷搴旂粨鏋勪綋 +struct ProductionPlanRes { + Head head; + int type; + int len; + int productionQuantity; + int plannedProductionQuantity; + int predictedProductionQuantity; + int roleId; + char productionDate[32]; + char logText[256]; + ProductionPlanRes() { + head.type = PRODUCTIONPLAN_REQ; + head.len = sizeof(ProductionPlanRes); + } +}; + + + +//鏌ヨ杩戝崄鍥涙潯鐨勮姹傜粨鏋勪綋 +struct RecentFourteenProductionPlansReq { + Head head; + int requestType; + RecentFourteenProductionPlansReq() { + head.type = RECENTFOURTEENPRODUCTIONPLANS_REQ; + head.len = sizeof(RecentFourteenProductionPlansReq); + } +}; +//鏌ヨ杩戝崄鍥涙潯鐨勫搷搴旂粨鏋勪綋 +struct RecentFourteenProductionPlansRes { + Head head; + int responseType; + int responseLength; + int productionQuantities[14]; + int plannedProductionQuantities[14]; + int predictedProductionQuantities[14]; + int roleIds[14]; + char productionDates[14][32]; + char logTexts[14][256]; + RecentFourteenProductionPlansRes() { + head.type = UPDATEPRODUCTIONPLANQUANTITY_REQ; + head.len = sizeof(RecentFourteenProductionPlansRes); + } +}; + + + +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[128]; + char content[0]; +}; + +struct UploadFileReq // 涓婁紶鏂囦欢鐨勮姹� +{ + Head head; + FileInfo fileInfo; + UploadFileReq() { + head.type = UPLOAD_FILE_REQ; + head.len = sizeof(UploadFileReq); + } +}; + +struct UploadFileRes { // 涓婁紶鏂囦欢鐨勫搷搴� + Head head; + bool state = false; + char file_name[256]; + long long file_size; + 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[16][128]; //鏈嶅姟鍣ㄦ斁鏈�鏂扮増鏈殑璺緞 + 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; + bool state = false; + VersionInfoEntryRes() + { + head.type = VERSIONINFOENTRY_RES; + head.len = sizeof(VersionInfoEntryRes); + } +}; + +// 鐗堟湰鏇存柊璇锋眰 +struct VersionUpdateReq { + Head head; + + char cur_version_id[64]; // 鐗堟湰鍙� + VersionUpdateReq() + { + head.type = VERSIONUPDATE_REQ; + head.len = sizeof(VersionUpdateReq); + } +}; + +// 鐗堟湰鏇存柊鍝嶅簲 +struct VersionUpdateRes { + Head head; + bool state = false; + char version_id[64]; // 鐗堟湰鍙� + char update_date[32]; // 鏇存柊鏃堕棿 + char version_description[1024]; //鏇存柊鎻忚堪 + + VersionUpdateRes() + { + head.type = VERSIONUPDATE_RES; + head.len = sizeof(VersionUpdateRes); + } +}; + +// 鐗堟湰鏇存柊鏂囦欢涓嬭浇璇锋眰 +struct FileDownloadsReq { + Head head; + char version_id[64]; // 鐗堟湰鍙� + FileDownloadsReq() + { + head.type = FILEDOWNLOADS_REQ; + head.len = sizeof(FileDownloadsReq); + } +}; + +// 鐗堟湰鏇存柊鏂囦欢涓嬭浇鍝嶅簲 +struct FileDownloadsRes { + Head head; + char version_id[64]; // 鐗堟湰鍙� + char filename[128]; //鏂囦欢鍚� + long long filesize; //鏂囦欢澶у皬 + char c_filepath[128]; //瀹㈡埛绔斁鏈�鏂扮増鏈殑鏈湴璺緞 + int fileNum; // 鏂囦欢鏁伴噺 + long long all_fileSize; // 鏂囦欢鎬诲ぇ灏� + char content[0]; + FileDownloadsRes() + { + head.type = FILEDOWNLOADS_RES; + head.len = sizeof(FileDownloadsRes); + } +}; + +// 鏇存柊鏂囦欢涓嬭浇鎴愬姛鐨勫搷搴� +struct DownloadSuccessfullyRes{ + Head head; + bool state = false; + char file_name[256]; + long long file_size; + DownloadSuccessfullyRes() + { + head.type = DOWNLOADSUCCESSFULLY_RES; + head.len = sizeof(DownloadSuccessfullyRes); + } +}; + + +struct LogQueryRequest { + Head header; // 鏁版嵁澶� + std::string* keywords; // 瀛樺偍澶氫釜鍏抽敭瀛楃殑鏌旀�ф暟缁� + size_t keywordCount; // 鍏抽敭瀛楁暟閲� + std::string startDate; // 寮�濮嬫棩鏈� (鏍煎紡: YYYY-MM-DD) + std::string endDate; // 缁撴潫鏃ユ湡 (鏍煎紡: YYYY-MM-DD) + int pageNumber; // 褰撳墠椤电爜 + int pageSize; // 姣忛〉鏉$洰鏁� + + // 鏋勯�犲嚱鏁� + LogQueryRequest(int type, int len, std::string* keywords, size_t keywordCount, const std::string& startDate, const std::string& endDate, int pageNumber, int pageSize) + : header{type, len}, keywords(keywords), keywordCount(keywordCount), startDate(startDate), endDate(endDate), pageNumber(pageNumber), pageSize(pageSize) {} + + // 鏋愭瀯鍑芥暟 + ~LogQueryRequest() { + delete[] keywords; // 閲婃斁鍔ㄦ�佸垎閰嶇殑鍐呭瓨 + } +}; + +//鏃ュ織鏌ヨ鍝嶅簲 +// 瀹氫箟鏃ュ織鏉$洰缁撴瀯浣� +struct LogEntry { + int id; // 鏃ュ織鏉$洰 ID + string entryTime; // 涓嬩簳鏃堕棿 + string name; // 濮撳悕 + string exitTime; // 鍗囦簳鏃堕棿 + string department; // 閮ㄩ棬 + string position; // 宀椾綅 + //string workingTime; // 宸ヤ綔鏃堕棿 鏁版嵁搴撹嚜鍔ㄧ敓鎴� + + // 鏋勯�犲嚱鏁� + LogEntry(int id, const string& entryTime, const string& name, + const string& exitTime, const string& department, + const string& position) + : id(id), entryTime(entryTime), name(name), + exitTime(exitTime), department(department), position(position) {} +}; + +// 瀹氫箟鏃ュ織鏌ヨ鍝嶅簲缁撴瀯浣� +struct LogQueryResponse { + int status; // 鍝嶅簲鐘舵�� (濡� 0 琛ㄧず鎴愬姛锛岄潪 0 琛ㄧず澶辫触) + string errorMessage; // 閿欒淇℃伅锛堝鏋滄湁锛� + vector<LogEntry> logEntries; // 鏃ュ織鏉$洰 + + // 鏋勯�犲嚱鏁� + LogQueryResponse(int status, const string& errorMessage, const vector<LogEntry>& logEntries) + : status(status), errorMessage(errorMessage), logEntries(logEntries) {} +}; + + + + +#endif // COMMON_H \ No newline at end of file -- Gitblit v1.8.0