Commit b8493227 by zzrdark

1.增加数据库数据

2.增加数据权限拦截
3.增加分页插件
4.增加系统模块查询
parent ec75ecf6
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="58efcb75-622d-40c1-b8e0-10cd2fb456b4" name="Default Changelist" comment="1.修改项目结构&#10;2.登陆&#10;3.等等">
<change afterPath="$PROJECT_DIR$/cneeds-server-authorization/src/main/resources/application-dev.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-authorization/src/main/resources/application.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-eureka/src/main/resources/application-dev.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/resources/applicaiton-dev.yml" afterDir="false" />
<list default="true" id="58efcb75-622d-40c1-b8e0-10cd2fb456b4" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/FuncDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/PageDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-common-utils/src/main/java/com/mx/cneeds/common/annotation/DataFilter.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/UserClient.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/system/SystemController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/common/DataFilterAspect.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/config/MybatisPlusConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/db/cneeds_server.sql" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/db/cneeds_server.sql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-pojo/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-pojo/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysDeptDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysDeptDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysRoleDeptDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysRoleDeptDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysUserRoleDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/SysUserRoleDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysDeptDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysDeptDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysRoleDeptDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysRoleDeptDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysUserRoleDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-data/src/main/resources/mapper/SysUserRoleDao.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-utils/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-utils/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-authorization/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-authorization/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-authorization/cneeds-server-authorization.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-authorization/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-authorization/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-authorization/src/main/resources/application.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/FeignInterceptor.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/FeignInterceptor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/OAuth2ResourceServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/OAuth2ResourceServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/WebConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/WebConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/user/UserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/user/UserController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/resources/application-dev.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-eureka/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-eureka/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-eureka/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-eureka/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-eureka/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-eureka/src/main/resources/application.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/resources/application.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-common-utils/src/main/java/com/mx/cneeds/common/pager/Query.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-common-utils/src/main/java/com/mx/cneeds/common/pager/Query.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/user/UserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/system/UserController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysDeptService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysDeptService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysRoleDeptService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysRoleDeptService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserRoleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/SysUserRoleService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysDeptServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysDeptServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysRoleDeptServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysRoleDeptServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserRoleServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/service/impl/SysUserRoleServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/web/SysFuncController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cneeds-server-user/src/main/java/com/mx/cneeds/server/user/web/SysFuncController.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -62,6 +64,7 @@
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="ROOT_SYNC" value="DONT_SYNC" />
<option name="UPDATE_TYPE" value="MERGE" />
</component>
<component name="IgnoredFileRootStore">
<option name="generatedRoots">
......@@ -73,8 +76,8 @@
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="$USER_HOME$/environment/apache-maven-3.6.0" />
<option name="userSettingsFile" value="$USER_HOME$/environment/apache-maven-3.6.0/conf/settings.xml" />
<option name="mavenHome" value="D:/ENV/apache-maven-3.6.1" />
<option name="userSettingsFile" value="D:\ENV\apache-maven-3.6.1\conf\settings.xml" />
</MavenGeneralSettings>
</option>
</component>
......@@ -95,17 +98,16 @@
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow" />
<property name="last_opened_file_path" value="E:/project/IdeaProjects/renren-security" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2916053" />
<property name="settings.editor.selected.configurable" value="MavenSettings" />
<property name="settings.editor.selected.configurable" value="settings.github" />
<property name="settings.editor.splitter.proportion" value="0.20898877" />
</component>
<component name="RecentsManager">
......@@ -117,11 +119,11 @@
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.mx.cneeds.server.user.common" />
<recent name="com.mx.cneeds.common.annotation" />
<recent name="com.mx.cneeds.server.datashow.filter" />
<recent name="com.mx.cneeds.common.vo" />
<recent name="com.mx.cneeds.server.datashow.config" />
<recent name="com.mx.cneeds.common" />
<recent name="com.mx.cneeds.common.result" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\mx_project\cneeds-server\cneeds-server-datashow\src\main\java\com\mx\cneeds" />
......@@ -130,27 +132,7 @@
<recent name="E:\mx_project\cneeds-server\src" />
</key>
</component>
<component name="RunManager" selected="Spring Boot.DatashowApplication">
<configuration name="EurekaServerApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.mx.cneeds.server.eureka.EurekaServerApplication" />
<module name="cneeds-server-eureka" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="RequestParamterConverter" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.mx.cneeds.common.converter.RequestParamterConverter" />
<module name="cneeds-common-utils" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.mx.cneeds.common.converter.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<component name="RunManager" selected="Spring Boot.UserServerApplication">
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<module name="cneeds-server-advice-control" />
<option name="VM_PARAMETERS" />
......@@ -198,6 +180,26 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="EurekaServerApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.mx.cneeds.server.eureka.EurekaServerApplication" />
<module name="cneeds-server-eureka" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="RequestParamterConverter" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.mx.cneeds.common.converter.RequestParamterConverter" />
<module name="cneeds-common-utils" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.mx.cneeds.common.converter.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="AuthorizaitonApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="cneeds-server-authorization" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.mx.cneeds.server.anthorization.AuthorizaitonApplication" />
......@@ -278,9 +280,7 @@
<workItem from="1583320312435" duration="9970000" />
<workItem from="1583395022330" duration="616000" />
<workItem from="1583395719361" duration="15264000" />
<workItem from="1583477272057" duration="183000" />
<workItem from="1583477731081" duration="6700000" />
<workItem from="1583485000764" duration="3436000" />
<workItem from="1583723774754" duration="21319000" />
</task>
<task id="LOCAL-00001" summary="1.修改不需要web服务 &#10;2.增加一个logupload">
<created>1578451117064</created>
......@@ -354,15 +354,14 @@
<option name="LAST_COMMIT_MESSAGE" value="1.修改项目结构&#10;2.登陆&#10;3.等等" />
</component>
<component name="WindowStateProjectService">
<state x="483" y="199" key="#Project_Structure" timestamp="1583483296021">
<screen x="0" y="23" width="1680" height="1027" />
<state x="552" y="178" key="#Project_Structure" timestamp="1583316360973">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="552" y="178" key="#Project_Structure/0.0.1920.1040@0.0.1920.1040" timestamp="1583316360973" />
<state x="483" y="199" key="#Project_Structure/0.23.1680.1027@0.23.1680.1027" timestamp="1583483296021" />
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser" timestamp="1583390885636">
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser" timestamp="1583740715738">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1583390885636" />
<state x="765" y="229" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1583740715738" />
<state x="640" y="246" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1582697117117">
<screen x="0" y="0" width="1920" height="1040" />
</state>
......@@ -375,75 +374,62 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="690" y="266" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1583224455231" />
<state x="405" y="134" key="CommitChangelistDialog2" timestamp="1583483819735">
<screen x="0" y="23" width="1680" height="1027" />
<state x="463" y="112" key="CommitChangelistDialog2" timestamp="1583325330372">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="463" y="112" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1583325330372" />
<state x="405" y="134" key="CommitChangelistDialog2/0.23.1680.1027@0.23.1680.1027" timestamp="1583483819735" />
<state x="294" y="139" key="DiffContextDialog" timestamp="1583483818288">
<screen x="0" y="23" width="1680" height="1027" />
<state x="740" y="275" key="FileChooserDialogImpl" timestamp="1583737037918">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="294" y="139" key="DiffContextDialog/0.23.1680.1027@0.23.1680.1027" timestamp="1583483818288" />
<state width="1638" height="139" key="GridCell.Tab.0.bottom" timestamp="1583488675893">
<screen x="0" y="23" width="1680" height="1027" />
<state x="740" y="275" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1583737037918" />
<state width="1877" height="274" key="GridCell.Tab.0.bottom" timestamp="1583751980495">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="386" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583416459517" />
<state width="1638" height="139" key="GridCell.Tab.0.bottom/0.23.1680.1027@0.23.1680.1027" timestamp="1583488675893" />
<state width="1638" height="139" key="GridCell.Tab.0.center" timestamp="1583488675893">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="274" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583751980495" />
<state width="1877" height="274" key="GridCell.Tab.0.center" timestamp="1583751980495">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="386" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583416459517" />
<state width="1638" height="139" key="GridCell.Tab.0.center/0.23.1680.1027@0.23.1680.1027" timestamp="1583488675893" />
<state width="1638" height="139" key="GridCell.Tab.0.left" timestamp="1583488675892">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="274" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583751980495" />
<state width="1877" height="274" key="GridCell.Tab.0.left" timestamp="1583751980495">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="386" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583416459517" />
<state width="1638" height="139" key="GridCell.Tab.0.left/0.23.1680.1027@0.23.1680.1027" timestamp="1583488675892" />
<state width="1638" height="139" key="GridCell.Tab.0.right" timestamp="1583488675893">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="274" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583751980495" />
<state width="1877" height="274" key="GridCell.Tab.0.right" timestamp="1583751980495">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="386" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583416459517" />
<state width="1638" height="139" key="GridCell.Tab.0.right/0.23.1680.1027@0.23.1680.1027" timestamp="1583488675893" />
<state width="1638" height="345" key="GridCell.Tab.1.bottom" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="274" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583751980495" />
<state width="1877" height="336" key="GridCell.Tab.1.bottom" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.1.bottom/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.1.center" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.1.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.1.center" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.1.center/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.1.left" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.1.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.1.left" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.1.left/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.1.right" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.1.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.1.right" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.1.right/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.2.bottom" timestamp="1583488634807">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.1.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.2.bottom" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.2.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.2.bottom/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634807" />
<state width="1638" height="345" key="GridCell.Tab.2.center" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.2.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.2.center" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.2.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.2.center/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.2.left" timestamp="1583488634806">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.2.center/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.2.left" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.2.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.2.left/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634806" />
<state width="1638" height="345" key="GridCell.Tab.2.right" timestamp="1583488634807">
<screen x="0" y="23" width="1680" height="1027" />
<state width="1877" height="336" key="GridCell.Tab.2.left/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state width="1877" height="336" key="GridCell.Tab.2.right" timestamp="1583751863551">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="338" key="GridCell.Tab.2.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583407423488" />
<state width="1638" height="345" key="GridCell.Tab.2.right/0.23.1680.1027@0.23.1680.1027" timestamp="1583488634807" />
<state width="1877" height="336" key="GridCell.Tab.2.right/0.0.1920.1040@0.0.1920.1040" timestamp="1583751863551" />
<state x="490" y="175" key="Maven.ArtifactSearchDialog" timestamp="1583320014926">
<screen x="0" y="0" width="1920" height="1040" />
</state>
......@@ -452,34 +438,36 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="600" y="217" key="NewModule_or_Project.wizard/0.0.1920.1040@0.0.1920.1040" timestamp="1582699806601" />
<state x="383" y="187" width="1183" height="722" key="SettingsEditor" timestamp="1583479490341">
<screen x="0" y="23" width="1680" height="1027" />
<state x="438" y="166" width="1352" height="708" key="SettingsEditor" timestamp="1583725437328">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="438" y="166" width="1352" height="708" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1583395654566" />
<state x="383" y="187" width="1183" height="722" key="SettingsEditor/0.23.1680.1027@0.23.1680.1027" timestamp="1583479490341" />
<state x="438" y="166" width="1352" height="708" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1583725437328" />
<state x="552" y="253" key="Vcs.Push.Dialog.v2" timestamp="1583325340355">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1583325340355" />
<state x="449" y="262" width="962" height="472" key="find.popup" timestamp="1583485196950">
<screen x="0" y="23" width="1680" height="1027" />
<state x="752" y="437" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1583724603426">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="449" y="262" width="962" height="472" key="find.popup/0.23.1680.1027@0.23.1680.1027" timestamp="1583485196950" />
<state x="752" y="437" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1920.1040@0.0.1920.1040" timestamp="1583724603426" />
<state x="511" y="210" key="new project wizard" timestamp="1583318693876">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="511" y="210" key="new project wizard/0.0.1920.1040@0.0.1920.1040" timestamp="1583318693876" />
<state x="539" y="194" width="670" height="668" key="search.everywhere.popup" timestamp="1583485574280">
<screen x="0" y="23" width="1680" height="1027" />
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup" timestamp="1583751643474">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1583314608796" />
<state x="539" y="194" width="670" height="668" key="search.everywhere.popup/0.23.1680.1027@0.23.1680.1027" timestamp="1583485574280" />
<state x="616" y="173" width="672" height="676" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1583751643474" />
</component>
<component name="XDebuggerManager">
<watches-manager>
<configuration name="SpringBootApplicationConfigurationType">
<watch expression="request.getRequestURL().toString()" language="JAVA" />
</configuration>
</watches-manager>
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>jar://$MAVEN_REPOSITORY$/com/baomidou/mybatis-plus-extension/3.1.2/mybatis-plus-extension-3.1.2-sources.jar!/com/baomidou/mybatisplus/extension/service/impl/ServiceImpl.java</url>
<line>275</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
......@@ -108,7 +108,7 @@ CREATE TABLE `sys_func` (
`parent_id` bigint(20) NOT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`url` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`perms` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`perms` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`order_num` int(11) DEFAULT NULL,
PRIMARY KEY (`func_id`) USING BTREE
......
......@@ -17,7 +17,8 @@
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>
<pagehelper.spring.boot.version>1.2.5</pagehelper.spring.boot.version>
<mysql.version>8.0.16</mysql.version>
<mybatisplus.version>3.1.2</mybatisplus.version>
<!-- <mybatisplus.version>3.1.2</mybatisplus.version>-->
<mybatisplus.version>3.0.7.1</mybatisplus.version>
<druid.version>1.1.13</druid.version>
</properties>
......
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mx.cneeds.server.entity.SysDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 部门表
*
......@@ -14,4 +16,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysDeptDao extends BaseMapper<SysDeptEntity> {
/**
* 查询子部门ID列表
* @param parentId 上级部门ID
*/
List<Long> queryDetpIdList(Long parentId);
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 部门与角色映射表
*
......@@ -14,4 +16,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysRoleDeptDao extends BaseMapper<SysRoleDeptEntity> {
/**
* 根据角色ID,获取部门ID列表
*/
List<Long> queryDeptIdList(Long[] roleIds);
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mx.cneeds.server.entity.SysUserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 角色用户映射表
*
......@@ -14,4 +16,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysUserRoleDao extends BaseMapper<SysUserRoleEntity> {
/**
* 根据用户ID,获取角色ID列表
*/
List<Long> queryRoleIdList(Long userId);
}
......@@ -14,4 +14,8 @@
</resultMap>
<select id="queryDetpIdList" resultType="long">
select dept_id from sys_dept where parent_id = #{value} and del_flag = 0
</select>
</mapper>
\ No newline at end of file
......@@ -11,4 +11,11 @@
</resultMap>
<select id="queryDeptIdList" resultType="long">
select dept_id from sys_role_dept where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -10,5 +10,8 @@
<result property="roleId" column="role_id"/>
</resultMap>
<select id="queryRoleIdList" resultType="long">
select role_id from sys_user_role where user_id = #{value}
</select>
</mapper>
\ No newline at end of file
package com.mx.cneeds.common.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName FuncDto
* @Author zzrdark
* @Date 2020-03-09 16:17
* @Description TODO
**/
@Data
public class FuncDto implements Serializable {
private Long funcId;
private Long parentId;
private String name;
private String url;
private String perms;
private Integer type;
private Integer orderNum;
}
package com.mx.cneeds.common.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName PageResult
* @Author zzrdark
* @Date 2020-03-09 16:01
* @Description TODO
**/
@Data
public class PageDto implements Serializable {
/**
* 总记录数
*/
private int totalCount;
/**
* 每页记录数
*/
private int pageSize;
/**
* 总页数
*/
private int totalPage;
/**
* 当前页数
*/
private int currPage;
/**
* 列表数据
*/
private List<?> list;
/**
* 分页
* @param list 列表数据
* @param totalCount 总记录数
* @param pageSize 每页记录数
* @param currPage 当前页数
*/
public PageDto(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int) Math.ceil((double)totalCount/pageSize);
}
}
......@@ -13,7 +13,8 @@
<artifactId>cneeds-common-utils</artifactId>
<properties>
<mybatisplus.version>3.1.2</mybatisplus.version>
<!-- <mybatisplus.version>3.1.2</mybatisplus.version>-->
<mybatisplus.version>3.0.7.1</mybatisplus.version>
<commons.lang.version>2.6</commons.lang.version>
<commons.io.version>2.5</commons.io.version>
</properties>
......
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.mx.cneeds.common.annotation;
import java.lang.annotation.*;
/**
* 数据过滤
*
* @author Mark sunlightcs@gmail.com
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DataFilter {
/** 表的别名 */
String tableAlias() default "";
/** true:没有本部门数据权限,也能查询本人数据 */
boolean user() default true;
/** true:拥有子部门数据权限 */
boolean subDept() default false;
/** 部门ID */
String deptId() default "dept_id";
/** 用户ID */
String userId() default "user_id";
}
......@@ -9,7 +9,6 @@
package com.mx.cneeds.common.pager;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mx.cneeds.common.xss.SQLFilter;
import org.apache.commons.lang.StringUtils;
......@@ -53,9 +52,9 @@ public class Query<T> {
//前端字段排序
if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){
if(Constant.ASC.equalsIgnoreCase(order)) {
return page.addOrder(OrderItem.asc(orderField));
return page.setAsc(orderField);
}else {
return page.addOrder(OrderItem.desc(orderField));
return page.setDesc(orderField);
}
}
......@@ -66,9 +65,9 @@ public class Query<T> {
//默认排序
if(isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField));
page.setAsc(defaultOrderField);
}else {
page.addOrder(OrderItem.desc(defaultOrderField));
page.setDesc(defaultOrderField);
}
return page;
......
package com.mx.cneeds.server.datashow.client;
import com.mx.cneeds.common.dto.JwtToken;
import com.mx.cneeds.common.dto.PageDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @ClassName UserClient
* @Author zzrdark
* @Date 2020-03-09 15:21
* @Description TODO
**/
@FeignClient(name = "CNEEDS-SERVER-USER")
public interface UserClient {
@PostMapping("/sys/func/list")
PageDto funcList();
}
package com.mx.cneeds.server.datashow.web.system;
import com.mx.cneeds.common.dto.PageDto;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.server.datashow.client.UserClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName SystemController
* @Author zzrdark
* @Date 2020-03-09 15:19
* @Description TODO
**/
@RestController
@Slf4j
@RequestMapping("/sys")
public class SystemController {
@Autowired
private UserClient userClient;
@PostMapping("/module/list")
public R funcList(){
PageDto pageDto = userClient.funcList();
return new R().put("data",pageDto);
}
}
package com.mx.cneeds.server.datashow.web.user;
package com.mx.cneeds.server.datashow.web.system;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.vo.UserInfoVo;
import com.mx.cneeds.server.datashow.client.AuthorizationClient;
import com.mx.cneeds.common.dto.JwtToken;
import com.mx.cneeds.server.datashow.client.UserClient;
import com.netflix.client.http.HttpResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,6 +30,9 @@ public class UserController {
private AuthorizationClient authenticatorClient;
@Autowired
private UserClient userClient;
/**
* 登陆接口
* @param username
......@@ -44,14 +48,16 @@ public class UserController {
}
@RequestMapping("/info")
public R getInfo(HttpServletResponse response){
public R getInfo(){
UserInfoVo userInfoVo = new UserInfoVo();
log.info("getInfo");
userInfoVo.setName("admin");
userInfoVo.setIntroduction("manager");
userInfoVo.setRoles("admin");
userInfoVo.setRoles("book:editor,admin");
userInfoVo.setAvatar("avatar");
return new R().put("data",userInfoVo);
}
}
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.mx.cneeds.server.user.common;
import com.mx.cneeds.common.annotation.DataFilter;
import com.mx.cneeds.common.exception.RRException;
import com.mx.cneeds.common.pager.Constant;
import com.mx.cneeds.server.user.service.SysDeptService;
import com.mx.cneeds.server.user.service.SysRoleDeptService;
import com.mx.cneeds.server.user.service.SysUserRoleService;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 数据过滤,切面处理类
*
* @author Mark sunlightcs@gmail.com
*/
@Aspect
@Component
public class DataFilterAspect {
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysUserRoleService sysUserRoleService;
@Autowired
private SysRoleDeptService sysRoleDeptService;
@Pointcut("@annotation(com.mx.cneeds.common.annotation.DataFilter)")
public void dataFilterCut() {
}
@Before("dataFilterCut()")
public void dataFilter(JoinPoint point) throws Throwable {
Object params = point.getArgs()[0];
if(params != null && params instanceof Map){
// SysUserEntity user = ShiroUtils.getUserEntity();
Long userId = (Long) ((Map) params).get("userId");
//如果不是超级管理员,则进行数据过滤
if(userId != Constant.SUPER_ADMIN){
Map map = (Map)params;
map.put(Constant.SQL_FILTER, getSQLFilter(userId, point));
}
return ;
}
throw new RRException("数据权限接口,只能是Map类型参数,且不能为NULL");
}
/**
* 获取数据过滤的SQL
*/
private String getSQLFilter(Long userId, JoinPoint point){
MethodSignature signature = (MethodSignature) point.getSignature();
DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class);
//获取表的别名
String tableAlias = dataFilter.tableAlias();
if(StringUtils.isNotBlank(tableAlias)){
tableAlias += ".";
}
//部门ID列表
Set<Long> deptIdList = new HashSet<>();
//用户角色对应的部门ID列表
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
if(roleIdList.size() > 0){
List<Long> userDeptIdList = sysRoleDeptService.queryDeptIdList(roleIdList.toArray(new Long[roleIdList.size()]));
deptIdList.addAll(userDeptIdList);
}
//用户子部门ID列表
if(dataFilter.subDept()){
List<Long> subDeptIdList = sysDeptService.getSubDeptIdList(userId);
deptIdList.addAll(subDeptIdList);
}
StringBuilder sqlFilter = new StringBuilder();
sqlFilter.append(" (");
if(deptIdList.size() > 0){
sqlFilter.append(tableAlias).append(dataFilter.deptId()).append(" in(").append(StringUtils.join(deptIdList, ",")).append(")");
}
//没有本部门数据权限,也能查询本人数据
if(dataFilter.user()){
if(deptIdList.size() > 0){
sqlFilter.append(" or ");
}
sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(userId);
}
sqlFilter.append(")");
if(sqlFilter.toString().trim().equals("()")){
return null;
}
return sqlFilter.toString();
}
}
package com.mx.cneeds.server.user.config;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
@Bean
public ISqlInjector sqlInjector() {
return new LogicSqlInjector();
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.SysDeptEntity;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +17,12 @@ import java.util.Map;
public interface SysDeptService extends IService<SysDeptEntity> {
PageUtils queryPage(Map<String, Object> params);
/**
* 获取子部门ID,用于数据过滤
*/
List<Long> getSubDeptIdList(Long deptId);
List<Long> queryDetpIdList(Long parentId);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +17,10 @@ import java.util.Map;
public interface SysRoleDeptService extends IService<SysRoleDeptEntity> {
PageUtils queryPage(Map<String, Object> params);
/**
* 根据角色ID,获取部门ID列表
*/
List<Long> queryDeptIdList(Long[] roleIds) ;
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.server.entity.SysUserRoleEntity;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +17,11 @@ import java.util.Map;
public interface SysUserRoleService extends IService<SysUserRoleEntity> {
PageUtils queryPage(Map<String, Object> params);
/**
* 根据用户ID,获取角色ID列表
* @param userId
*/
List<Long> queryRoleIdList(Long userId);
}
......@@ -6,6 +6,9 @@ import com.mx.cneeds.server.dao.SysDeptDao;
import com.mx.cneeds.server.entity.SysDeptEntity;
import com.mx.cneeds.server.user.service.SysDeptService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -26,4 +29,35 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptDao, SysDeptEntity> i
return new PageUtils(page);
}
@Override
public List<Long> getSubDeptIdList(Long deptId){
//部门及子部门ID列表
List<Long> deptIdList = new ArrayList<>();
//获取子部门ID
List<Long> subIdList = queryDetpIdList(deptId);
getDeptTreeList(subIdList, deptIdList);
return deptIdList;
}
@Override
public List<Long> queryDetpIdList(Long parentId) {
return baseMapper.queryDetpIdList(parentId);
}
/**
* 递归
*/
private void getDeptTreeList(List<Long> subIdList, List<Long> deptIdList){
for(Long deptId : subIdList){
List<Long> list = queryDetpIdList(deptId);
if(list.size() > 0){
getDeptTreeList(list, deptIdList);
}
deptIdList.add(deptId);
}
}
}
......@@ -6,6 +6,8 @@ import com.mx.cneeds.server.dao.SysRoleDeptDao;
import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import com.mx.cneeds.server.user.service.SysRoleDeptService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -25,4 +27,9 @@ public class SysRoleDeptServiceImpl extends ServiceImpl<SysRoleDeptDao, SysRoleD
return new PageUtils(page);
}
@Override
public List<Long> queryDeptIdList(Long[] roleIds) {
return baseMapper.queryDeptIdList(roleIds);
}
}
......@@ -6,6 +6,8 @@ import com.mx.cneeds.server.dao.SysUserRoleDao;
import com.mx.cneeds.server.entity.SysUserRoleEntity;
import com.mx.cneeds.server.user.service.SysUserRoleService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -25,4 +27,10 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserR
return new PageUtils(page);
}
@Override
public List<Long> queryRoleIdList(Long userId) {
return baseMapper.queryRoleIdList(userId);
}
}
......@@ -32,10 +32,9 @@ public class SysFuncController {
*/
@RequestMapping("/list")
// @RequiresPermissions("sys:sysfunc:list")
public R list(@RequestParam Map<String, Object> params){
public PageUtils list(@RequestParam Map<String, Object> params){
PageUtils page = sysFuncService.queryPage(params);
return R.ok().put("page", page);
return page;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment