├── .gitattributes ├── LICENSE ├── README.md ├── RookieMeeting ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── rookie │ │ │ └── rookiemeeting │ │ │ ├── RookieMeetingApplication.java │ │ │ ├── common │ │ │ ├── execption │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ServiceException.java │ │ │ └── lang │ │ │ │ ├── Constants.java │ │ │ │ └── Result.java │ │ │ ├── config │ │ │ ├── AuthAccess.java │ │ │ ├── BaiduConfig.java │ │ │ ├── CorsConfig.java │ │ │ ├── DruidConfig.java │ │ │ ├── InterceptionConfig.java │ │ │ ├── MyApplicationRunner.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── MybatisRedisCache.java │ │ │ ├── RedisConfig.java │ │ │ └── SwaggerConfig.java │ │ │ ├── controller │ │ │ ├── ApproveAccountController.java │ │ │ ├── ChangeBookingController.java │ │ │ ├── DepartmentController.java │ │ │ ├── DictController.java │ │ │ ├── EChartsController.java │ │ │ ├── EmployeeController.java │ │ │ ├── MeetingController.java │ │ │ ├── MeetingParticipantsController.java │ │ │ ├── MeetingRoomController.java │ │ │ ├── MenuController.java │ │ │ ├── NotificationsController.java │ │ │ ├── PhotoController.java │ │ │ ├── RoleController.java │ │ │ └── RoleMenuController.java │ │ │ ├── dto │ │ │ ├── EmployeeDto.java │ │ │ ├── LoginDto.java │ │ │ ├── MeetingDto.java │ │ │ ├── ParticipantsDto.java │ │ │ ├── RoomDto.java │ │ │ ├── SevenDayMeeting.java │ │ │ └── UpdatePassDTO.java │ │ │ ├── interceptor │ │ │ └── JwtInterceptor.java │ │ │ ├── mapper │ │ │ ├── DepartmentMapper.java │ │ │ ├── DictMapper.java │ │ │ ├── EmployeeMapper.java │ │ │ ├── MeetingMapper.java │ │ │ ├── MeetingParticipantsMapper.java │ │ │ ├── MeetingRoomMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── RoleMapper.java │ │ │ └── RoleMenuMapper.java │ │ │ ├── service │ │ │ ├── IDepartmentService.java │ │ │ ├── IDictService.java │ │ │ ├── IEmployeeService.java │ │ │ ├── IMeetingParticipantsService.java │ │ │ ├── IMeetingRoomService.java │ │ │ ├── IMeetingService.java │ │ │ ├── IMenuService.java │ │ │ ├── IRoleMenuService.java │ │ │ ├── IRoleService.java │ │ │ └── Impl │ │ │ │ ├── DepartmentServiceImpl.java │ │ │ │ ├── DictServiceImpl.java │ │ │ │ ├── EmployeeServiceImpl.java │ │ │ │ ├── MeetingParticipantsServiceImpl.java │ │ │ │ ├── MeetingRoomServiceImpl.java │ │ │ │ ├── MeetingServiceImpl.java │ │ │ │ ├── MenuServiceImpl.java │ │ │ │ ├── RoleMenuServiceImpl.java │ │ │ │ └── RoleServiceImpl.java │ │ │ └── util │ │ │ ├── BASE64.java │ │ │ ├── SpringUtil.java │ │ │ └── TokenUtils.java │ └── resources │ │ ├── application.yaml │ │ ├── banner.txt │ │ └── mapper │ │ ├── DepartmentMapper.xml │ │ ├── DictMapper.xml │ │ ├── EmployeeMapper.xml │ │ ├── MeetingMapper.xml │ │ ├── MeetingParticipantsMapper.xml │ │ ├── MeetingRoomMapper.xml │ │ ├── MenuMapper.xml │ │ ├── RoleMapper.xml │ │ └── RoleMenuMapper.xml │ └── test │ └── java │ └── com │ └── rookie │ └── rookiemeeting │ └── RookieMeetingApplicationTests.java ├── imgs ├── .keep ├── image1.png ├── image2.png ├── image3.png ├── image4.png └── image5.png └── meeting ├── .browserslistrc ├── .gitignore ├── README.md ├── babel.config.js ├── jsconfig.json ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── icon.png └── index.html ├── src ├── App.vue ├── assets │ ├── 404.png │ ├── gloable.css │ ├── logo.png │ └── 错误.png ├── components │ ├── Aside.vue │ ├── Header.vue │ └── Layout.vue ├── main.js ├── store │ └── index.js ├── util │ ├── calendar.js │ └── request.js └── views │ ├── 404 │ └── NotFound.vue │ ├── DataReport │ └── DataReport.vue │ ├── Home.vue │ ├── Meeting booking │ ├── BookScheduled.vue │ ├── MeetingRoom.vue │ └── SearchMeeting.vue │ ├── Personal Center │ ├── Cancel.vue │ ├── Meeting.vue │ ├── Person.vue │ ├── Scheduled.vue │ └── UpdatePwd.vue │ ├── Personnel management │ ├── Approval.vue │ ├── Manage.vue │ └── Search.vue │ ├── login │ ├── FaceLogin.vue │ └── Login.vue │ ├── register │ └── Register.vue │ └── sys │ ├── Dict.vue │ ├── Druid.vue │ ├── Menu.vue │ └── Role.vue └── vue.config.js /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Java 2 | *.css linguist-language=Java 3 | *.html linguist-language=Java 4 | *.vue linguist-language=Java 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

基于springboot + vue + 百度SDK 开发的前后端分离人脸识别会议签到系统

2 |

3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |

