Client/¼½ºÆêÆ/document/Éú²ú¼Æ»®¹ÜÀí_ÐèÇó·ÖÎö.docxBinary files differ
Client/¼½ºÆêÆ/log/ÈÕÖ¾_¼½ºÆêÆ_1031.docBinary files differ
Client/½ª¿É¸ý/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/2024kunlun_project_permisson.pro.user
New file @@ -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> Client/½ª¿É¸ý/code/2024kunlun_project_permisson/PmsClientSocket.cpp
New file @@ -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, "æ´æ°ç»æ", "æéä¿¡æ¯æ´æ°å¤±è´¥"); } } } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/PmsClientSocket.cpp.autosave
New file @@ -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, "æ´æ°ç»æ", "æéä¿¡æ¯æ´æ°å¤±è´¥"); } } } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/PmsClientSocket.h
New file @@ -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; // æè§è²idæ´æ°æéä¿¡æ¯è¯·æ± 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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/main.cpp
New file @@ -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(); } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/mainwindow.cpp
New file @@ -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; } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/mainwindow.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/mainwindow.ui
New file @@ -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> Client/½ª¿É¸ý/code/2024kunlun_project_permisson/modeldisplay.cpp
New file @@ -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; } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/modeldisplay.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/modeldisplay.ui
New file @@ -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> Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissondialog.cpp
New file @@ -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); } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissondialog.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissondialog.ui
New file @@ -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> Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissonwindow.cpp
New file @@ -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(); } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissonwindow.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/permissonwindow.ui
New file @@ -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> Client/½ª¿É¸ý/code/2024kunlun_project_permisson/pmsparam.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/pmsplusparam.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/pmsqueryresult.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/qcomboxdelegate.cpp
New file @@ -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); } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/qcomboxdelegate.h
New file @@ -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 Client/½ª¿É¸ý/code/2024kunlun_project_permisson/syncdatatodb.cpp
New file @@ -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()); } Client/½ª¿É¸ý/code/2024kunlun_project_permisson/syncdatatodb.h
New file @@ -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 Client/½ª¿É¸ý/log/½ª¿É¸ý_1030.docBinary files differ
Client/½ª¿É¸ý/log/½ª¿É¸ý_1031.doccopy 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" Binary files differ
Client/ËÎê»i/document/ϵͳÉèÖÃÐèÇó·ÖÎö.docxBinary files differ
Client/ËÎê»i/log/ÈÕÖ¾_ËÎê»i_1031.docBinary files differ
Client/ÀîÏüÔö/document/ÀúÊ·²éѯ·ÖÎöÄ£¿éÐèÇó·ÖÎö.docxBinary files differ
Client/ÀîÏüÔö/log/ÀúÊ·²éѯ_ÀîÏüÔö_1030.docBinary files differ
Client/ÍõöÎöÎ/log/ÈÕÖ¾_ÍõöÎöÎ_1031.docBinary files differ
Client/ÍõöÎöÎ/log/À¥ÂØ_1031ÏîÄ¿ÈÕ±¨.docBinary files differ
Client/Éê@/document/×¢²áµÇ¼Êý¾Ý¿â±í.docxBinary files differ
Client/Éê@/document/×¢²áµÇ¼ÐèÇó·ÖÎö.docxBinary files differ
Client/Éê@/log/ÈÕÖ¾_×¢²áµÇ¼_2024.10.31.doccopy 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" Binary files differ
Client/Ö£¿ÎÄ/document/À¥ÂØ1031_ÏîÄ¿ÈÕ±¨.docBinary files differ
Client/Ö£¿ÎÄ/log/Ö£¿ÎÄ1030.docBinary files differ
Client/Ö£¿ÎÄ/log/Ö£¿ÎÄ1031.doccopy 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" Binary files differ
Client/ÀèºëÁØ/code/Devices_Management_Struct.h
New file @@ -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); } }; Client/ÀèºëÁØ/code/device_management.zipBinary files differ
Client/ÀèºëÁØ/log/É豸¹ÜÀí_ÀèºëÁØ_1031.doccopy 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" Binary files differ
Server/Àîתת/log/log_1031.docBinary files differ
Server/ÍõçûÔª/code/ConnectionPool.cpp
New file @@ -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; } Server/ÍõçûÔª/code/ConnectionPool.h
New file @@ -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(); }; Server/ÍõçûÔª/code/MysqlConn.cpp
New file @@ -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(); } Server/ÍõçûÔª/code/MysqlConn.h
New file @@ -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(); }; Server/ÍõçûÔª/document/½¨±í.docxBinary files differ
Server/ÍõçûÔª/log/ÈÕ־ģ°å_ÍõçûÔª_1030.docBinary files differ
Server/ºú¼ÒÃ÷/log/ÈÕÖ¾_ºú¼ÒÃ÷_1031.docBinary files differ
Server/³Â³þµ¤/log/ÈÕÖ¾_³Â³þµ¤_1031.doccopy 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" Binary files differ
Server/ÂíÀöƼ/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); // æ¸ çåå¤è¯å¥ } // è§£ææ¥å¿å符串 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]; // è¯»åæ¶é´æ³ã设å¤ID忥å¿çº§å« iss >> parsed_log.timestamp >> parsed_log.device_id >> level; std::getline(iss, parsed_log.content); parsed_log.level = level; // 设置解æåççº§å« sscanf(log, "%s %s %s %[^\n]", parsed_log.timestamp, parsed_log.device_id, level, parsed_log.content); // 设置解æåççº§å« 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) { // ... (æ¥å¿è½®æ¢ä»£ç ) 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(); // è§£éäºæ¥ä½ @@ -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; // éç½®æ¥å¿è®¡æ° } Server/ÂíÀöƼ/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 @@ // åå¨è§£ææ¥å¿æä»¶çç»æä½ 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); // è§£ææ¥å¿ 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); // è§£ææ¥å¿ 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();} Server/ÂíÀöƼ/document/ÈÕÖ¾ÐèÇó·ÖÎöÎĵµ.docxBinary files differ
Server/ÂíÀöƼ/log/log_1031.docBinary files differ
Server/ÂíÓ庼/code/common.h
New file @@ -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 Server/ÂíÓ庼/log/20241031À¥ÂØÈÕ±¨.docBinary files differ
Server/ÂíÓ庼/log/ÈÕÖ¾_ÂíÓ庼_20241030.doccopy 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" Binary files differ
common.h
New file @@ -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, // æè§è²idæ´æ°æéä¿¡æ¯è¯·æ± 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; // æè§è²idæ´æ°æéä¿¡æ¯è¯·æ± 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;//æ æ³¨ç¹id 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];//è§£å³æ¶é´ 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