34 | 35 | ____ 36 | 37 | 38 | #### 介绍 39 | 40 | 基于springboot + vue + 百度SDK 开发的前后端分离人脸识别会议签到系统,支持会议的基本功能,人脸签到,照片签到,人脸登录,地图坐标签到,后台管理功能等。第十一届中国软件杯B4赛题三等奖。 41 | 42 | 在线网址:http://121.40.41.122/Meeting 43 | 44 | #### 软件架构 45 | 46 | B/S架构,架构图如下 47 | ![输入图片说明](imgs/image1.png) 48 | 49 | 50 | #### 目录结构 51 | 52 | SQL文件位于sql文件夹下的rookismeeting.sql,需要MySQL8以上版本。 53 | 54 | 可直接导入该项目的本地编辑器中,修改后端配置文件中的数据库等连接信息,项目中使用到的百度地图SDK和百度人脸识别SDK等需要自行开通。 55 | 56 | 57 | #### 技术介绍 58 | 59 | 前端技术:Vue2 + Vuex + Vue - Router + Axios + Element - ui + Bootstrap + Echarts + JavaScript 60 | 61 | 后端技术:SpringBoot + Jwt + MyBatisPlus + MySQL+ Redis + Swagger + Druid + 百度SDK 62 | 63 | 64 | #### 开发环境 65 | 66 | | 开发工具 |说明 | 67 | |---|---| 68 | | IDEA | Java开发工具 | 69 | |VSCode | Vue开发工具IDE| 70 | 71 | | 开发环境 |版本 | 72 | |---|---| 73 | |JDK |1.8 | 74 | |MYSQL | 8.0.12 | 75 | |Redis | 5.0.14 | 76 | |Node |14.19.0 77 | 78 | 79 | #### 项目效果 80 | * 首页 81 | ![输入图片说明](imgs/image2.png) 82 | 83 | * 会议统计可视化 84 | ![输入图片说明](imgs/image3.png) 85 | 86 | * 会议签到 87 | ![输入图片说明](imgs/image4.png) 88 | 89 | * 人脸识别登录 90 | ![输入图片说明](imgs/image5.png) 91 | 92 | #### 部署项目 93 | 94 | 1、后端项目使用IDEA打开,一键启动 95 | 96 | 2、前端下载依赖,npm install 97 | 98 | 3、前端启动,npm run serve 99 | 100 | 4、如需要部署上线,可参考系统部署说明书 101 | 102 | #### 注意事项 103 | 104 | 若部署失败或不成功可加作者QQ:2740860037来咨询 105 | -------------------------------------------------------------------------------- /RookieMeeting/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /RookieMeeting/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/RookieMeeting/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /RookieMeeting/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /RookieMeeting/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /RookieMeeting/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.5.6 9 | 10 | 11 | com.rookie 12 | RookieMeeting 13 | 0.0.1-SNAPSHOT 14 | RookieMeeting 15 | Demo project for Spring Boot 16 | 17 | 1.8 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-web 24 | 25 | 26 | 27 | 28 | cn.afterturn 29 | easypoi-spring-boot-starter 30 | 4.4.0 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-cache 36 | 37 | 38 | 39 | 40 | mysql 41 | mysql-connector-java 42 | runtime 43 | 44 | 45 | 46 | 47 | com.baomidou 48 | mybatis-plus-boot-starter 49 | 3.5.1 50 | 51 | 52 | 53 | 54 | com.baomidou 55 | mybatis-plus-generator 56 | 3.5.1 57 | 58 | 59 | 60 | 61 | org.apache.velocity 62 | velocity 63 | 1.7 64 | 65 | 66 | 67 | 68 | com.github.xiaoymin 69 | knife4j-spring-boot-starter 70 | 3.0.2 71 | 72 | 73 | 74 | 75 | com.auth0 76 | java-jwt 77 | 3.18.3 78 | 79 | 80 | 81 | 82 | cn.hutool 83 | hutool-all 84 | 5.7.22 85 | 86 | 87 | 88 | 89 | commons-codec 90 | commons-codec 91 | 92 | 93 | org.apache.commons 94 | commons-lang3 95 | 3.8.1 96 | 97 | 98 | 99 | 100 | com.alibaba 101 | druid 102 | 1.2.8 103 | 104 | 105 | 106 | 107 | log4j 108 | log4j 109 | 1.2.17 110 | 111 | 112 | 113 | 114 | org.springframework.boot 115 | spring-boot-starter-data-redis 116 | 117 | 118 | 119 | 120 | com.alibaba 121 | fastjson 122 | 1.2.76 123 | 124 | 125 | 126 | 127 | org.projectlombok 128 | lombok 129 | true 130 | 131 | 132 | 133 | com.baidu.aip 134 | java-sdk 135 | 4.16.7 136 | 137 | 138 | org.slf4j 139 | slf4j-simple 140 | 141 | 142 | 143 | 144 | 145 | 146 | org.springframework.boot 147 | spring-boot-starter-validation 148 | 149 | 150 | 151 | org.springframework.boot 152 | spring-boot-starter-test 153 | test 154 | 155 | 156 | 157 | 158 | 159 | 160 | org.springframework.boot 161 | spring-boot-maven-plugin 162 | 2.5.6 163 | 164 | 165 | 166 | org.projectlombok 167 | lombok 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/RookieMeetingApplication.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RookieMeetingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RookieMeetingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/execption/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.common.execption; 2 | 3 | import com.rookie.rookiemeeting.common.lang.Result; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.bind.annotation.ExceptionHandler; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | import org.springframework.web.bind.annotation.RestControllerAdvice; 8 | 9 | /** 10 | * 全局异常捕获 11 | */ 12 | @RestControllerAdvice 13 | @Slf4j 14 | public class GlobalExceptionHandler { 15 | 16 | 17 | @ExceptionHandler(ServiceException.class) 18 | @ResponseBody 19 | public Result handle(ServiceException serviceException) { 20 | return Result.fail(serviceException.getCode(), serviceException.getMessage()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/execption/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.common.execption; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class ServiceException extends RuntimeException { 7 | 8 | private final int code; 9 | 10 | public ServiceException(int code, String msg) { 11 | super(msg); 12 | this.code = code; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/lang/Constants.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.common.lang; 2 | 3 | public interface Constants { 4 | 5 | int CODE_401 = 401; //权限不足 6 | 7 | int CODE_500 = 500; //系统错误 8 | 9 | String ROLE = "ROLE_NORMAL"; 10 | 11 | int STATUS = 0; 12 | 13 | String DICT_ICON = "icon"; 14 | 15 | String SALT = "hechao!#$%@"; 16 | } 17 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/lang/Result.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.common.lang; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class Result implements Serializable { 9 | 10 | private int code; //200是正常,非200表示异常 11 | private String msg; 12 | private Object data; 13 | 14 | //成功消息 15 | public static Result succ(Object data) { 16 | return succ(200, "操作成功", data); 17 | } 18 | 19 | //失败消息 20 | public static Result fail(String msg) { 21 | return fail(400, msg, null); 22 | } 23 | 24 | //失败消息 25 | public static Result fail(int code, String msg) { 26 | return fail(code, msg, null); 27 | } 28 | 29 | public static Result fail(String msg, Object data) { 30 | return fail(400, msg, data); 31 | } 32 | 33 | public static Result succ(int code, String msg, Object data) { 34 | Result rs = new Result(); 35 | rs.setCode(code); 36 | rs.setMsg(msg); 37 | rs.setData(data); 38 | return rs; 39 | } 40 | 41 | public static Result fail(int code, String msg, Object data) { 42 | Result rs = new Result(); 43 | rs.setCode(code); 44 | rs.setMsg(msg); 45 | rs.setData(data); 46 | return rs; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/AuthAccess.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.METHOD}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface AuthAccess { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/BaiduConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.baidu.aip.face.AipFace; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class BaiduConfig { 10 | 11 | @Value("${baidu.appId}") 12 | private String appId; 13 | 14 | @Value("${baidu.key}") 15 | private String key; 16 | 17 | @Value("${baidu.secret}") 18 | private String secret; 19 | 20 | @Bean 21 | public AipFace aipFace() { 22 | return new AipFace(appId, key, secret); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | 9 | @Configuration 10 | public class CorsConfig { 11 | 12 | // 当前跨域请求最大有效时长,默认1天 13 | private static final long MAX_AGE = 24 * 60 * 60; 14 | 15 | @Bean 16 | public CorsFilter corsFilter() { 17 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 18 | CorsConfiguration corsConfiguration = new CorsConfiguration(); 19 | corsConfiguration.addAllowedOrigin("*"); // 1 设置访问源地址 20 | corsConfiguration.addAllowedHeader("*"); // 2 设置访问源请求头 21 | corsConfiguration.addAllowedMethod("*"); // 3 设置访问源请求方法 22 | corsConfiguration.setMaxAge(MAX_AGE); 23 | source.registerCorsConfiguration("/**", corsConfiguration); // 4 对接口配置跨域设置 24 | return new CorsFilter(source); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/DruidConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.alibaba.druid.pool.DruidDataSource; 4 | import com.alibaba.druid.support.http.StatViewServlet; 5 | import com.alibaba.druid.support.http.WebStatFilter; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 8 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | 12 | import javax.sql.DataSource; 13 | import java.util.Arrays; 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | /** 18 | * druid配置 19 | * http://localhost:8888/druid/login.html 访问 20 | */ 21 | @Configuration 22 | public class DruidConfig { 23 | 24 | @ConfigurationProperties(prefix = "spring.datasource") 25 | @Bean 26 | public DataSource druidDataSource() { 27 | return new DruidDataSource(); 28 | } 29 | 30 | @Bean 31 | public ServletRegistrationBean statViewServlet() { 32 | ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); 33 | 34 | Map initParams = new HashMap<>(); 35 | //后台管理界面的登录账号、密码 36 | initParams.put("loginUsername", "admin"); 37 | initParams.put("loginPassword", "123456"); 38 | 39 | //后台访问、本机访问 40 | initParams.put("allow", "localhost"); 41 | 42 | bean.setInitParameters(initParams); 43 | 44 | return bean; 45 | } 46 | 47 | @Bean 48 | public FilterRegistrationBean webStatFilter() { 49 | FilterRegistrationBean bean = new FilterRegistrationBean(); 50 | bean.setFilter(new WebStatFilter()); 51 | 52 | Map initParams = new HashMap<>(); 53 | initParams.put("exclusions", "*.js,*.css,/druid/*,/jdbc/*"); 54 | bean.setInitParameters(initParams); 55 | 56 | bean.setUrlPatterns(Arrays.asList("/*")); 57 | return bean; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/InterceptionConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.rookie.rookiemeeting.interceptor.JwtInterceptor; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | @Configuration 10 | public class InterceptionConfig implements WebMvcConfigurer { 11 | 12 | @Override 13 | public void addInterceptors(InterceptorRegistry registry) { 14 | 15 | registry.addInterceptor(jwtInterceptor()) 16 | .addPathPatterns("/**") // 拦截所有请求,通过判断token是否合法来决定是否需要登录 17 | .excludePathPatterns("/employee/login", "/employee/register", "/department/all", "/faceLogin", "/download", "/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/api", "/api-docs", "/api-docs/**") 18 | .excludePathPatterns("/**/*.html", "/**/*.js", "/**/*.css", "/**/*.woff", "/**/*.ttf"); // 放行静态文件 19 | } 20 | 21 | 22 | @Bean 23 | public JwtInterceptor jwtInterceptor() { 24 | return new JwtInterceptor(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MyApplicationRunner.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.boot.ApplicationArguments; 6 | import org.springframework.boot.ApplicationRunner; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.data.redis.core.RedisTemplate; 9 | 10 | import java.util.Set; 11 | 12 | /** 13 | * 启动清理缓存 14 | */ 15 | @Configuration 16 | @Slf4j 17 | public class MyApplicationRunner implements ApplicationRunner { 18 | 19 | @Autowired 20 | RedisTemplate redisTemplate; 21 | 22 | @Autowired 23 | MybatisRedisCache mybatisRedisCache; 24 | 25 | @Override 26 | public void run(ApplicationArguments args) throws Exception { 27 | Set keys = redisTemplate.keys("*"); 28 | mybatisRedisCache.removeObject(keys); 29 | redisTemplate.delete(keys); 30 | log.info("清理redis缓存"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 5 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.transaction.annotation.EnableTransactionManagement; 9 | 10 | @Configuration 11 | @EnableTransactionManagement 12 | public class MybatisPlusConfig { 13 | 14 | @Bean 15 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 16 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 17 | //分页 18 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); 19 | return interceptor; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MybatisRedisCache.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; 4 | import com.rookie.rookiemeeting.util.SpringUtil; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.apache.ibatis.cache.Cache; 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.data.redis.connection.RedisServerCommands; 12 | import org.springframework.data.redis.core.RedisTemplate; 13 | 14 | import java.util.Set; 15 | import java.util.concurrent.locks.ReadWriteLock; 16 | import java.util.concurrent.locks.ReentrantReadWriteLock; 17 | 18 | @Configuration 19 | @Slf4j 20 | @Data 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | public class MybatisRedisCache implements Cache { 24 | // 读写锁 25 | private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(true); 26 | 27 | //这里使用了redis缓存,使用springboot自动注入 28 | private RedisTemplate redisTemplate; 29 | 30 | private String id; 31 | 32 | public MybatisRedisCache(final String id) { 33 | if (id == null) { 34 | throw new IllegalArgumentException("Cache instances require an ID"); 35 | } 36 | this.id = id; 37 | } 38 | 39 | @Override 40 | public String getId() { 41 | return this.id; 42 | } 43 | 44 | @Override 45 | public void putObject(Object key, Object value) { 46 | if (redisTemplate == null) { 47 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除 48 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate"); 49 | } 50 | if (value != null) { 51 | redisTemplate.opsForValue().set(key.toString(), value); 52 | } 53 | } 54 | 55 | @Override 56 | public Object getObject(Object key) { 57 | if (redisTemplate == null) { 58 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除 59 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate"); 60 | } 61 | try { 62 | if (key != null) { 63 | return redisTemplate.opsForValue().get(key.toString()); 64 | } 65 | } catch (Exception e) { 66 | e.printStackTrace(); 67 | log.error("缓存出错 "); 68 | } 69 | return null; 70 | } 71 | 72 | @Override 73 | public Object removeObject(Object key) { 74 | if (redisTemplate == null) { 75 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除 76 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate"); 77 | } 78 | if (key != null) { 79 | redisTemplate.delete(key.toString()); 80 | } 81 | return null; 82 | } 83 | 84 | @Override 85 | public void clear() { 86 | log.debug("清空缓存"); 87 | if (redisTemplate == null) { 88 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate"); 89 | } 90 | Set keys = redisTemplate.keys("*:" + this.id + "*"); 91 | if (!CollectionUtils.isEmpty(keys)) { 92 | redisTemplate.delete(keys); 93 | } 94 | } 95 | 96 | @Override 97 | public int getSize() { 98 | if (redisTemplate == null) { 99 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除 100 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate"); 101 | } 102 | Long size = redisTemplate.execute(RedisServerCommands::dbSize); 103 | return size.intValue(); 104 | } 105 | 106 | @Override 107 | public ReadWriteLock getReadWriteLock() { 108 | return this.readWriteLock; 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.PropertyAccessor; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.data.redis.connection.RedisConnectionFactory; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 11 | import org.springframework.data.redis.serializer.StringRedisSerializer; 12 | 13 | /** 14 | * redis 配置类 15 | */ 16 | @Configuration 17 | public class RedisConfig { 18 | 19 | @Bean 20 | @SuppressWarnings("all") //镇压所有警告 21 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { 22 | 23 | RedisTemplate template = new RedisTemplate<>(); 24 | template.setConnectionFactory(redisConnectionFactory); 25 | 26 | //Json序列化配置 27 | Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class); 28 | ObjectMapper objectMapper = new ObjectMapper(); 29 | objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 30 | objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 31 | serializer.setObjectMapper(objectMapper); 32 | 33 | //String类型的序列化 34 | StringRedisSerializer stringRedisSerializer = new StringRedisSerializer(); 35 | 36 | //key采用String的序列化方式 37 | template.setKeySerializer(stringRedisSerializer); 38 | 39 | //hash的key也采用String序列化方式 40 | template.setHashKeySerializer(stringRedisSerializer); 41 | 42 | //value序列化采用jackJson 43 | template.setValueSerializer(serializer); 44 | 45 | //hash的key序列化方式也采用jackJson 46 | template.setHashValueSerializer(serializer); 47 | 48 | template.afterPropertiesSet(); 49 | 50 | 51 | return template; 52 | } 53 | } -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.config; 2 | 3 | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import springfox.documentation.builders.ApiInfoBuilder; 7 | import springfox.documentation.builders.PathSelectors; 8 | import springfox.documentation.builders.RequestHandlerSelectors; 9 | import springfox.documentation.service.ApiInfo; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | @EnableKnife4j 17 | public class SwaggerConfig { 18 | 19 | /** 20 | * swagger配置 21 | * 22 | * @return 23 | */ 24 | @Bean 25 | public Docket docket() { 26 | return new Docket(DocumentationType.SWAGGER_2) 27 | .apiInfo(apiInfo()) 28 | .select() 29 | .apis(RequestHandlerSelectors.basePackage("com.rookie.rookiemeeting.controller")) 30 | .paths(PathSelectors.any()) 31 | .build(); 32 | } 33 | 34 | private ApiInfo apiInfo() { 35 | return new ApiInfoBuilder() 36 | .title("基于深度学习的人脸识别会议签到系统") 37 | .version("v1.0") 38 | .description("基于深度学习的人脸识别会议签到系统接口文档") 39 | .build(); 40 | } 41 | } -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/ApproveAccountController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.rookie.rookiemeeting.common.lang.Result; 4 | import com.rookie.rookiemeeting.service.IEmployeeService; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | @RequestMapping("/approve") 15 | @Api(tags = "管理员审批控制类") 16 | public class ApproveAccountController { 17 | 18 | //待批准状态码为0 19 | public static final Integer PENDING_APPROVE = 0; 20 | @Autowired 21 | IEmployeeService employeeService; 22 | 23 | /** 24 | * 查询所有未审批的用户 25 | * 26 | * @return 27 | */ 28 | @ApiOperation("查询所有未审批的用户接口") 29 | @PostMapping("getStatus") 30 | public Result getStatus() { 31 | return Result.succ(employeeService.getByStatus(PENDING_APPROVE)); 32 | } 33 | 34 | /** 35 | * 根据ID通过注册审批 36 | * 37 | * @param employeeid 38 | * @return 39 | */ 40 | @ApiOperation("根据ID通过注册审批接口") 41 | @PostMapping("/updateStatusAdopt/{employeeid}") 42 | public Result updateStatusAdopt(@PathVariable(name = "employeeid") Long employeeid) { 43 | return Result.succ(employeeService.updateStatusAdopt(employeeid)); 44 | } 45 | 46 | /** 47 | * 根据ID不通过注册审批 48 | * 49 | * @param employeeid 50 | * @return 51 | */ 52 | @ApiOperation("根据ID不通过注册审批接口") 53 | @PostMapping("/updateStatusFail/{employeeid}") 54 | public Result updateStatusFail(@PathVariable(name = "employeeid") Long employeeid) { 55 | return Result.succ(employeeService.updateStatusFail(employeeid)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/ChangeBookingController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import cn.afterturn.easypoi.entity.vo.NormalExcelConstants; 4 | import cn.afterturn.easypoi.excel.entity.ExportParams; 5 | import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; 6 | import cn.afterturn.easypoi.view.PoiBaseView; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.rookie.rookiemeeting.common.lang.Result; 9 | import com.rookie.rookiemeeting.dto.ParticipantsDto; 10 | import com.rookie.rookiemeeting.service.IEmployeeService; 11 | import com.rookie.rookiemeeting.service.IMeetingParticipantsService; 12 | import com.rookie.rookiemeeting.service.IMeetingService; 13 | import io.swagger.annotations.Api; 14 | import io.swagger.annotations.ApiOperation; 15 | import org.springframework.beans.factory.annotation.Autowired; 16 | import org.springframework.ui.ModelMap; 17 | import org.springframework.web.bind.annotation.*; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import javax.servlet.http.HttpServletResponse; 21 | import java.util.List; 22 | 23 | @RestController 24 | @RequestMapping("/bookings") 25 | @Api(tags = "更改预订控制类") 26 | public class ChangeBookingController { 27 | 28 | @Autowired 29 | IMeetingService meetingService; 30 | 31 | @Autowired 32 | IEmployeeService employeeService; 33 | 34 | @Autowired 35 | IMeetingParticipantsService meetingParticipantsService; 36 | 37 | /** 38 | * 我的预定,并且会议状态为0 39 | * 40 | * @param employeeid 41 | * @return 42 | */ 43 | @ApiOperation("根据已登录的员工ID查询自己的会议并且会议状态为0接口") 44 | @GetMapping("/mybookings/{employeeid}") 45 | public Result mybookings(@PathVariable(name = "employeeid") Long employeeid, 46 | @RequestParam Integer pageNum, 47 | @RequestParam Integer pageSize, 48 | @RequestParam(defaultValue = "") String meetingname) { 49 | return Result.succ(meetingService.getmeetingofmybookCanCancle(new Page<>(pageNum, pageSize), employeeid, meetingname)); 50 | } 51 | 52 | /** 53 | * 取消会议的原因 54 | * 55 | * @param meetingid 56 | * @param canceledreason 57 | * @return 58 | */ 59 | @ApiOperation("取消会议接口") 60 | @PostMapping("/cancelmeeting/{meetingid}") 61 | public Result cancelmeeting(@PathVariable(name = "meetingid") Integer meetingid, @RequestBody String canceledreason) { 62 | meetingService.cancelmeeting(meetingid, canceledreason); 63 | return Result.succ(null); 64 | } 65 | 66 | /** 67 | * 根据ID查询会议详情 68 | * 69 | * @param meetingid 70 | * @return 71 | */ 72 | @ApiOperation("根据ID查询会议详情接口") 73 | @PostMapping("/meetingById/{meetingid}") 74 | public Result meetingById(@PathVariable(name = "meetingid") Integer meetingid) { 75 | return Result.succ(meetingService.getById(meetingid)); 76 | } 77 | 78 | /** 79 | * 根据已登录的员工ID查询自己的会议 80 | * 81 | * @param employeeid 82 | * @param pageNum 83 | * @param pageSize 84 | * @param meetingname 85 | * @return 86 | */ 87 | @ApiOperation("根据已登录的员工ID查询自己的会议接口") 88 | @GetMapping("/myMeeting/{employeeid}") 89 | public Result myMeeting(@PathVariable(name = "employeeid") Long employeeid, 90 | @RequestParam Integer pageNum, 91 | @RequestParam Integer pageSize, 92 | @RequestParam(defaultValue = "") String meetingname) { 93 | return Result.succ(meetingService.getMyMeeting(new Page<>(pageNum, pageSize), employeeid, meetingname)); 94 | } 95 | 96 | /** 97 | * 查询参会人员 98 | * 99 | * @param meetingid 100 | * @return 101 | */ 102 | @ApiOperation("查询参会人员接口") 103 | @PostMapping("/participants/{meetingid}") 104 | public Result participants(@PathVariable(name = "meetingid") Integer meetingid) { 105 | return Result.succ(employeeService.getEmpsById(meetingid)); 106 | } 107 | 108 | /** 109 | * 导出考勤信息 110 | * 111 | * @param map 112 | * @param response 113 | * @param request 114 | * @param meetingid 115 | */ 116 | @GetMapping("/exports/{meetingid}") 117 | public void export(ModelMap map, HttpServletResponse response, HttpServletRequest request, @PathVariable("meetingid") Integer meetingid) { 118 | List emps = employeeService.getEmpsById(meetingid); 119 | ExportParams exportParams = new ExportParams("考勤信息", "考勤信息", ExcelType.XSSF); 120 | map.put(NormalExcelConstants.DATA_LIST, emps); 121 | map.put(NormalExcelConstants.CLASS, ParticipantsDto.class); 122 | map.put(NormalExcelConstants.PARAMS, exportParams); 123 | map.put(NormalExcelConstants.FILE_NAME, "考勤信息表"); 124 | PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW); 125 | 126 | } 127 | 128 | /** 129 | * 日历显示会议功能 130 | * 131 | * @param employeeid 132 | * @return 133 | */ 134 | @ApiOperation("日历显示会议接口") 135 | @GetMapping("/calendar/{employeeid}") 136 | public Result calendar(@PathVariable(name = "employeeid") Long employeeid) { 137 | return Result.succ(meetingService.getCalendar(employeeid)); 138 | } 139 | 140 | /** 141 | * 参加会议总人数 142 | * 143 | * @param meetingid 144 | * @return 145 | */ 146 | @ApiOperation("参加会议总人数接口") 147 | @PostMapping("/queryNum/{meetingid}") 148 | public Result queryNum(@PathVariable(name = "meetingid") Integer meetingid) { 149 | return Result.succ(meetingParticipantsService.queryNum(meetingid)); 150 | } 151 | 152 | /** 153 | * 未签到人数 154 | * 155 | * @param meetingid 156 | * @return 157 | */ 158 | @ApiOperation("未签到人数接口") 159 | @PostMapping("/signed/{meetingid}") 160 | public Result signed(@PathVariable(name = "meetingid") Integer meetingid) { 161 | return Result.succ(meetingParticipantsService.signed(meetingid)); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/DepartmentController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.common.lang.Result; 6 | import com.rookie.rookiemeeting.entity.Department; 7 | import com.rookie.rookiemeeting.service.IDepartmentService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | @RestController 16 | @RequestMapping("/department") 17 | @Api(tags = "部门控制类") 18 | public class DepartmentController { 19 | 20 | @Autowired 21 | IDepartmentService departmentService; 22 | 23 | /** 24 | * 获取全部部门、分页查询 25 | * 26 | * @return 27 | */ 28 | @ApiOperation("分页查询所有部门接口") 29 | @GetMapping("/page") 30 | public Result findPage(@RequestParam Integer pageNum, 31 | @RequestParam Integer pageSize, 32 | @RequestParam(defaultValue = "") String departmentname) { 33 | QueryWrapper queryWrapper = new QueryWrapper<>(); 34 | queryWrapper.like("departmentname", departmentname); 35 | return Result.succ(departmentService.page(new Page<>(pageNum, pageSize), queryWrapper)); 36 | } 37 | 38 | /** 39 | * 新增和编辑部门 40 | * 41 | * @param department 42 | * @return 43 | */ 44 | @ApiOperation("新增和编辑部门接口") 45 | @PostMapping("/save") 46 | public Result save(@RequestBody Department department) { 47 | return Result.succ(departmentService.saveOrUpdate(department)); 48 | } 49 | 50 | /** 51 | * 根据id删除单个部门 52 | * 53 | * @param departmentid 54 | * @return 55 | */ 56 | @ApiOperation("根据ID删除单个部门接口") 57 | @DeleteMapping("/delete/{departmentid}") 58 | public Result delete(@PathVariable(name = "departmentid") Integer departmentid) { 59 | return Result.succ(departmentService.removeById(departmentid)); 60 | } 61 | 62 | /** 63 | * 批量删除多个部门 64 | * 65 | * @param ids 66 | * @return 67 | */ 68 | @ApiOperation("批量删除多个部门接口") 69 | @PostMapping("/delete/batch") 70 | public Result batch(@RequestBody List ids) { 71 | return Result.succ(departmentService.removeBatchByIds(ids)); 72 | } 73 | 74 | /** 75 | * 查询所有部门 76 | * 77 | * @return 78 | */ 79 | @ApiOperation("查询所有部门接口") 80 | @GetMapping("/all") 81 | public Result all() { 82 | return Result.succ(departmentService.list()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/DictController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.common.lang.Constants; 6 | import com.rookie.rookiemeeting.common.lang.Result; 7 | import com.rookie.rookiemeeting.entity.Dict; 8 | import com.rookie.rookiemeeting.service.IDictService; 9 | import io.swagger.annotations.Api; 10 | import io.swagger.annotations.ApiOperation; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import java.util.List; 15 | 16 | 17 | /** 18 | *

19 | * 前端控制器 20 | *

21 | * 22 | * @author 何超 23 | * @since 2022-08-23 24 | */ 25 | @RestController 26 | @RequestMapping("/dict") 27 | @Api(tags = "图标模块") 28 | public class DictController { 29 | 30 | @Autowired 31 | private IDictService dictService; 32 | 33 | //新增或修改 34 | @ApiOperation("新增或修改接口") 35 | @PostMapping("/save") 36 | public Result save(@RequestBody Dict dict) { 37 | return Result.succ(dictService.saveOrUpdate(dict)); 38 | } 39 | 40 | //根据ID删除 41 | @ApiOperation("根据ID删除接口") 42 | @DeleteMapping("/delete/{id}") 43 | public Result delete(@PathVariable Integer id) { 44 | 45 | return Result.succ(dictService.removeById(id)); 46 | } 47 | 48 | @ApiOperation("根据ID批量删除接口") 49 | @PostMapping("/delete/batch") 50 | public Result deleteBatch(@RequestBody List ids) { 51 | 52 | return Result.succ(dictService.removeByIds(ids)); 53 | } 54 | 55 | //查询全部 56 | @ApiOperation("根据类型查询图标接口") 57 | @GetMapping("/getAll") 58 | public Result findAll() { 59 | QueryWrapper queryWrapper = new QueryWrapper<>(); 60 | queryWrapper.eq("type", Constants.DICT_ICON); 61 | List list = dictService.list(queryWrapper); 62 | return Result.succ(list); 63 | } 64 | 65 | //根据ID查询 66 | @ApiOperation("根据ID查询接口") 67 | @GetMapping("/dict/{id}") 68 | public Result findOne(@PathVariable Integer id) { 69 | return Result.succ(dictService.getById(id)); 70 | } 71 | 72 | @ApiOperation("分页查询全部接口") 73 | @GetMapping("/page") 74 | public Result findPage(@RequestParam Integer pageNum, 75 | @RequestParam Integer pageSize, 76 | @RequestParam String name) { 77 | QueryWrapper dictQueryWrapper = new QueryWrapper<>(); 78 | dictQueryWrapper.like("name", name); 79 | return Result.succ(dictService.page(new Page<>(pageNum, pageSize), dictQueryWrapper)); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/EChartsController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import cn.hutool.core.collection.CollUtil; 4 | import cn.hutool.core.date.DateUtil; 5 | import cn.hutool.core.date.Quarter; 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 7 | import com.rookie.rookiemeeting.common.lang.Result; 8 | import com.rookie.rookiemeeting.entity.Employee; 9 | import com.rookie.rookiemeeting.entity.Meeting; 10 | import com.rookie.rookiemeeting.service.IEmployeeService; 11 | import com.rookie.rookiemeeting.service.IMeetingService; 12 | import io.swagger.annotations.Api; 13 | import io.swagger.annotations.ApiOperation; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.RequestMapping; 17 | import org.springframework.web.bind.annotation.RestController; 18 | 19 | import java.util.Date; 20 | import java.util.List; 21 | 22 | @RestController 23 | @RequestMapping("/ECharts") 24 | @Api(tags = "数据报表模块") 25 | public class EChartsController { 26 | 27 | @Autowired 28 | IMeetingService meetingService; 29 | 30 | @Autowired 31 | IEmployeeService employeeService; 32 | 33 | @ApiOperation("数据展示接口") 34 | @GetMapping("/members") 35 | public Result members() { 36 | List list = meetingService.list(); 37 | int q1 = 0; //第一季度 38 | int q2 = 0; //第二季度 39 | int q3 = 0; //第三季度 40 | int q4 = 0; //第四季度 41 | for (Meeting meeting : list) { 42 | Date reservationtime = meeting.getReservationtime(); 43 | Quarter quarter = DateUtil.quarterEnum(reservationtime); 44 | switch (quarter) { 45 | case Q1: 46 | q1 += 1; 47 | break; 48 | case Q2: 49 | q2 += 1; 50 | break; 51 | case Q3: 52 | q3 += 1; 53 | break; 54 | case Q4: 55 | q4 += 1; 56 | break; 57 | default: 58 | break; 59 | } 60 | } 61 | return Result.succ(CollUtil.newArrayList(q1, q2, q3, q4)); 62 | } 63 | 64 | /** 65 | * 正常账号总数 66 | * 67 | * @return 68 | */ 69 | @GetMapping("/normal") 70 | public Result normal() { 71 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 72 | queryWrapper.eq(Employee::getStatus, 1); 73 | return Result.succ(employeeService.count(queryWrapper)); 74 | } 75 | 76 | /** 77 | * 未审批总数 78 | * 79 | * @return 80 | */ 81 | @GetMapping("/notApproved") 82 | public Result notApproved() { 83 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 84 | queryWrapper.eq(Employee::getStatus, 0); 85 | return Result.succ(employeeService.count(queryWrapper)); 86 | } 87 | 88 | /** 89 | * 审批未通过总数 90 | * 91 | * @return 92 | */ 93 | @GetMapping("/approvalFailed") 94 | public Result approvalFailed() { 95 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 96 | queryWrapper.eq(Employee::getStatus, 2); 97 | return Result.succ(employeeService.count(queryWrapper)); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.rookie.rookiemeeting.common.lang.Result; 5 | import com.rookie.rookiemeeting.dto.MeetingDto; 6 | import com.rookie.rookiemeeting.entity.Meeting; 7 | import com.rookie.rookiemeeting.service.IMeetingService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | @RestController 14 | @RequestMapping("/meeting") 15 | @Api(tags = "会议控制类") 16 | public class MeetingController { 17 | 18 | @Autowired 19 | IMeetingService meetingService; 20 | 21 | 22 | /** 23 | * 分页和查询全部 24 | * 25 | * @param meetingDto 26 | * @param pageNum 27 | * @param pageSize 28 | * @return 29 | */ 30 | @ApiOperation("分页和查询全部接口") 31 | @GetMapping("/page") 32 | public Result page(MeetingDto meetingDto, 33 | @RequestParam Integer pageNum, 34 | @RequestParam Integer pageSize) { 35 | 36 | 37 | return Result.succ(meetingService.findMeeting(new Page<>(pageNum, pageSize), meetingDto)); 38 | 39 | } 40 | 41 | /** 42 | * 根据ID删除会议 43 | * 44 | * @param meetingid 45 | * @return 46 | */ 47 | @ApiOperation("根据会议ID删除会议接口") 48 | @DeleteMapping("/delete/{meetingid}") 49 | public Result delete(@PathVariable(name = "meetingid") Integer meetingid) { 50 | meetingService.delById(meetingid); 51 | return Result.succ(null); 52 | } 53 | 54 | /** 55 | * 根据ID查询会议详情 56 | * 57 | * @param meetingid 58 | * @return 59 | */ 60 | @ApiOperation("根据会议ID查询会议详情") 61 | @PostMapping("/meetingById/{meetingid}") 62 | public Result meetingById(@PathVariable(name = "meetingid") Integer meetingid) { 63 | return Result.succ(meetingService.meetingById(meetingid)); 64 | } 65 | 66 | 67 | /** 68 | * 修改会议信息 69 | * 70 | * @param meeting 71 | * @return 72 | */ 73 | @ApiOperation("修改会议信息接口") 74 | @PostMapping("/save") 75 | public Result save(@RequestBody Meeting meeting) { 76 | meetingService.saveOrUpdate(meeting); 77 | return Result.succ(null); 78 | } 79 | 80 | /** 81 | * 预定会议 82 | * 83 | * @param meeting 84 | * @param employeeid 85 | * @return 86 | */ 87 | @ApiOperation("预定会议接口") 88 | @PostMapping("/addMeeting/{employeeid}") 89 | public Result addMeeting(@RequestBody Meeting meeting, 90 | @PathVariable(name = "employeeid") Long employeeid) { 91 | return Result.succ(meetingService.addMeeting(meeting, employeeid)); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingParticipantsController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.rookie.rookiemeeting.common.lang.Result; 4 | import com.rookie.rookiemeeting.entity.MeetingParticipants; 5 | import com.rookie.rookiemeeting.service.IMeetingParticipantsService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.List; 12 | 13 | @RestController 14 | @RequestMapping("/addMeeting") 15 | @Api(tags = "会议参与者控制类") 16 | public class MeetingParticipantsController { 17 | 18 | 19 | @Autowired 20 | IMeetingParticipantsService meetingParticipantsService; 21 | 22 | /** 23 | * 选择参会员工 24 | * 25 | * @param meetingid 26 | * @param emplyeeid 27 | * @return 28 | */ 29 | @ApiOperation("添加参会员工接口") 30 | @PostMapping("/addEmployee/{meetingid}") 31 | public Result addEmployee(@PathVariable(name = "meetingid") Integer meetingid, 32 | @RequestBody List emplyeeid) { 33 | meetingParticipantsService.addParticipants(meetingid, emplyeeid); 34 | return Result.succ(null); 35 | } 36 | 37 | /** 38 | * 根据会议ID,员工ID删除该员工的会议 39 | * 40 | * @param meetingid 41 | * @param employeeid 42 | * @return 43 | */ 44 | @ApiOperation("根据会议ID,员工ID删除该员工的会议接口") 45 | @GetMapping("/delEmployee/{meetingid}/{employeeid}") 46 | public Result delEmployee(@PathVariable(name = "meetingid") Integer meetingid, 47 | @PathVariable(name = "employeeid") Long employeeid) { 48 | meetingParticipantsService.delEmployee(meetingid, employeeid); 49 | return Result.succ(null); 50 | } 51 | 52 | /** 53 | * 补签 54 | * 55 | * @param meetingParticipants 56 | * @return 57 | */ 58 | @ApiOperation("补签接口") 59 | @PostMapping("/signature") 60 | public Result signature(@RequestBody MeetingParticipants meetingParticipants) { 61 | meetingParticipantsService.signature(meetingParticipants); 62 | return Result.succ(null); 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingRoomController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.rookie.rookiemeeting.common.lang.Result; 4 | import com.rookie.rookiemeeting.entity.MeetingRoom; 5 | import com.rookie.rookiemeeting.service.IMeetingRoomService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.List; 12 | 13 | @RestController 14 | @RequestMapping("/meetingroom") 15 | @Api(tags = "会议室控制类") 16 | public class MeetingRoomController { 17 | 18 | @Autowired 19 | IMeetingRoomService meetingRoomService; 20 | 21 | /** 22 | * 分页查询全部会议室 23 | * 24 | * @param pageNum 25 | * @param pageSize 26 | * @param roomname 27 | * @param roomnum 28 | * @return 29 | */ 30 | @ApiOperation("分页查询全部会议室接口") 31 | @GetMapping("/page") 32 | public Result page(@RequestParam Integer pageNum, 33 | @RequestParam Integer pageSize, 34 | @RequestParam(defaultValue = "") String roomname, 35 | @RequestParam(defaultValue = "") String roomnum) { 36 | 37 | return Result.succ(meetingRoomService.mrPage(pageNum, pageSize, roomname, roomnum)); 38 | } 39 | 40 | /** 41 | * 新增和编辑 42 | * 43 | * @param meetingRoom 44 | * @return 45 | */ 46 | @ApiOperation("新增和编辑接口") 47 | @PostMapping("/save") 48 | public Result save(@RequestBody MeetingRoom meetingRoom) { 49 | return Result.succ(meetingRoomService.saveOrUpdate(meetingRoom)); 50 | } 51 | 52 | /** 53 | * 根据id删除单个会议室 54 | * 55 | * @param roomid 56 | * @return 57 | */ 58 | @ApiOperation("根据会议室ID删除单个会议室接口") 59 | @DeleteMapping("/delete/{roomid}") 60 | public Result delete(@PathVariable(name = "roomid") Integer roomid) { 61 | return Result.succ(meetingRoomService.removeById(roomid)); 62 | } 63 | 64 | /** 65 | * 批量删除 66 | * 67 | * @param ids 68 | * @return 69 | */ 70 | @ApiOperation("批量删除会议室接口") 71 | @PostMapping("/delete/batch") 72 | public Result batch(@RequestBody List ids) { 73 | return Result.succ(meetingRoomService.removeBatchByIds(ids)); 74 | } 75 | 76 | /** 77 | * 查询可用的会议室 78 | * 79 | * @return 80 | */ 81 | @ApiOperation("查询可用的会议室接口") 82 | @PostMapping("/list") 83 | public Result list() { 84 | return Result.succ(meetingRoomService.queryAll()); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MenuController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.common.lang.Result; 6 | import com.rookie.rookiemeeting.entity.Menu; 7 | import com.rookie.rookiemeeting.service.IMenuService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | *

18 | * 前端控制器 19 | *

20 | * 21 | * @author 何超 22 | * @since 2022-08-22 23 | */ 24 | @RestController 25 | @RequestMapping("/menu") 26 | @Api(tags = "菜单模块") 27 | public class MenuController { 28 | 29 | @Autowired 30 | private IMenuService menuService; 31 | 32 | //新增或修改 33 | @ApiOperation("新增或修改接口") 34 | @PostMapping("/save") 35 | public Result save(@RequestBody Menu menu) { 36 | menuService.saveOrUpdate(menu); 37 | return Result.succ(null); 38 | } 39 | 40 | //根据ID删除 41 | @ApiOperation("根据ID删除接口") 42 | @DeleteMapping("/delete/{id}") 43 | public Result delete(@PathVariable Integer id) { 44 | menuService.removeById(id); 45 | return Result.succ(null); 46 | } 47 | 48 | @ApiOperation("根据ID批量删除接口") 49 | @PostMapping("/delete/batch") 50 | public Result deleteBatch(@RequestBody List ids) { 51 | menuService.removeByIds(ids); 52 | return Result.succ(null); 53 | } 54 | 55 | @GetMapping("/ids") 56 | public Result findAllIds() { 57 | return Result.succ(menuService.list().stream().map(Menu::getId)); 58 | } 59 | 60 | //查询全部 61 | @GetMapping 62 | @ApiOperation("查询全部接口") 63 | public Result findAll(@RequestParam(defaultValue = "") String name) { 64 | return Result.succ(menuService.findMenus(name)); 65 | } 66 | 67 | //根据ID查询 68 | @ApiOperation("根据ID查询接口") 69 | @GetMapping("/{id}") 70 | public Result findOne(@PathVariable Integer id) { 71 | return Result.succ(menuService.getById(id)); 72 | } 73 | 74 | @ApiOperation("分页查询接口") 75 | @GetMapping("/page") 76 | public Result findPage(@RequestParam String name, 77 | @RequestParam Integer pageNum, 78 | @RequestParam Integer pageSize) { 79 | QueryWrapper queryWrapper = new QueryWrapper<>(); 80 | queryWrapper.like("name", name); 81 | queryWrapper.orderByDesc("id"); 82 | return Result.succ(menuService.page(new Page<>(pageNum, pageSize), queryWrapper)); 83 | } 84 | } 85 | 86 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/NotificationsController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.rookie.rookiemeeting.common.lang.Result; 5 | import com.rookie.rookiemeeting.service.IMeetingService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @RestController 12 | @RequestMapping("/notifications") 13 | @Api(tags = "通知控制类") 14 | public class NotificationsController { 15 | 16 | @Autowired 17 | IMeetingService meetingService; 18 | 19 | /** 20 | * 未来14天要参加的会议 21 | * 22 | * @param employeeid 23 | * @return 24 | */ 25 | @ApiOperation("未来14天要参加的会议接口") 26 | @GetMapping("/sevenDayMeeting/{employeeid}") 27 | public Result sevenDayMeeting(@PathVariable(name = "employeeid") Long employeeid, 28 | @RequestParam Integer pageNum, 29 | @RequestParam Integer pageSize, 30 | @RequestParam(defaultValue = "") String meetingname) { 31 | return Result.succ(meetingService.getSevenDayMeeting(new Page<>(pageNum, pageSize), employeeid, meetingname)); 32 | } 33 | 34 | /** 35 | * 取消的会议 36 | * 37 | * @param emplyeeid 38 | * @return 39 | */ 40 | @ApiOperation("取消的会议的接口") 41 | @GetMapping("/cancelMeeting/{employeeid}") 42 | public Result cancelMeeting(@PathVariable(name = "employeeid") Integer emplyeeid, 43 | @RequestParam Integer pageNum, 44 | @RequestParam Integer pageSize, 45 | @RequestParam(defaultValue = "") String meetingname) { 46 | return Result.succ(meetingService.getCancelMeeting(new Page<>(pageNum, pageSize), emplyeeid, meetingname)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/RoleController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.common.lang.Result; 6 | import com.rookie.rookiemeeting.entity.Role; 7 | import com.rookie.rookiemeeting.service.IRoleService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | *

18 | * 前端控制器 19 | *

20 | * 21 | * @author 何超 22 | * @since 2022-08-22 23 | */ 24 | @RestController 25 | @RequestMapping("/role") 26 | @Api(tags = "角色模块") 27 | public class RoleController { 28 | 29 | @Autowired 30 | private IRoleService roleService; 31 | 32 | //新增或修改 33 | @ApiOperation("新增或修改接口") 34 | @PostMapping 35 | public Result save(@RequestBody Role role) { 36 | roleService.saveOrUpdate(role); 37 | return Result.succ(null); 38 | } 39 | 40 | //根据ID删除 41 | @ApiOperation("根据ID删除") 42 | @DeleteMapping("/delete/{id}") 43 | public Result delete(@PathVariable Integer id) { 44 | roleService.removeById(id); 45 | return Result.succ(null); 46 | } 47 | 48 | @ApiOperation("根据ID批量删除") 49 | @PostMapping("/delete/batch") 50 | public Result deleteBatch(@RequestBody List ids) { 51 | roleService.removeByIds(ids); 52 | return Result.succ(null); 53 | } 54 | 55 | //查询全部 56 | @ApiOperation("查询全部接口") 57 | @GetMapping 58 | public Result findAll() { 59 | return Result.succ(roleService.list()); 60 | } 61 | 62 | //根据ID查询 63 | @ApiOperation("根据ID查询接口") 64 | @GetMapping("/{id}") 65 | public Result findOne(@PathVariable Integer id) { 66 | return Result.succ(roleService.getById(id)); 67 | } 68 | 69 | @ApiOperation("分页查询全部数据接口") 70 | @GetMapping("/page") 71 | public Result findPage(@RequestParam Integer pageNum, 72 | @RequestParam Integer pageSize, 73 | @RequestParam String name) { 74 | QueryWrapper roleQueryWrapper = new QueryWrapper<>(); 75 | roleQueryWrapper.like("name", name); 76 | return Result.succ(roleService.page(new Page<>(pageNum, pageSize), roleQueryWrapper)); 77 | } 78 | } 79 | 80 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/RoleMenuController.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.controller; 2 | 3 | import com.rookie.rookiemeeting.common.lang.Result; 4 | import com.rookie.rookiemeeting.service.IRoleMenuService; 5 | import com.rookie.rookiemeeting.service.IRoleService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.List; 12 | 13 | @RestController 14 | @RequestMapping("/roleMenu") 15 | @Api(tags = "角色与菜单模块") 16 | public class RoleMenuController { 17 | 18 | @Autowired 19 | IRoleMenuService roleMenuService; 20 | 21 | @Autowired 22 | IRoleService roleService; 23 | 24 | //绑定角色和菜单的关系 25 | @ApiOperation("绑定角色和菜单的关系接口") 26 | @PostMapping("/{roleId}") 27 | public Result roleMenu(@PathVariable Integer roleId, @RequestBody List menuIds) { 28 | roleService.setRoleMenu(roleId, menuIds); 29 | return Result.succ(null); 30 | } 31 | 32 | @GetMapping("/{roleId}") 33 | @ApiOperation("根据角色ID查询菜单接口") 34 | public Result getRoleMenu(@PathVariable Integer roleId) { 35 | Object roleMenu = roleService.getRoleMenu(roleId); 36 | return Result.succ(roleMenu); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/EmployeeDto.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import cn.afterturn.easypoi.excel.annotation.Excel; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.io.Serializable; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class EmployeeDto implements Serializable { 14 | 15 | @Excel(name = "员工ID") 16 | private Long employeeid; 17 | 18 | @Excel(name = "员工姓名") 19 | private String employeename; 20 | 21 | @Excel(name = "登录账号") 22 | private String username; 23 | 24 | @Excel(name = "手机号") 25 | private String phone; 26 | 27 | @Excel(name = "邮箱") 28 | private String email; 29 | 30 | @Excel(name = "所属部门") 31 | private String departmentname; 32 | 33 | @Excel(name = "角色", replace = {"普通用户_1", "管理员_2"}) 34 | private String role; 35 | 36 | @Excel(name = "账号状态", replace = {"未审批_0", "正常_1", "审批未通过_2"}) 37 | private Integer status; 38 | } 39 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/LoginDto.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import com.rookie.rookiemeeting.entity.Menu; 4 | import lombok.Data; 5 | 6 | import javax.validation.constraints.NotBlank; 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | @Data 11 | public class LoginDto implements Serializable { 12 | 13 | private long employeeid; 14 | 15 | @NotBlank(message = "账号不能为空") 16 | private String username; 17 | 18 | @NotBlank(message = "密码不能为空") 19 | private String password; 20 | 21 | private String employeename; 22 | 23 | private String token; 24 | 25 | private String role; 26 | 27 | private List menus; 28 | } 29 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/MeetingDto.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.springframework.format.annotation.DateTimeFormat; 7 | 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | @Data 12 | @AllArgsConstructor 13 | @NoArgsConstructor 14 | public class MeetingDto implements Serializable { 15 | 16 | //会议ID 17 | private Integer meetingid; 18 | 19 | //员工ID 20 | private Long employeeid; 21 | 22 | //会议名称 23 | private String meetingname; 24 | 25 | //会议开始签到时间 26 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 27 | private Date signinstarttime; 28 | 29 | //会议结束签到时间 30 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 31 | private Date signinendtime; 32 | 33 | //开始时间 34 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 35 | private Date starttime; 36 | 37 | //结束时间 38 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 39 | private Date endtime; 40 | 41 | //预约时间 42 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 43 | private Date reservationtime; 44 | 45 | //取消会议时间 46 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss-") 47 | private Date canceledtime; 48 | 49 | //房间号 50 | private Integer roomid; 51 | 52 | //预订房间的人的ID 53 | private Integer reservationistid; 54 | 55 | //预订房间的人的姓名 56 | private String reservationistname; 57 | 58 | //房间名 59 | private String roomname; 60 | 61 | //房间号 62 | private Integer roomnum; 63 | 64 | //预计参会人数 65 | private Integer numberofparticipants; 66 | 67 | //取消会议原因 68 | private String canceledreason; 69 | 70 | //会议说明 71 | private String description; 72 | 73 | //签到状态 74 | private Integer status; 75 | 76 | } 77 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/ParticipantsDto.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import cn.afterturn.easypoi.excel.annotation.Excel; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import java.io.Serializable; 10 | import java.util.Date; 11 | 12 | @Data 13 | @AllArgsConstructor 14 | @NoArgsConstructor 15 | public class ParticipantsDto implements Serializable { 16 | 17 | //会议ID 18 | private Integer meetingid; 19 | 20 | //员工ID 21 | private Long employeeid; 22 | 23 | //员工姓名 24 | @Excel(name = "员工姓名") 25 | private String employeename; 26 | 27 | //邮箱 28 | @Excel(name = "邮箱") 29 | private String email; 30 | 31 | //手机号 32 | @Excel(name = "手机号") 33 | private String phone; 34 | 35 | //签到状态 36 | @Excel(name = "会议签到状态", replace = {"未签到_0", "已签到_1"}) 37 | private Integer status; 38 | 39 | //签到地址 40 | @Excel(name = "签到地址") 41 | private String location; 42 | 43 | //会议开始签到时间 44 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 45 | private Date signinstarttime; 46 | 47 | //会议结束签到时间 48 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 49 | private Date signinendtime; 50 | 51 | //所属部门 52 | @Excel(name = "所属部门") 53 | private String departmentname; 54 | 55 | //签到时间 56 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 57 | @Excel(name = "签到时间", exportFormat = "yyyy-MM-dd HH:mm:ss") 58 | private Date checkintime; 59 | } 60 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/RoomDto.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class RoomDto implements Serializable { 13 | 14 | //会议室ID 15 | private Integer roomId; 16 | 17 | //会议室名称 18 | private String roomName; 19 | } 20 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/SevenDayMeeting.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class SevenDayMeeting implements Serializable { 14 | 15 | //会议名称 16 | private String meetingname; 17 | 18 | //会议室名称 19 | private String roomname; 20 | 21 | //会议开始时间 22 | private Date starttime; 23 | 24 | //会议结束时间 25 | private Date endtime; 26 | 27 | //会议室ID 28 | private Integer roomid; 29 | 30 | //会议ID 31 | private Integer meetingid; 32 | } 33 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/dto/UpdatePassDTO.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class UpdatePassDTO implements Serializable { 13 | 14 | private String username; 15 | private String password; 16 | private String newPassword; 17 | } 18 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/interceptor/JwtInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.interceptor; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import com.auth0.jwt.JWT; 5 | import com.auth0.jwt.JWTVerifier; 6 | import com.auth0.jwt.algorithms.Algorithm; 7 | import com.auth0.jwt.exceptions.JWTDecodeException; 8 | import com.auth0.jwt.exceptions.JWTVerificationException; 9 | import com.rookie.rookiemeeting.common.execption.ServiceException; 10 | import com.rookie.rookiemeeting.common.lang.Constants; 11 | import com.rookie.rookiemeeting.config.AuthAccess; 12 | import com.rookie.rookiemeeting.entity.Employee; 13 | import com.rookie.rookiemeeting.service.IEmployeeService; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.data.redis.core.RedisTemplate; 16 | import org.springframework.web.method.HandlerMethod; 17 | import org.springframework.web.servlet.HandlerInterceptor; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import javax.servlet.http.HttpServletResponse; 21 | 22 | public class JwtInterceptor implements HandlerInterceptor { 23 | 24 | @Autowired 25 | IEmployeeService employeeService; 26 | 27 | @Autowired 28 | RedisTemplate redisTemplate; 29 | 30 | @Override 31 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 32 | 33 | //获取请求头里的token 34 | String token = request.getHeader("token"); 35 | if (!(handler instanceof HandlerMethod)) { 36 | return true; 37 | } else { 38 | HandlerMethod h = (HandlerMethod) handler; 39 | AuthAccess authAccess = h.getMethodAnnotation(AuthAccess.class); 40 | if (authAccess != null) { 41 | return true; 42 | } 43 | } 44 | //如果不是映射方法自己通过 45 | /*if (!(handler instanceof HandlerMethod)){ 46 | return true; 47 | }*/ 48 | if (redisTemplate.opsForValue().get("JWT_" + token) == null) { 49 | throw new ServiceException(Constants.CODE_401, "无TOKEN,请重新登录"); 50 | } 51 | //执行认证 52 | if (StrUtil.isBlank(token)) { 53 | throw new ServiceException(Constants.CODE_401, "无TOKEN,请重新登录"); 54 | } 55 | //获取token中的userId 56 | String userId; 57 | try { 58 | userId = JWT.decode(token).getAudience().get(0); 59 | } catch (JWTDecodeException j) { 60 | throw new ServiceException(Constants.CODE_401, "TOKEN验证失败,请重新登录"); 61 | } 62 | //根据token中的userId查询数据库 63 | Employee employee = employeeService.getById(userId); 64 | if (employee == null) { 65 | throw new ServiceException(Constants.CODE_401, "用户不存在,请重新登录"); 66 | } 67 | //验证token 68 | JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(employee.getPassword())).build(); 69 | try { 70 | jwtVerifier.verify(token); 71 | } catch (JWTVerificationException e) { 72 | throw new ServiceException(Constants.CODE_401, "TOKEN验证失败,请重新登录"); 73 | } 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.Department; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | 9 | @Mapper 10 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 11 | public interface DepartmentMapper extends BaseMapper { 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/DictMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.Dict; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author 何超 15 | * @since 2022-08-23 16 | */ 17 | @Mapper 18 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 19 | public interface DictMapper extends BaseMapper { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/EmployeeMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 6 | import com.rookie.rookiemeeting.dto.EmployeeDto; 7 | import com.rookie.rookiemeeting.dto.ParticipantsDto; 8 | import com.rookie.rookiemeeting.dto.UpdatePassDTO; 9 | import com.rookie.rookiemeeting.entity.Employee; 10 | import org.apache.ibatis.annotations.CacheNamespace; 11 | import org.apache.ibatis.annotations.Mapper; 12 | import org.apache.ibatis.annotations.Param; 13 | 14 | import java.util.List; 15 | 16 | @Mapper 17 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 18 | public interface EmployeeMapper extends BaseMapper { 19 | 20 | //注册 21 | int register(Employee employee); 22 | 23 | //查询用户名是否存在 24 | Employee queryUsername(@Param("username") String username); 25 | 26 | //修改密码 27 | int updatePass(UpdatePassDTO updatePassDTO); 28 | 29 | //查询全部 30 | Page findEmployee(Page page, @Param("employeename") String employeename, @Param("phone") String phone, @Param("email") String email, @Param("departmentname") String departmentname); 31 | 32 | //查看未审批 33 | List getByStatus(Integer status); 34 | 35 | //管理员通过审批 36 | Integer updateStatusAdopt(@Param("employeeid") Long employeeid); 37 | 38 | //管理员不通过审批 39 | Integer updateStatusFail(Long employeeid); 40 | 41 | //根据ID查询参会人员 42 | List getAllEmpsById(@Param("meetingid") Integer meeting); 43 | 44 | //查询员工,状态为1的 45 | List getAll(); 46 | 47 | //导出功能方法 48 | List export(); 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/MeetingMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 6 | import com.rookie.rookiemeeting.dto.MeetingDto; 7 | import com.rookie.rookiemeeting.entity.Meeting; 8 | import org.apache.ibatis.annotations.CacheNamespace; 9 | import org.apache.ibatis.annotations.Mapper; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | import java.sql.Date; 13 | import java.util.List; 14 | 15 | 16 | @Mapper 17 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 18 | public interface MeetingMapper extends BaseMapper { 19 | 20 | //分页查询全部 21 | Page findMeeting(Page page, @Param("mdto") MeetingDto meetingDto); 22 | 23 | //根据登录的员工ID查询自己预定的会议 24 | Page getmeetingofmybookCanCancle(Page page, @Param("employeeid") Long employeeid, @Param("meetingname") String meetingname); 25 | 26 | //根据会议ID,取消会议 27 | void cancelmeeting(@Param("meetingid") Integer meetingid, @Param("canceledreason") String canceledreason); 28 | 29 | //查询取消会议 30 | Page getCancelMeeting(Page page, @Param("employeeid") Integer emplyeeid, @Param("meetingname") String meetingname); 31 | 32 | //根据employeeid获取会议信息 33 | List getMeetingById(@Param("employeeid") Long employeeid); 34 | 35 | //根据已登录的员工ID查询自己的会议 36 | Page getMyMeeting(Page page, @Param("employeeid") Long employeeid, @Param("meetingname") String meetingname); 37 | 38 | //查询最近14天内的会议 39 | Page getSevenDayMeeting(Page page, @Param("employeeid") Long employeeid, @Param("meetingname") String meetingname); 40 | 41 | //添加会议 42 | Integer addMeeting(Meeting meeting); 43 | 44 | //根据ID查询会议详情 45 | List meetingById(@Param("meetingid") Integer meetingid); 46 | 47 | //根据会议ID删除会议和参会人员 48 | void delById(@Param("meetingid") Integer meetingid); 49 | 50 | List getCalendar(@Param("employeeid") Long employeeid); 51 | } 52 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/MeetingParticipantsMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.MeetingParticipants; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 14 | public interface MeetingParticipantsMapper extends BaseMapper { 15 | 16 | //根据会议ID查询参会员工 17 | List getAllBymeetingid(@Param("meetingid") Integer meetingid); 18 | 19 | //添加会议参加者 20 | void addParticipants(@Param("meetingid") Integer meetingid, @Param("employeeid") List employeeid); 21 | 22 | //根据会议ID,员工ID删除该员工的会议 23 | void delEmployee(@Param("meetingid") Integer meetingid, @Param("employeeid") Long employeeid); 24 | 25 | //根据会议ID,员工ID补签 26 | void signature(MeetingParticipants meetingParticipants); 27 | 28 | //签到 29 | void singIn(@Param("employeeid") Long employeeid, @Param("meetingid") Integer meetingie, @Param("location") String location); 30 | 31 | int queryNum(@Param("meetingid") Integer meetingid); 32 | 33 | int signed(@Param("meetingid") Integer meetingid); 34 | } 35 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/MeetingRoomMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.dto.RoomDto; 6 | import com.rookie.rookiemeeting.entity.MeetingRoom; 7 | import org.apache.ibatis.annotations.CacheNamespace; 8 | import org.apache.ibatis.annotations.Mapper; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 14 | public interface MeetingRoomMapper extends BaseMapper { 15 | 16 | //得到所有RoomDto 17 | List getAll(); 18 | 19 | //查询可用的会议室 20 | List queryAll(); 21 | } 22 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.Menu; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author 何超 15 | * @since 2022-08-22 16 | */ 17 | @Mapper 18 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 19 | public interface MenuMapper extends BaseMapper { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.Role; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | /** 11 | *

12 | * Mapper 接口 13 | *

14 | * 15 | * @author 何超 16 | * @since 2022-08-22 17 | */ 18 | @Mapper 19 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 20 | public interface RoleMapper extends BaseMapper { 21 | 22 | Integer selectByFlag(@Param("flag") String flag); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/mapper/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.rookie.rookiemeeting.config.MybatisRedisCache; 5 | import com.rookie.rookiemeeting.entity.RoleMenu; 6 | import org.apache.ibatis.annotations.CacheNamespace; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | @CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class) 14 | public interface RoleMenuMapper extends BaseMapper { 15 | 16 | int deleteByRoleId(@Param("roleId") Integer roleId); 17 | 18 | List selectByRoleId(@Param("roleId") Integer roleId); 19 | } 20 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IDepartmentService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.Department; 5 | 6 | public interface IDepartmentService extends IService { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IDictService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.Dict; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author 何超 12 | * @since 2022-08-23 13 | */ 14 | public interface IDictService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IEmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.rookie.rookiemeeting.dto.EmployeeDto; 6 | import com.rookie.rookiemeeting.dto.ParticipantsDto; 7 | import com.rookie.rookiemeeting.dto.UpdatePassDTO; 8 | import com.rookie.rookiemeeting.entity.Employee; 9 | 10 | import java.util.List; 11 | 12 | public interface IEmployeeService extends IService { 13 | 14 | //注册功能 15 | int register(Employee employee); 16 | 17 | //查询用户名是否存在 18 | Employee queryUsername(String username); 19 | 20 | //修改密码 21 | int updatePass(UpdatePassDTO updatePassDTO); 22 | 23 | //分页查询全部 24 | Page findEmployee(Page page, String employeename, String phone, String email, String departmentname); 25 | 26 | //查看未审批 27 | List getByStatus(Integer status); 28 | 29 | //管理员通过审批 30 | Integer updateStatusAdopt(Long employeeid); 31 | 32 | //管理员不通过审批 33 | Integer updateStatusFail(Long employeeid); 34 | 35 | //根据ID查询参会人员 36 | List getEmpsById(Integer meetingid); 37 | 38 | //查询员工,状态为1的 39 | List getAll(); 40 | 41 | //导出方法 42 | List export(); 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IMeetingParticipantsService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.MeetingParticipants; 5 | 6 | import java.util.List; 7 | 8 | public interface IMeetingParticipantsService extends IService { 9 | 10 | //添加会议参加者 11 | void addParticipants(Integer meetingid, List employeeidps); 12 | 13 | //删除参会员工 14 | void delEmployee(Integer meetingid, Long employeeid); 15 | 16 | //根据会议ID,员工ID补签 17 | void signature(MeetingParticipants meetingParticipants); 18 | 19 | //签到 20 | void singIn(Long employeeid, Integer meetingie, String location); 21 | 22 | int queryNum(Integer meetingid); 23 | 24 | int signed(Integer meetingid); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IMeetingRoomService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.rookie.rookiemeeting.entity.MeetingRoom; 6 | 7 | import java.util.List; 8 | 9 | public interface IMeetingRoomService extends IService { 10 | 11 | //查询可用的会议室 12 | List queryAll(); 13 | 14 | 15 | IPage mrPage(Integer pageNum, Integer pageSize, String roomname, String roomnum); 16 | } 17 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IMeetingService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.rookie.rookiemeeting.dto.MeetingDto; 7 | import com.rookie.rookiemeeting.entity.Meeting; 8 | 9 | import java.sql.Date; 10 | import java.util.List; 11 | 12 | 13 | public interface IMeetingService extends IService { 14 | 15 | //分页查询全部 16 | Page findMeeting(Page page, MeetingDto meetingDto); 17 | 18 | //根据登录的员工ID查询自己预定的会议 19 | Page getmeetingofmybookCanCancle(Page page, Long employeeid, String meetingname); 20 | 21 | //根据会议ID,取消会议 22 | void cancelmeeting(Integer meetingid, String canceledreason); 23 | 24 | //查询最近14天内的会议 25 | Page getSevenDayMeeting(Page page, Long employeeid, String meetingname); 26 | 27 | //查询取消的会议 28 | Page getCancelMeeting(Page page, Integer emplyeeid, String meetingname); 29 | 30 | //根据已登录的员工ID查询我的会议 31 | Page getMyMeeting(Page page, Long employeeid, String meetingname); 32 | 33 | //预定会议 34 | Integer addMeeting(Meeting meeting, Long employeeid); 35 | 36 | //根据ID查询会议详情 37 | List meetingById(Integer meetingid); 38 | 39 | //根据会议ID删除会议和参会人员 40 | void delById(Integer meetingid); 41 | 42 | List getCalendar(Long employeeid); 43 | } 44 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IMenuService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.Menu; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 服务类 11 | *

12 | * 13 | * @author 何超 14 | * @since 2022-08-22 15 | */ 16 | public interface IMenuService extends IService { 17 | 18 | List getRoleMenu(String roleFlag); 19 | 20 | List findMenus(String name); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IRoleMenuService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.RoleMenu; 5 | 6 | public interface IRoleMenuService extends IService { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/IRoleService.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.rookie.rookiemeeting.entity.Role; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 服务类 11 | *

12 | * 13 | * @author 何超 14 | * @since 2022-08-22 15 | */ 16 | public interface IRoleService extends IService { 17 | 18 | void setRoleMenu(Integer roleId, List menuIds); 19 | 20 | Object getRoleMenu(Integer roleId); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/DepartmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.rookie.rookiemeeting.entity.Department; 5 | import com.rookie.rookiemeeting.mapper.DepartmentMapper; 6 | import com.rookie.rookiemeeting.service.IDepartmentService; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | @Service 11 | @Transactional 12 | public class DepartmentServiceImpl extends ServiceImpl implements IDepartmentService { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/DictServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.rookie.rookiemeeting.entity.Dict; 5 | import com.rookie.rookiemeeting.mapper.DictMapper; 6 | import com.rookie.rookiemeeting.service.IDictService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author 何超 15 | * @since 2022-08-23 16 | */ 17 | @Service 18 | public class DictServiceImpl extends ServiceImpl implements IDictService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/EmployeeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.rookie.rookiemeeting.common.lang.Constants; 6 | import com.rookie.rookiemeeting.dto.EmployeeDto; 7 | import com.rookie.rookiemeeting.dto.ParticipantsDto; 8 | import com.rookie.rookiemeeting.dto.UpdatePassDTO; 9 | import com.rookie.rookiemeeting.entity.Employee; 10 | import com.rookie.rookiemeeting.mapper.EmployeeMapper; 11 | import com.rookie.rookiemeeting.mapper.MeetingParticipantsMapper; 12 | import com.rookie.rookiemeeting.service.IEmployeeService; 13 | import org.apache.commons.codec.digest.DigestUtils; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Service; 16 | import org.springframework.transaction.annotation.Transactional; 17 | 18 | import java.util.List; 19 | 20 | @Service 21 | @Transactional 22 | public class EmployeeServiceImpl extends ServiceImpl implements IEmployeeService { 23 | 24 | @Autowired 25 | EmployeeMapper employeeMapper; 26 | 27 | @Autowired 28 | MeetingParticipantsMapper meetingParticipantsMapper; 29 | 30 | //注册 31 | @Override 32 | public int register(Employee employee) { 33 | employee.setStatus(Constants.STATUS); 34 | employee.setRole(Constants.ROLE); 35 | employee.setPassword(DigestUtils.md5Hex(employee.getPassword() + Constants.SALT)); 36 | return employeeMapper.register(employee); 37 | } 38 | 39 | 40 | //查询用户名是否存在 41 | @Override 42 | public Employee queryUsername(String username) { 43 | return employeeMapper.queryUsername(username); 44 | } 45 | 46 | //修改密码 47 | @Override 48 | public int updatePass(UpdatePassDTO updatePassDTO) { 49 | updatePassDTO.setPassword(DigestUtils.md5Hex(updatePassDTO.getPassword() + Constants.SALT)); 50 | updatePassDTO.setNewPassword(DigestUtils.md5Hex(updatePassDTO.getNewPassword() + Constants.SALT)); 51 | return employeeMapper.updatePass(updatePassDTO); 52 | } 53 | 54 | //分页查询 55 | @Override 56 | public Page findEmployee(Page page, String employeename, String phone, String email, String departmentname) { 57 | return employeeMapper.findEmployee(page, employeename, phone, email, departmentname); 58 | } 59 | 60 | //查询所有审批状态为0的员工 61 | @Override 62 | public List getByStatus(Integer status) { 63 | return employeeMapper.getByStatus(status); 64 | } 65 | 66 | //根据ID通过审批 67 | @Override 68 | public Integer updateStatusAdopt(Long employeeid) { 69 | return employeeMapper.updateStatusAdopt(employeeid); 70 | } 71 | 72 | //根据ID不通过审批 73 | @Override 74 | public Integer updateStatusFail(Long employeeid) { 75 | return employeeMapper.updateStatusFail(employeeid); 76 | } 77 | 78 | //根据会议ID查询会议表信息 79 | @Override 80 | public List getEmpsById(Integer meetingid) { 81 | return employeeMapper.getAllEmpsById(meetingid); 82 | } 83 | 84 | //查询员工,状态为1的 85 | @Override 86 | public List getAll() { 87 | return employeeMapper.getAll(); 88 | } 89 | 90 | //导出 91 | @Override 92 | public List export() { 93 | return employeeMapper.export(); 94 | } 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/MeetingParticipantsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.rookie.rookiemeeting.entity.MeetingParticipants; 5 | import com.rookie.rookiemeeting.mapper.MeetingParticipantsMapper; 6 | import com.rookie.rookiemeeting.service.IMeetingParticipantsService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | @Transactional 15 | public class MeetingParticipantsServiceImpl extends ServiceImpl implements IMeetingParticipantsService { 16 | 17 | @Autowired 18 | MeetingParticipantsMapper meetingParticipantsMapper; 19 | 20 | //添加会议参加者 21 | @Override 22 | public void addParticipants(Integer meetingid, List employeeid) { 23 | meetingParticipantsMapper.addParticipants(meetingid, employeeid); 24 | } 25 | 26 | //根据会议ID,员工ID删除该员工的会议 27 | @Override 28 | public void delEmployee(Integer meetingid, Long employeeid) { 29 | meetingParticipantsMapper.delEmployee(meetingid, employeeid); 30 | } 31 | 32 | //根据会议ID,员工ID补签 33 | @Override 34 | public void signature(MeetingParticipants meetingParticipants) { 35 | meetingParticipantsMapper.signature(meetingParticipants); 36 | } 37 | 38 | //签到 39 | @Override 40 | public void singIn(Long employeeid, Integer meetingie, String location) { 41 | meetingParticipantsMapper.singIn(employeeid, meetingie, location); 42 | } 43 | 44 | @Override 45 | public int queryNum(Integer meetingid) { 46 | return meetingParticipantsMapper.queryNum(meetingid); 47 | } 48 | 49 | @Override 50 | public int signed(Integer meetingid) { 51 | return meetingParticipantsMapper.signed(meetingid); 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/MeetingRoomServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import com.rookie.rookiemeeting.entity.MeetingRoom; 8 | import com.rookie.rookiemeeting.mapper.MeetingRoomMapper; 9 | import com.rookie.rookiemeeting.service.IMeetingRoomService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.List; 15 | 16 | @Service 17 | @Transactional 18 | public class MeetingRoomServiceImpl extends ServiceImpl implements IMeetingRoomService { 19 | 20 | @Autowired 21 | MeetingRoomMapper meetingRoomMapper; 22 | 23 | //查询可用的会议室 24 | @Override 25 | public List queryAll() { 26 | return meetingRoomMapper.queryAll(); 27 | } 28 | 29 | @Override 30 | public IPage mrPage(Integer pageNum, Integer pageSize, String roomname, String roomnum) { 31 | Page meetingRoomPage = new Page<>(pageNum, pageSize); 32 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 33 | queryWrapper.like(MeetingRoom::getRoomname, roomname); 34 | queryWrapper.like(MeetingRoom::getRoomnum, roomnum); 35 | return meetingRoomMapper.selectPage(meetingRoomPage, queryWrapper); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/MeetingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.rookie.rookiemeeting.dto.MeetingDto; 7 | import com.rookie.rookiemeeting.entity.Meeting; 8 | import com.rookie.rookiemeeting.mapper.MeetingMapper; 9 | import com.rookie.rookiemeeting.service.IMeetingService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | 19 | @Service 20 | @Transactional 21 | public class MeetingServiceImpl extends ServiceImpl implements IMeetingService { 22 | 23 | @Autowired 24 | MeetingMapper meetingMapper; 25 | 26 | @Autowired 27 | RedisTemplate redisTemplate; 28 | 29 | 30 | //分页查询全部 31 | @Override 32 | public Page findMeeting(Page page, MeetingDto meetingDto) { 33 | return meetingMapper.findMeeting(page, meetingDto); 34 | } 35 | 36 | 37 | //根据登录的员工ID查询自己预定的会议 38 | @Override 39 | public Page getmeetingofmybookCanCancle(Page page, Long employeeid, String meetingname) { 40 | return meetingMapper.getmeetingofmybookCanCancle(page, employeeid, meetingname); 41 | } 42 | 43 | //根据会议ID,取消会议 44 | @Override 45 | public void cancelmeeting(Integer meetingid, String canceledreason) { 46 | meetingMapper.cancelmeeting(meetingid, canceledreason); 47 | } 48 | 49 | //查询最近14天内的会议 50 | @Override 51 | public Page getSevenDayMeeting(Page page, Long employeeid, String meetingname) { 52 | return meetingMapper.getSevenDayMeeting(page, employeeid, meetingname); 53 | } 54 | 55 | 56 | //查询取消的会议 57 | @Override 58 | public Page getCancelMeeting(Page page, Integer emplyeeid, String meetingname) { 59 | return meetingMapper.getCancelMeeting(page, emplyeeid, meetingname); 60 | } 61 | 62 | //根据已登录的员工ID查询我的会议 63 | @Override 64 | public Page getMyMeeting(Page page, Long employeeid, String meetingname) { 65 | return meetingMapper.getMyMeeting(page, employeeid, meetingname); 66 | } 67 | 68 | //预定会议 69 | @Override 70 | public Integer addMeeting(Meeting meeting, Long employeeid) { 71 | meeting.setReservationtime(new Date()); 72 | meeting.setReservationistid(employeeid); 73 | meeting.setStatus(0); 74 | return meetingMapper.addMeeting(meeting); 75 | } 76 | 77 | //根据ID查询会议详情 78 | @Override 79 | public List meetingById(Integer meetingid) { 80 | return meetingMapper.meetingById(meetingid); 81 | } 82 | 83 | //根据会议ID删除会议和参会人员 84 | @Override 85 | public void delById(Integer meetingid) { 86 | meetingMapper.delById(meetingid); 87 | } 88 | 89 | @Override 90 | public List getCalendar(Long employeeid) { 91 | return meetingMapper.getCalendar(employeeid); 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/MenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.rookie.rookiemeeting.entity.Menu; 7 | import com.rookie.rookiemeeting.mapper.MenuMapper; 8 | import com.rookie.rookiemeeting.mapper.RoleMapper; 9 | import com.rookie.rookiemeeting.mapper.RoleMenuMapper; 10 | import com.rookie.rookiemeeting.service.IMenuService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | import java.util.stream.Collectors; 17 | 18 | /** 19 | *

20 | * 服务实现类 21 | *

22 | * 23 | * @author 何超 24 | * @since 2022-08-22 25 | */ 26 | @Service 27 | public class MenuServiceImpl extends ServiceImpl implements IMenuService { 28 | 29 | @Autowired 30 | RoleMapper roleMapper; 31 | 32 | @Autowired 33 | RoleMenuMapper roleMenuMapper; 34 | 35 | @Autowired 36 | IMenuService menuService; 37 | 38 | @Override 39 | public List getRoleMenu(String roleFlag) { 40 | Integer roleId = roleMapper.selectByFlag(roleFlag); 41 | //当前角色所有菜单id集合 42 | List menuIds = roleMenuMapper.selectByRoleId(roleId); 43 | //查出所有菜单 44 | List menus = menuService.findMenus(""); 45 | //new一个最后筛选完成之后的list 46 | List roleMenus = new ArrayList<>(); 47 | //筛选当前用户角色菜单 48 | for (Menu menu : menus) { 49 | if (menuIds.contains(menu.getId())) { 50 | roleMenus.add(menu); 51 | } 52 | List children = menu.getChildren(); 53 | children.removeIf(child -> !menuIds.contains(child.getId())); 54 | } 55 | return roleMenus; 56 | } 57 | 58 | @Override 59 | public List findMenus(String name) { 60 | QueryWrapper queryWrapper = new QueryWrapper<>(); 61 | queryWrapper.orderByAsc("sort_num"); 62 | if (StrUtil.isNotBlank(name)) { 63 | queryWrapper.like("name", name); 64 | } 65 | // 查询所有数据 66 | List list = list(queryWrapper); 67 | // 找出pid为null的一级菜单 68 | List parentNodes = list.stream().filter(menu -> menu.getPid() == null).collect(Collectors.toList()); 69 | // 找出一级菜单的子菜单 70 | for (Menu menu : parentNodes) { 71 | // 筛选所有数据中pid=父级id的数据就是二级菜单 72 | menu.setChildren(list.stream().filter(m -> menu.getId().equals(m.getPid())).collect(Collectors.toList())); 73 | } 74 | return parentNodes; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/RoleMenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.rookie.rookiemeeting.entity.RoleMenu; 5 | import com.rookie.rookiemeeting.mapper.RoleMenuMapper; 6 | import com.rookie.rookiemeeting.service.IRoleMenuService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class RoleMenuServiceImpl extends ServiceImpl implements IRoleMenuService { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/service/Impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.service.Impl; 2 | 3 | import cn.hutool.core.collection.CollUtil; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.rookie.rookiemeeting.entity.Menu; 6 | import com.rookie.rookiemeeting.entity.Role; 7 | import com.rookie.rookiemeeting.entity.RoleMenu; 8 | import com.rookie.rookiemeeting.mapper.RoleMapper; 9 | import com.rookie.rookiemeeting.mapper.RoleMenuMapper; 10 | import com.rookie.rookiemeeting.service.IMenuService; 11 | import com.rookie.rookiemeeting.service.IRoleService; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | import org.springframework.transaction.annotation.Transactional; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | *

20 | * 服务实现类 21 | *

22 | * 23 | * @author 何超 24 | * @since 2022-08-22 25 | */ 26 | @Service 27 | public class RoleServiceImpl extends ServiceImpl implements IRoleService { 28 | 29 | @Autowired 30 | RoleMenuMapper roleMenuMapper; 31 | 32 | @Autowired 33 | IMenuService menuService; 34 | 35 | @Transactional 36 | @Override 37 | public void setRoleMenu(Integer roleId, List menuIds) { 38 | //QueryWrapper queryWrapper = new QueryWrapper<>(); 39 | //queryWrapper.eq("role_id", roleId); 40 | //roleMenuMapper.delete(queryWrapper); 41 | 42 | // 先删除当前角色id所有的绑定关系 43 | roleMenuMapper.deleteByRoleId(roleId); 44 | 45 | // 再把前端传过来的菜单id数组绑定到当前的这个角色id上去 46 | List menuIdsCopy = CollUtil.newArrayList(menuIds); 47 | for (Integer menuId : menuIds) { 48 | Menu menu = menuService.getById(menuId); 49 | if (menu.getPid() != null && !menuIdsCopy.contains(menu.getPid())) { // 二级菜单 并且传过来的menuId数组里面没有它的父级id 50 | // 那么我们就得补上这个父级id 51 | RoleMenu roleMenu = new RoleMenu(); 52 | roleMenu.setRoleId(roleId); 53 | roleMenu.setMenuId(menu.getPid()); 54 | roleMenuMapper.insert(roleMenu); 55 | menuIdsCopy.add(menu.getPid()); 56 | } 57 | RoleMenu roleMenu = new RoleMenu(); 58 | roleMenu.setRoleId(roleId); 59 | roleMenu.setMenuId(menuId); 60 | roleMenuMapper.insert(roleMenu); 61 | } 62 | } 63 | 64 | @Override 65 | public List getRoleMenu(Integer roleId) { 66 | 67 | return roleMenuMapper.selectByRoleId(roleId); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/util/BASE64.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.util; 2 | 3 | import sun.misc.BASE64Encoder; 4 | 5 | import java.io.File; 6 | import java.io.FileInputStream; 7 | import java.io.InputStream; 8 | 9 | public class BASE64 { 10 | public static String encodeImgageToBase64(File imageFile) { 11 | // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 12 | // 其进行Base64编码处理 13 | byte[] data = null; 14 | // 读取图片字节数组 15 | try { 16 | InputStream in = new FileInputStream(imageFile); 17 | data = new byte[in.available()]; 18 | in.read(data); 19 | in.close(); 20 | } catch (Exception e) { 21 | e.printStackTrace(); 22 | } 23 | // 对字节数组Base64编码 24 | BASE64Encoder encoder = new BASE64Encoder(); 25 | // 返回Base64编码过的字节数组字符串 26 | return encoder.encode(data); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/util/SpringUtil.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.util; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * SpringUtil是手动获取bean的工具类 10 | */ 11 | @Component 12 | public class SpringUtil implements ApplicationContextAware { 13 | 14 | private static ApplicationContext applicationContext; 15 | 16 | public static Object getBean(String name) { 17 | return applicationContext.getBean(name); 18 | } 19 | 20 | public static T getBean(String name, Class clazz) { 21 | return applicationContext.getBean(name, clazz); 22 | } 23 | 24 | public static T getBean(Class clazz) { 25 | return applicationContext.getBean(clazz); 26 | } 27 | 28 | @Override 29 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 30 | SpringUtil.applicationContext = applicationContext; 31 | } 32 | } -------------------------------------------------------------------------------- /RookieMeeting/src/main/java/com/rookie/rookiemeeting/util/TokenUtils.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting.util; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import cn.hutool.core.util.StrUtil; 5 | import com.auth0.jwt.JWT; 6 | import com.auth0.jwt.algorithms.Algorithm; 7 | import com.rookie.rookiemeeting.entity.Employee; 8 | import com.rookie.rookiemeeting.service.IEmployeeService; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.context.request.RequestContextHolder; 11 | import org.springframework.web.context.request.ServletRequestAttributes; 12 | 13 | import javax.annotation.PostConstruct; 14 | import javax.annotation.Resource; 15 | import javax.servlet.http.HttpServletRequest; 16 | import java.util.Date; 17 | 18 | @Component 19 | public class TokenUtils { 20 | 21 | private static IEmployeeService staticEmployeeService; 22 | 23 | @Resource 24 | private IEmployeeService employeeService; 25 | 26 | //生成Token 27 | public static String genToken(String userId, String sign) { 28 | return JWT.create().withAudience(userId) //将userId保存到token里面,作为载荷 29 | .withExpiresAt(DateUtil.offsetHour(new Date(), 2)) //两小时后token过期 30 | .sign(Algorithm.HMAC256(sign)); //以password作为token的密钥 31 | } 32 | 33 | //获取当前登录的用户信息 34 | public static Employee getCurrentUser() { 35 | try { 36 | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); 37 | String token = request.getHeader("token"); 38 | if (StrUtil.isNotBlank(token)) { 39 | String userId = JWT.decode(token).getAudience().get(0); 40 | return staticEmployeeService.getById(Integer.valueOf(userId)); 41 | } 42 | } catch (Exception e) { 43 | return null; 44 | } 45 | 46 | return null; 47 | } 48 | 49 | @PostConstruct 50 | public void setUserService() { 51 | staticEmployeeService = employeeService; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | # 数据库配置 3 | datasource: 4 | driver-class-name: com.mysql.cj.jdbc.Driver 5 | url: jdbc:mysql://127.0.0.1:3306/rookiemeeting?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 6 | username: root 7 | password: root 8 | type: com.alibaba.druid.pool.DruidDataSource 9 | 10 | #Spring Boot 默认是不注入这些属性值的,需要自己绑定 11 | #druid 数据源专有配置 12 | initialSize: 5 13 | minIdle: 5 14 | maxActive: 20 15 | maxWait: 60000 16 | timeBetweenEvictionRunsMillis: 60000 17 | minEvictableIdleTimeMillis: 300000 18 | validationQuery: SELECT 1 FROM DUAL 19 | testWhileIdle: true 20 | testOnBorrow: false 21 | testOnReturn: false 22 | poolPreparedStatements: true 23 | #配置监控统计拦截的filters,stat:监控统计、log4j:日志记录、wall:防御sql注入 24 | #如果允许时报错 java.lang.ClassNotFoundException: org.apache.log4j.Priority 25 | #则导入 log4j 依赖即可,Maven 地址:https://mvnrepository.com/artifact/log4j/log4j 26 | filters: stat,wall 27 | maxPoolPreparedStatementPerConnectionSize: 20 28 | useGlobalDataSourceStat: true 29 | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 30 | jackson: 31 | # 配置日期格式化 32 | date-format: yyyy-MM-dd HH:mm:ss #时间戳统一转换为指定格式 33 | time-zone: GMT+8 # 时区修改为东8区 34 | redis: 35 | host: 127.0.0.1 36 | port: 6379 37 | 38 | servlet: 39 | multipart: 40 | enabled: true 41 | max-file-size: 10MB 42 | max-request-size: 200MB 43 | # 端口号 44 | server: 45 | port: 8888 46 | 47 | 48 | # 人脸照片上传路径 49 | files: 50 | upload: 51 | path: D:/photo/FaceInformation/ 52 | 53 | photo: 54 | tmp: D:/photo/Tmp/ 55 | 56 | baidu: 57 | appId: #appId 58 | key: #key 59 | secret: #secret 60 | mybatis-plus: 61 | configuration: 62 | cache-enabled: true 63 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 64 | global-config: 65 | db-config: 66 | logic-not-delete-value: 0 67 | logic-delete-value: 1 -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ___ _ _ 2 | | _ \ ___ ___ | |__ (_) ___ 3 | | / / _ \ / _ \ | / / | | / -_) 4 | |_|_\ \___/ \___/ |_\_\ _|_|_ \___| 5 | _|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| 6 | "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 7 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/DepartmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/DictMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/EmployeeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | insert into employee (username, password, status, role, employeename, departmentid) 10 | values (#{username}, #{password}, #{status}, #{role}, #{employeename}, #{departmentid}) 11 | 12 | 13 | 14 | 15 | update employee 16 | set status = 1 17 | where employeeid = #{employeeid} 18 | 19 | 20 | 21 | update employee 22 | set status = 2 23 | where employeeid = #{employeeid} 24 | 25 | 26 | 27 | update employee 28 | set password = #{newPassword} 29 | where username = #{username} 30 | and password = #{password} 31 | 32 | 33 | 38 | 39 | 57 | 58 | 63 | 64 | 65 | 86 | 87 | 93 | 94 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/MeetingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into meeting (meetingname, roomid, reservationistid, numberofparticipants, signinstarttime, 11 | signinendtime, starttime, endtime, 12 | reservationtime, canceledtime, description, status) 13 | values (#{meetingname}, #{roomid}, #{reservationistid}, #{numberofparticipants}, #{signinstarttime}, 14 | #{signinendtime}, #{starttime}, #{endtime}, 15 | #{reservationtime}, #{canceledtime}, #{description}, #{status}); 16 | 17 | 18 | 19 | update meeting 20 | set canceledreason = #{canceledreason}, 21 | status = 1, 22 | canceledtime = now() 23 | where meetingid = #{meetingid} 24 | 25 | 26 | 27 | 28 | delete meeting,meetingparticipants 29 | from meeting 30 | left join meetingparticipants on meeting.meetingid = meetingparticipants.meetingid 31 | where meeting.meetingid = #{meetingid} 32 | 33 | 34 | 35 | 62 | 63 | 79 | 80 | 91 | 92 | 100 | 101 | 102 | 115 | 116 | 127 | 128 | 129 | 136 | 137 | 149 | 150 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/MeetingParticipantsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | update meetingparticipants 10 | set status = 1, 11 | checkintime = now(), 12 | location = #{location} 13 | where meetingid = #{meetingid} 14 | AND employeeid = #{employeeid} 15 | 16 | 17 | 18 | update meetingparticipants 19 | set status = 1, 20 | checkintime = now(), 21 | location = #{location} 22 | where meetingid = #{meetingid} 23 | AND employeeid = #{employeeid} 24 | 25 | 26 | 27 | delete 28 | from meetingparticipants 29 | where meetingid = #{meetingid} 30 | and employeeid = #{employeeid} 31 | 32 | 33 | 38 | 39 | 40 | insert into meetingparticipants (meetingid, employeeid,status) values 41 | 42 | (#{meetingid},#{mp},0) 43 | 44 | 45 | 46 | 51 | 52 | 58 | 59 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/MeetingRoomMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 12 | 13 | 18 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/MenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /RookieMeeting/src/main/resources/mapper/RoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | delete 7 | from sys_role_menu 8 | where role_id = #{roleId} 9 | 10 | 15 | -------------------------------------------------------------------------------- /RookieMeeting/src/test/java/com/rookie/rookiemeeting/RookieMeetingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.rookie.rookiemeeting; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RookieMeetingApplicationTests { 8 | 9 | 10 | @Test 11 | void contextLoads() { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /imgs/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/.keep -------------------------------------------------------------------------------- /imgs/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/image1.png -------------------------------------------------------------------------------- /imgs/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/image2.png -------------------------------------------------------------------------------- /imgs/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/image3.png -------------------------------------------------------------------------------- /imgs/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/image4.png -------------------------------------------------------------------------------- /imgs/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/imgs/image5.png -------------------------------------------------------------------------------- /meeting/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /meeting/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /meeting/README.md: -------------------------------------------------------------------------------- 1 | # meeting 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /meeting/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /meeting/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /meeting/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "meeting", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.27.2", 11 | "core-js": "^3.8.3", 12 | "date-fns": "^2.28.0", 13 | "dayjs": "^1.11.2", 14 | "echarts": "^5.3.3", 15 | "element-ui": "^2.15.8", 16 | "lib-flexible": "^0.3.2", 17 | "screenfull": "^6.0.2", 18 | "vue": "^2.6.14", 19 | "vue-router": "^3.5.1", 20 | "vuex": "^3.6.2" 21 | }, 22 | "devDependencies": { 23 | "@vue/cli-plugin-babel": "~5.0.0", 24 | "@vue/cli-plugin-router": "~5.0.0", 25 | "@vue/cli-plugin-vuex": "~5.0.0", 26 | "@vue/cli-service": "~5.0.0", 27 | "px2rem-loader": "^0.1.9", 28 | "vue-template-compiler": "^2.6.14" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /meeting/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/meeting/public/favicon.ico -------------------------------------------------------------------------------- /meeting/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/meeting/public/icon.png -------------------------------------------------------------------------------- /meeting/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 会议签到系统 9 | 10 | 11 | 12 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /meeting/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 25 | -------------------------------------------------------------------------------- /meeting/src/assets/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/meeting/src/assets/404.png -------------------------------------------------------------------------------- /meeting/src/assets/gloable.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | -------------------------------------------------------------------------------- /meeting/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/meeting/src/assets/logo.png -------------------------------------------------------------------------------- /meeting/src/assets/错误.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/meeting/src/assets/错误.png -------------------------------------------------------------------------------- /meeting/src/components/Aside.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 57 | 58 | -------------------------------------------------------------------------------- /meeting/src/components/Header.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 88 | 89 | -------------------------------------------------------------------------------- /meeting/src/components/Layout.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 71 | 72 | -------------------------------------------------------------------------------- /meeting/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import ElementUI from 'element-ui'; 6 | import 'element-ui/lib/theme-chalk/index.css'; 7 | import '@/assets/gloable.css' 8 | import request from "@/util/request" 9 | 10 | Vue.config.productionTip = false 11 | Vue.use(ElementUI,{size:"small"}) 12 | Vue.prototype.request=request 13 | 14 | new Vue({ 15 | router, 16 | store, 17 | render: h => h(App) 18 | }).$mount('#app') 19 | -------------------------------------------------------------------------------- /meeting/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import router,{resetRouter} from "@/router"; 4 | 5 | Vue.use(Vuex) 6 | 7 | export default new Vuex.Store({ 8 | state: { 9 | currentPathName: '' 10 | }, 11 | getters: { 12 | }, 13 | mutations: { 14 | setPath(state){ 15 | this.state.currentPathName = localStorage.getItem("currentPathName") 16 | }, 17 | logout(){ 18 | //清空缓存 19 | localStorage.removeItem("employee") 20 | localStorage.removeItem("menus") 21 | localStorage.removeItem("token") 22 | localStorage.removeItem("location") 23 | router.push("/login") 24 | //重置路由 25 | resetRouter() 26 | 27 | } 28 | }, 29 | actions: { 30 | }, 31 | modules: { 32 | } 33 | }) -------------------------------------------------------------------------------- /meeting/src/util/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import ElementUI from 'element-ui' 3 | 4 | const request = axios.create({ 5 | baseURL: 'http://localhost:8888', // 注意!! 这里是全局统一加上了 '/api' 前缀,也就是说所有接口都会加上'/api'前缀在,页面里面写接口的时候就不要加 '/api'了,否则会出现2个'/api',类似 '/api/api/user'这样的报错,切记!!! 6 | timeout: 5000 7 | }) 8 | 9 | // request 拦截器 10 | // 可以自请求发送前对请求做一些处理 11 | // 比如统一加token,对请求参数统一加密 12 | request.interceptors.request.use(config => { 13 | config.headers['Content-Type'] = 'application/json;charset=utf-8'; 14 | let employee = localStorage.getItem("employee") ? JSON.parse(localStorage.getItem("employee")) : null 15 | if (employee){ 16 | config.headers['token'] = employee.token; // 设置请求头 17 | } 18 | return config 19 | }, error => { 20 | return Promise.reject(error) 21 | }); 22 | 23 | // response 拦截器 24 | // 可以在接口响应后统一处理结果 25 | request.interceptors.response.use( 26 | response => { 27 | let res = response.data; 28 | // 如果是返回的文件 29 | if (response.config.responseType === 'blob') { 30 | return res 31 | } 32 | // 兼容服务端返回的字符串数据 33 | if (typeof res === 'string') { 34 | res = res ? JSON.parse(res) : res 35 | } 36 | //当权限验证不通过时的提示 37 | if (res.code === 401){ 38 | ElementUI.Message({ 39 | showClose: true, 40 | message: res.msg, 41 | type: 'error', 42 | }) 43 | } 44 | return res; 45 | }, 46 | error => { 47 | console.log('err' + error) // for debug 48 | return Promise.reject(error) 49 | } 50 | ) 51 | 52 | 53 | export default request 54 | 55 | -------------------------------------------------------------------------------- /meeting/src/views/404/NotFound.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /meeting/src/views/DataReport/DataReport.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 166 | 167 | -------------------------------------------------------------------------------- /meeting/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 85 | 86 | -------------------------------------------------------------------------------- /meeting/src/views/Meeting booking/BookScheduled.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 151 | 152 | -------------------------------------------------------------------------------- /meeting/src/views/Personal Center/Cancel.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 159 | 160 | -------------------------------------------------------------------------------- /meeting/src/views/Personal Center/UpdatePwd.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 79 | 80 | -------------------------------------------------------------------------------- /meeting/src/views/Personnel management/Approval.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 116 | 117 | -------------------------------------------------------------------------------- /meeting/src/views/Personnel management/Manage.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | 235 | 236 | -------------------------------------------------------------------------------- /meeting/src/views/login/FaceLogin.vue: -------------------------------------------------------------------------------- 1 | 25 | 206 | 218 | -------------------------------------------------------------------------------- /meeting/src/views/login/Login.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 102 | 103 | -------------------------------------------------------------------------------- /meeting/src/views/register/Register.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 118 | 119 | -------------------------------------------------------------------------------- /meeting/src/views/sys/Dict.vue: -------------------------------------------------------------------------------- 1 | 77 | 78 | 255 | 256 | -------------------------------------------------------------------------------- /meeting/src/views/sys/Druid.vue: -------------------------------------------------------------------------------- 1 |