├── src └── main │ ├── resources │ ├── static │ │ ├── file │ │ │ └── rml.txt │ │ ├── ruoyi.png │ │ ├── favicon.ico │ │ ├── img │ │ │ ├── blue.png │ │ │ ├── pay.png │ │ │ ├── user.png │ │ │ ├── loading.gif │ │ │ ├── locked.png │ │ │ ├── profile.jpg │ │ │ ├── qr_code.png │ │ │ ├── progress.png │ │ │ ├── loading-upload.gif │ │ │ └── login-background.jpg │ │ ├── fonts │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.ttf │ │ │ ├── zenicon.woff │ │ │ ├── iconfont.woff │ │ │ ├── FontAwesome.otf │ │ │ ├── Simple-Line-Icons.woff2 │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── ajax │ │ │ └── libs │ │ │ │ ├── iCheck │ │ │ │ ├── green.png │ │ │ │ ├── green@2x.png │ │ │ │ └── green-login.png │ │ │ │ ├── layer │ │ │ │ └── theme │ │ │ │ │ └── moon │ │ │ │ │ └── default.png │ │ │ │ ├── summernote │ │ │ │ └── font │ │ │ │ │ ├── summernote.eot │ │ │ │ │ ├── summernote.ttf │ │ │ │ │ ├── summernote.woff │ │ │ │ │ └── summernote.woff2 │ │ │ │ ├── bootstrap-fileinput │ │ │ │ ├── loading.gif │ │ │ │ └── loading-sm.gif │ │ │ │ ├── jquery-ztree │ │ │ │ └── 3.5 │ │ │ │ │ └── css │ │ │ │ │ ├── metro │ │ │ │ │ └── img │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ └── line_conn.png │ │ │ │ │ ├── default │ │ │ │ │ └── img │ │ │ │ │ │ ├── diy │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ ├── 9.png │ │ │ │ │ │ ├── 1_close.png │ │ │ │ │ │ └── 1_open.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── simple │ │ │ │ │ └── img │ │ │ │ │ ├── loading.gif │ │ │ │ │ ├── left_menu.gif │ │ │ │ │ ├── left_menu.png │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ └── zTreeStandard.png │ │ │ │ ├── bootstrap-table │ │ │ │ └── extensions │ │ │ │ │ ├── editable │ │ │ │ │ ├── clear.png │ │ │ │ │ └── loading.gif │ │ │ │ │ └── resizable │ │ │ │ │ └── bootstrap-table-resizable.js │ │ │ │ ├── validate │ │ │ │ └── messages_zh.js │ │ │ │ ├── jsonview │ │ │ │ └── jquery.jsonview.css │ │ │ │ ├── highlight │ │ │ │ └── default.min.css │ │ │ │ └── duallistbox │ │ │ │ └── bootstrap-duallistbox.min.css │ │ └── i18n │ │ │ └── messages.properties │ ├── templates │ │ ├── error │ │ │ ├── service.html │ │ │ ├── 500.html │ │ │ ├── 404.html │ │ │ └── unauth.html │ │ ├── demo │ │ │ ├── modal │ │ │ │ └── table │ │ │ │ │ ├── frame2.html │ │ │ │ │ └── frame1.html │ │ │ └── form │ │ │ │ └── localrefresh.html │ │ ├── tool │ │ │ └── gen │ │ │ │ └── createTable.html │ │ └── system │ │ │ ├── notice │ │ │ └── view.html │ │ │ ├── dict │ │ │ └── type │ │ │ │ └── tree.html │ │ │ ├── menu │ │ │ └── tree.html │ │ │ ├── user │ │ │ ├── resetPwd.html │ │ │ └── deptTree.html │ │ │ └── dept │ │ │ └── tree.html │ ├── mybatis │ │ ├── mybatis-config.xml │ │ └── system │ │ │ ├── UserPostMapper.xml │ │ │ ├── RoleDeptMapper.xml │ │ │ ├── RoleMenuMapper.xml │ │ │ └── UserRoleMapper.xml │ ├── banner.txt │ └── vm │ │ ├── sql │ │ └── sql.vm │ │ └── java │ │ └── service.java.vm │ └── java │ └── com │ └── ruoyi │ ├── framework │ ├── aspectj │ │ ├── lang │ │ │ ├── enums │ │ │ │ ├── DataSourceType.java │ │ │ │ ├── BusinessStatus.java │ │ │ │ ├── OperatorType.java │ │ │ │ ├── BusinessType.java │ │ │ │ └── DesensitizedType.java │ │ │ └── annotation │ │ │ │ ├── Excels.java │ │ │ │ ├── Anonymous.java │ │ │ │ ├── Sensitive.java │ │ │ │ ├── DataSource.java │ │ │ │ ├── DataScope.java │ │ │ │ └── Log.java │ │ └── PermissionsAspect.java │ ├── config │ │ ├── ApplicationConfig.java │ │ ├── ServerConfig.java │ │ ├── I18nConfig.java │ │ ├── FilterConfig.java │ │ ├── GenConfig.java │ │ └── ResourcesConfig.java │ ├── interceptor │ │ ├── annotation │ │ │ └── RepeatSubmit.java │ │ └── RepeatSubmitInterceptor.java │ ├── task │ │ └── RyTask.java │ ├── web │ │ ├── service │ │ │ ├── ConfigService.java │ │ │ └── DictService.java │ │ ├── domain │ │ │ ├── CxSelect.java │ │ │ ├── TreeEntity.java │ │ │ └── Ztree.java │ │ └── page │ │ │ ├── TableSupport.java │ │ │ ├── TableDataInfo.java │ │ │ └── PageDomain.java │ ├── datasource │ │ ├── DynamicDataSource.java │ │ └── DynamicDataSourceContextHolder.java │ ├── context │ │ └── PermissionContextHolder.java │ ├── manager │ │ └── AsyncManager.java │ └── shiro │ │ └── web │ │ └── filter │ │ └── sync │ │ └── SyncOnlineSessionFilter.java │ ├── common │ ├── exception │ │ ├── DemoModeException.java │ │ ├── user │ │ │ ├── BlackListException.java │ │ │ ├── CaptchaException.java │ │ │ ├── UserBlockedException.java │ │ │ ├── UserDeleteException.java │ │ │ ├── RoleBlockedException.java │ │ │ ├── UserNotExistsException.java │ │ │ ├── UserPasswordNotMatchException.java │ │ │ ├── UserException.java │ │ │ ├── UserPasswordRetryLimitCountException.java │ │ │ └── UserPasswordRetryLimitExceedException.java │ │ ├── file │ │ │ ├── FileException.java │ │ │ ├── FileSizeLimitExceededException.java │ │ │ ├── FileNameLengthLimitExceededException.java │ │ │ └── FileUploadException.java │ │ ├── UtilException.java │ │ ├── job │ │ │ └── TaskException.java │ │ ├── GlobalException.java │ │ └── ServiceException.java │ ├── utils │ │ ├── poi │ │ │ └── ExcelHandlerAdapter.java │ │ ├── MessageUtils.java │ │ ├── bean │ │ │ └── BeanValidators.java │ │ ├── security │ │ │ ├── AuthorizationUtils.java │ │ │ └── CipherUtils.java │ │ ├── PageUtils.java │ │ ├── uuid │ │ │ └── IdUtils.java │ │ ├── DesensitizedUtil.java │ │ ├── AddressUtils.java │ │ ├── MapDataUtil.java │ │ ├── file │ │ │ └── MimeTypeUtils.java │ │ ├── Md5Utils.java │ │ ├── ExceptionUtil.java │ │ └── sql │ │ │ └── SqlUtil.java │ ├── constant │ │ ├── PermissionConstants.java │ │ ├── ScheduleConstants.java │ │ ├── CommonMap.java │ │ └── ShiroConstants.java │ └── xss │ │ ├── Xss.java │ │ ├── XssHttpServletRequestWrapper.java │ │ └── XssValidator.java │ ├── project │ ├── monitor │ │ ├── job │ │ │ ├── util │ │ │ │ ├── QuartzJobExecution.java │ │ │ │ └── QuartzDisallowConcurrentExecution.java │ │ │ ├── service │ │ │ │ └── IJobLogService.java │ │ │ └── mapper │ │ │ │ ├── JobMapper.java │ │ │ │ └── JobLogMapper.java │ │ ├── druid │ │ │ └── DruidController.java │ │ ├── logininfor │ │ │ ├── service │ │ │ │ ├── ILogininforService.java │ │ │ │ └── LogininforServiceImpl.java │ │ │ └── mapper │ │ │ │ └── LogininforMapper.java │ │ ├── server │ │ │ ├── controller │ │ │ │ └── ServerController.java │ │ │ └── domain │ │ │ │ ├── Mem.java │ │ │ │ └── Sys.java │ │ ├── operlog │ │ │ ├── service │ │ │ │ ├── IOperLogService.java │ │ │ │ └── OperLogServiceImpl.java │ │ │ └── mapper │ │ │ │ └── OperLogMapper.java │ │ └── online │ │ │ ├── mapper │ │ │ └── UserOnlineMapper.java │ │ │ └── service │ │ │ └── IUserOnlineService.java │ ├── system │ │ ├── user │ │ │ ├── domain │ │ │ │ ├── UserStatus.java │ │ │ │ ├── UserPost.java │ │ │ │ └── UserRole.java │ │ │ ├── mapper │ │ │ │ ├── UserPostMapper.java │ │ │ │ └── UserRoleMapper.java │ │ │ └── controller │ │ │ │ └── RegisterController.java │ │ ├── role │ │ │ ├── mapper │ │ │ │ ├── RoleDeptMapper.java │ │ │ │ ├── RoleMenuMapper.java │ │ │ │ └── RoleMapper.java │ │ │ └── domain │ │ │ │ ├── RoleDept.java │ │ │ │ └── RoleMenu.java │ │ ├── notice │ │ │ ├── mapper │ │ │ │ └── NoticeMapper.java │ │ │ └── service │ │ │ │ └── INoticeService.java │ │ ├── dict │ │ │ ├── service │ │ │ │ └── IDictDataService.java │ │ │ └── mapper │ │ │ │ └── DictTypeMapper.java │ │ ├── config │ │ │ ├── mapper │ │ │ │ └── ConfigMapper.java │ │ │ └── service │ │ │ │ └── IConfigService.java │ │ └── post │ │ │ ├── mapper │ │ │ └── PostMapper.java │ │ │ └── service │ │ │ └── IPostService.java │ ├── tool │ │ ├── swagger │ │ │ └── SwaggerController.java │ │ ├── build │ │ │ └── BuildController.java │ │ └── gen │ │ │ ├── util │ │ │ └── VelocityInitializer.java │ │ │ ├── service │ │ │ ├── IGenTableColumnService.java │ │ │ └── GenTableColumnServiceImpl.java │ │ │ └── mapper │ │ │ ├── GenTableColumnMapper.java │ │ │ └── GenTableMapper.java │ └── demo │ │ └── controller │ │ ├── DemoIconController.java │ │ └── DemoReportController.java │ ├── RuoYiServletInitializer.java │ └── RuoYiApplication.java ├── ry.bat ├── .github └── FUNDING.yml ├── bin ├── clean.bat ├── package.bat └── run-tomcat.bat ├── doc └── 若依环境使用手册.docx ├── .gitignore ├── LICENSE └── ry.sh /src/main/resources/static/file/rml.txt: -------------------------------------------------------------------------------- 1 | 下载临时目录 -------------------------------------------------------------------------------- /ry.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/ry.bat -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: http://doc.ruoyi.vip/ruoyi/other/donate.html 2 | -------------------------------------------------------------------------------- /bin/clean.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/bin/clean.bat -------------------------------------------------------------------------------- /bin/package.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/bin/package.bat -------------------------------------------------------------------------------- /bin/run-tomcat.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/bin/run-tomcat.bat -------------------------------------------------------------------------------- /doc/若依环境使用手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/doc/若依环境使用手册.docx -------------------------------------------------------------------------------- /src/main/resources/static/ruoyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ruoyi.png -------------------------------------------------------------------------------- /src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/img/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/blue.png -------------------------------------------------------------------------------- /src/main/resources/static/img/pay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/pay.png -------------------------------------------------------------------------------- /src/main/resources/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/user.png -------------------------------------------------------------------------------- /src/main/resources/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/img/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/locked.png -------------------------------------------------------------------------------- /src/main/resources/static/img/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/profile.jpg -------------------------------------------------------------------------------- /src/main/resources/static/img/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/qr_code.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/iconfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/zenicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/zenicon.woff -------------------------------------------------------------------------------- /src/main/resources/static/img/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/progress.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/iconfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/resources/static/img/loading-upload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/loading-upload.gif -------------------------------------------------------------------------------- /src/main/resources/static/img/login-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/img/login-background.jpg -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/iCheck/green.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/iCheck/green@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/iCheck/green-login.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/moon/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/layer/theme/moon/default.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.eot -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.woff -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangzongzhuan/RuoYi-fast/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.enums; 2 | 3 | /** 4 | * 数据源 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum DataSourceType 9 | { 10 | /** 11 | * 主库 12 | */ 13 | MASTER, 14 | 15 | /** 16 | * 从库 17 | */ 18 | SLAVE 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/DemoModeException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception; 2 | 3 | /** 4 | * 演示模式异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class DemoModeException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public DemoModeException() 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.enums; 2 | 3 | /** 4 | * 操作状态 5 | * 6 | * @author ruoyi 7 | * 8 | */ 9 | public enum BusinessStatus 10 | { 11 | /** 12 | * 成功 13 | */ 14 | SUCCESS, 15 | 16 | /** 17 | * 失败 18 | */ 19 | FAIL, 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/BlackListException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 黑名单IP异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class BlackListException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public BlackListException() 13 | { 14 | super("login.blocked", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/CaptchaException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 验证码错误异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class CaptchaException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public CaptchaException() 13 | { 14 | super("user.jcaptcha.error", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户锁定异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserBlockedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserBlockedException() 13 | { 14 | super("user.blocked", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserDeleteException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户账号已被删除 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserDeleteException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserDeleteException() 13 | { 14 | super("user.password.delete", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/RoleBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 角色锁定异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class RoleBlockedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public RoleBlockedException() 13 | { 14 | super("role.blocked", null); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户不存在异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserNotExistsException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserNotExistsException() 13 | { 14 | super("user.not.exists", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.enums; 2 | 3 | /** 4 | * 操作人类别 5 | * 6 | * @author ruoyi 7 | * 8 | */ 9 | public enum OperatorType 10 | { 11 | /** 12 | * 其它 13 | */ 14 | OTHER, 15 | 16 | /** 17 | * 后台用户 18 | */ 19 | MANAGE, 20 | 21 | /** 22 | * 手机端用户 23 | */ 24 | MOBILE 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户密码不正确或不符合规范异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserPasswordNotMatchException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordNotMatchException() 13 | { 14 | super("user.password.not.match", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/file/FileException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.file; 2 | 3 | import com.ruoyi.common.exception.base.BaseException; 4 | 5 | /** 6 | * 文件信息异常类 7 | * 8 | * @author ruoyi 9 | */ 10 | public class FileException extends BaseException 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public FileException(String code, Object[] args) 15 | { 16 | super("file", code, args, null); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.file; 2 | 3 | /** 4 | * 文件名大小限制异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class FileSizeLimitExceededException extends FileException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public FileSizeLimitExceededException(long defaultMaxSize) 13 | { 14 | super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | import com.ruoyi.common.exception.base.BaseException; 4 | 5 | /** 6 | * 用户信息异常类 7 | * 8 | * @author ruoyi 9 | */ 10 | public class UserException extends BaseException 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public UserException(String code, Object[] args) 15 | { 16 | super("user", code, args, null); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Excel注解集 10 | * 11 | * @author ruoyi 12 | */ 13 | @Target(ElementType.FIELD) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface Excels 16 | { 17 | Excel[] value(); 18 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitCountException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户错误记数异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserPasswordRetryLimitCountException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordRetryLimitCountException(int retryLimitCount) 13 | { 14 | super("user.password.retry.limit.count", new Object[] { retryLimitCount }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.user; 2 | 3 | /** 4 | * 用户错误最大次数异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserPasswordRetryLimitExceedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordRetryLimitExceedException(int retryLimitCount) 13 | { 14 | super("user.password.retry.limit.exceed", new Object[] { retryLimitCount }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.file; 2 | 3 | /** 4 | * 文件名称超长限制异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class FileNameLengthLimitExceededException extends FileException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public FileNameLengthLimitExceededException(int defaultFileNameLength) 13 | { 14 | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/job/util/QuartzJobExecution.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.job.util; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import com.ruoyi.project.monitor.job.domain.Job; 5 | 6 | /** 7 | * 定时任务处理(允许并发执行) 8 | * 9 | * @author ruoyi 10 | * 11 | */ 12 | public class QuartzJobExecution extends AbstractQuartzJob 13 | { 14 | @Override 15 | protected void doExecute(JobExecutionContext context, Job job) throws Exception 16 | { 17 | JobInvokeUtil.invokeMethod(job); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Anonymous.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 匿名访问不鉴权注解 11 | * 12 | * @author ruoyi 13 | */ 14 | @Target({ ElementType.METHOD, ElementType.TYPE }) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Documented 17 | public @interface Anonymous 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | /** 8 | * 程序注解配置 9 | * 10 | * @author ruoyi 11 | */ 12 | @Configuration 13 | // 表示通过aop框架暴露该代理对象,AopContext能够访问 14 | @EnableAspectJAutoProxy(exposeProxy = true) 15 | // 指定要扫描的Mapper类的包的路径 16 | @MapperScan("com.ruoyi.project.**.mapper") 17 | public class ApplicationConfig 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/RuoYiServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * web容器中进行部署 8 | * 9 | * @author ruoyi 10 | */ 11 | public class RuoYiServletInitializer extends SpringBootServletInitializer 12 | { 13 | @Override 14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) 15 | { 16 | return application.sources(RuoYiApplication.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.poi; 2 | 3 | import org.apache.poi.ss.usermodel.Cell; 4 | import org.apache.poi.ss.usermodel.Workbook; 5 | 6 | /** 7 | * Excel数据格式处理适配器 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ExcelHandlerAdapter 12 | { 13 | /** 14 | * 格式化 15 | * 16 | * @param value 单元格数据值 17 | * @param args excel注解args参数组 18 | * @param cell 单元格对象 19 | * @param wb 工作簿对象 20 | * 21 | * @return 处理后的值 22 | */ 23 | Object format(Object value, String[] args, Cell cell, Workbook wb); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/UtilException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception; 2 | 3 | /** 4 | * 工具类异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UtilException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 8247610319171014183L; 11 | 12 | public UtilException(Throwable e) 13 | { 14 | super(e.getMessage(), e); 15 | } 16 | 17 | public UtilException(String message) 18 | { 19 | super(message); 20 | } 21 | 22 | public UtilException(String message, Throwable throwable) 23 | { 24 | super(message, throwable); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/job/util/QuartzDisallowConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.job.util; 2 | 3 | import org.quartz.DisallowConcurrentExecution; 4 | import org.quartz.JobExecutionContext; 5 | import com.ruoyi.project.monitor.job.domain.Job; 6 | 7 | /** 8 | * 定时任务处理(禁止并发执行) 9 | * 10 | * @author ruoyi 11 | * 12 | */ 13 | @DisallowConcurrentExecution 14 | public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob 15 | { 16 | @Override 17 | protected void doExecute(JobExecutionContext context, Job job) throws Exception 18 | { 19 | JobInvokeUtil.invokeMethod(job); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/domain/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.domain; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * @author ruoyi 7 | * 8 | */ 9 | public enum UserStatus 10 | { 11 | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); 12 | 13 | private final String code; 14 | private final String info; 15 | 16 | UserStatus(String code, String info) 17 | { 18 | this.code = code; 19 | this.info = info; 20 | } 21 | 22 | public String getCode() 23 | { 24 | return code; 25 | } 26 | 27 | public String getInfo() 28 | { 29 | return info; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/templates/error/service.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 500 7 | 8 | 9 | 10 | 11 | 12 |
13 |

操作异常!

14 | 15 |
16 | [[${errorMessage}]] 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/constant/PermissionConstants.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.constant; 2 | 3 | /** 4 | * 权限通用常量 5 | * 6 | * @author ruoyi 7 | */ 8 | public class PermissionConstants 9 | { 10 | /** 新增权限 */ 11 | public static final String ADD_PERMISSION = "add"; 12 | 13 | /** 修改权限 */ 14 | public static final String EDIT_PERMISSION = "edit"; 15 | 16 | /** 删除权限 */ 17 | public static final String REMOVE_PERMISSION = "remove"; 18 | 19 | /** 导出权限 */ 20 | public static final String EXPORT_PERMISSION = "export"; 21 | 22 | /** 显示权限 */ 23 | public static final String VIEW_PERMISSION = "view"; 24 | 25 | /** 查询权限 */ 26 | public static final String LIST_PERMISSION = "list"; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.interceptor.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 自定义注解防止表单重复提交 11 | * 12 | * @author ruoyi 13 | * 14 | */ 15 | @Target(ElementType.METHOD) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Documented 18 | public @interface RepeatSubmit 19 | { 20 | /** 21 | * 间隔时间(ms),小于此时间视为重复提交 22 | */ 23 | public int interval() default 5000; 24 | 25 | /** 26 | * 提示消息 27 | */ 28 | public String message() default "不允许重复提交,请稍后再试"; 29 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/task/RyTask.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.task; 2 | 3 | import org.springframework.stereotype.Component; 4 | import com.ruoyi.common.utils.StringUtils; 5 | 6 | /** 7 | * 定时任务调度测试 8 | * 9 | * @author ruoyi 10 | */ 11 | @Component("ryTask") 12 | public class RyTask 13 | { 14 | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) 15 | { 16 | System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); 17 | } 18 | 19 | public void ryParams(String params) 20 | { 21 | System.out.println("执行有参方法:" + params); 22 | } 23 | 24 | public void ryNoParams() 25 | { 26 | System.out.println("执行无参方法"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.ruoyi.project.system.config.service.IConfigService; 6 | 7 | /** 8 | * RuoYi首创 html调用 thymeleaf 实现参数管理 9 | * 10 | * @author ruoyi 11 | */ 12 | @Service("config") 13 | public class ConfigService 14 | { 15 | @Autowired 16 | private IConfigService configService; 17 | 18 | /** 19 | * 根据键名查询参数配置信息 20 | * 21 | * @param configKey 参数键名 22 | * @return 参数键值 23 | */ 24 | public String getKey(String configKey) 25 | { 26 | return configService.selectConfigByKey(configKey); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/swagger/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.swagger; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.ruoyi.framework.web.controller.BaseController; 8 | 9 | /** 10 | * swagger 接口 11 | * 12 | * @author ruoyi 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/swagger") 16 | public class SwaggerController extends BaseController 17 | { 18 | @RequiresPermissions("tool:swagger:view") 19 | @GetMapping() 20 | public String index() 21 | { 22 | return redirect("/swagger-ui/index.html"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import org.springframework.context.MessageSource; 4 | import org.springframework.context.i18n.LocaleContextHolder; 5 | import com.ruoyi.common.utils.spring.SpringUtils; 6 | 7 | /** 8 | * 获取i18n资源文件 9 | * 10 | * @author ruoyi 11 | */ 12 | public class MessageUtils 13 | { 14 | /** 15 | * 根据消息键和参数 获取消息 委托给spring messageSource 16 | * 17 | * @param code 消息键 18 | * @param args 参数 19 | * @return 获取国际化翻译值 20 | */ 21 | public static String message(String code, Object... args) 22 | { 23 | MessageSource messageSource = SpringUtils.getBean(MessageSource.class); 24 | return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/xss/Xss.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.xss; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * 自定义xss校验注解 12 | * 13 | * @author ruoyi 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) 17 | @Constraint(validatedBy = { XssValidator.class }) 18 | public @interface Xss 19 | { 20 | String message() 21 | 22 | default "不允许任何脚本运行"; 23 | 24 | Class[] groups() default {}; 25 | 26 | Class[] payload() default {}; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/build/BuildController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.build; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.ruoyi.framework.web.controller.BaseController; 8 | 9 | /** 10 | * build 表单构建 11 | * 12 | * @author ruoyi 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/build") 16 | public class BuildController extends BaseController 17 | { 18 | private String prefix = "tool/build"; 19 | 20 | @RequiresPermissions("tool:build:view") 21 | @GetMapping() 22 | public String build() 23 | { 24 | return prefix + "/build"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.bean; 2 | 3 | import java.util.Set; 4 | import javax.validation.ConstraintViolation; 5 | import javax.validation.ConstraintViolationException; 6 | import javax.validation.Validator; 7 | 8 | /** 9 | * bean对象属性验证 10 | * 11 | * @author ruoyi 12 | */ 13 | public class BeanValidators 14 | { 15 | public static void validateWithException(Validator validator, Object object, Class... groups) 16 | throws ConstraintViolationException 17 | { 18 | Set> constraintViolations = validator.validate(object, groups); 19 | if (!constraintViolations.isEmpty()) 20 | { 21 | throw new ConstraintViolationException(constraintViolations); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Build Tools 3 | 4 | .gradle 5 | /build/ 6 | !gradle/wrapper/gradle-wrapper.jar 7 | 8 | target/ 9 | !.mvn/wrapper/maven-wrapper.jar 10 | 11 | ###################################################################### 12 | # IDE 13 | 14 | ### STS ### 15 | .apt_generated 16 | .classpath 17 | .factorypath 18 | .project 19 | .settings 20 | .springBeans 21 | 22 | ### IntelliJ IDEA ### 23 | .idea 24 | *.iws 25 | *.iml 26 | *.ipr 27 | 28 | ### JRebel ### 29 | rebel.xml 30 | ### NetBeans ### 31 | nbproject/private/ 32 | build/* 33 | nbbuild/ 34 | dist/ 35 | nbdist/ 36 | .nb-gradle/ 37 | 38 | ###################################################################### 39 | # Others 40 | *.log 41 | *.xml.versionsBackup 42 | *.swp 43 | 44 | !*/build/*.java 45 | !*/build/*.html 46 | !*/build/*.xml -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/druid/DruidController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.druid; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.ruoyi.framework.web.controller.BaseController; 8 | 9 | /** 10 | * druid 监控 11 | * 12 | * @author ruoyi 13 | */ 14 | @Controller 15 | @RequestMapping("/monitor/data") 16 | public class DruidController extends BaseController 17 | { 18 | private String prefix = "/druid"; 19 | 20 | @RequiresPermissions("monitor:data:view") 21 | @GetMapping() 22 | public String index() 23 | { 24 | return redirect(prefix + "/index.html"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/job/TaskException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.job; 2 | 3 | /** 4 | * 计划策略异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class TaskException extends Exception 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | private Code code; 13 | 14 | public TaskException(String msg, Code code) 15 | { 16 | this(msg, code, null); 17 | } 18 | 19 | public TaskException(String msg, Code code, Exception nestedEx) 20 | { 21 | super(msg, nestedEx); 22 | this.code = code; 23 | } 24 | 25 | public Code getCode() 26 | { 27 | return code; 28 | } 29 | 30 | public enum Code 31 | { 32 | TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.datasource; 2 | 3 | import java.util.Map; 4 | import javax.sql.DataSource; 5 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; 6 | 7 | /** 8 | * 动态数据源 9 | * 10 | * @author ruoyi 11 | */ 12 | public class DynamicDataSource extends AbstractRoutingDataSource 13 | { 14 | public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) 15 | { 16 | super.setDefaultTargetDataSource(defaultTargetDataSource); 17 | super.setTargetDataSources(targetDataSources); 18 | super.afterPropertiesSet(); 19 | } 20 | 21 | @Override 22 | protected Object determineCurrentLookupKey() 23 | { 24 | return DynamicDataSourceContextHolder.getDataSourceType(); 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/security/AuthorizationUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.security; 2 | 3 | import org.apache.shiro.SecurityUtils; 4 | import org.apache.shiro.mgt.RealmSecurityManager; 5 | import com.ruoyi.framework.shiro.realm.UserRealm; 6 | 7 | /** 8 | * 用户授权信息 9 | * 10 | * @author ruoyi 11 | */ 12 | public class AuthorizationUtils 13 | { 14 | /** 15 | * 清理所有用户授权信息缓存 16 | */ 17 | public static void clearAllCachedAuthorizationInfo() 18 | { 19 | getUserRealm().clearAllCachedAuthorizationInfo(); 20 | } 21 | 22 | /** 23 | * 获取自定义Realm 24 | */ 25 | public static UserRealm getUserRealm() 26 | { 27 | RealmSecurityManager rsm = (RealmSecurityManager) SecurityUtils.getSecurityManager(); 28 | return (UserRealm) rsm.getRealms().iterator().next(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Sensitive.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; 8 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 9 | import com.ruoyi.framework.aspectj.lang.enums.DesensitizedType; 10 | import com.ruoyi.framework.config.SensitiveJsonSerializer; 11 | 12 | /** 13 | * 数据脱敏注解 14 | * 15 | * @author ruoyi 16 | */ 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Target(ElementType.FIELD) 19 | @JacksonAnnotationsInside 20 | @JsonSerialize(using = SensitiveJsonSerializer.class) 21 | public @interface Sensitive 22 | { 23 | DesensitizedType desensitizedType(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Inherited; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; 10 | 11 | /** 12 | * 自定义多数据源切换注解 13 | * 14 | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 15 | * 16 | * @author ruoyi 17 | */ 18 | @Target({ ElementType.METHOD, ElementType.TYPE }) 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Documented 21 | @Inherited 22 | public @interface DataSource 23 | { 24 | /** 25 | * 切换数据源名称 26 | */ 27 | public DataSourceType value() default DataSourceType.MASTER; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.enums; 2 | 3 | /** 4 | * 业务操作类型 5 | * 6 | * @author ruoyi 7 | * 8 | */ 9 | public enum BusinessType 10 | { 11 | /** 12 | * 其它 13 | */ 14 | OTHER, 15 | 16 | /** 17 | * 新增 18 | */ 19 | INSERT, 20 | 21 | /** 22 | * 修改 23 | */ 24 | UPDATE, 25 | 26 | /** 27 | * 删除 28 | */ 29 | DELETE, 30 | 31 | /** 32 | * 授权 33 | */ 34 | GRANT, 35 | 36 | /** 37 | * 导出 38 | */ 39 | EXPORT, 40 | 41 | /** 42 | * 导入 43 | */ 44 | IMPORT, 45 | 46 | /** 47 | * 强退 48 | */ 49 | FORCE, 50 | 51 | /** 52 | * 生成代码 53 | */ 54 | GENCODE, 55 | 56 | /** 57 | * 清空数据 58 | */ 59 | CLEAN, 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 数据权限过滤注解 11 | * 12 | * @author ruoyi 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Documented 17 | public @interface DataScope 18 | { 19 | /** 20 | * 部门表的别名 21 | */ 22 | public String deptAlias() default ""; 23 | 24 | /** 25 | * 用户表的别名 26 | */ 27 | public String userAlias() default ""; 28 | 29 | /** 30 | * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来 31 | */ 32 | public String permission() default ""; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/demo/controller/DemoIconController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.demo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * 图标相关 9 | * 10 | * @author ruoyi 11 | */ 12 | @Controller 13 | @RequestMapping("/demo/icon") 14 | public class DemoIconController 15 | { 16 | private String prefix = "demo/icon"; 17 | 18 | /** 19 | * FontAwesome图标 20 | */ 21 | @GetMapping("/fontawesome") 22 | public String fontAwesome() 23 | { 24 | return prefix + "/fontawesome"; 25 | } 26 | 27 | /** 28 | * Glyphicons图标 29 | */ 30 | @GetMapping("/glyphicons") 31 | public String glyphicons() 32 | { 33 | return prefix + "/glyphicons"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/ServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.springframework.stereotype.Component; 5 | import com.ruoyi.common.utils.ServletUtils; 6 | 7 | /** 8 | * 服务相关配置 9 | * 10 | * @author ruoyi 11 | * 12 | */ 13 | @Component 14 | public class ServerConfig 15 | { 16 | /** 17 | * 获取完整的请求路径,包括:域名,端口,上下文访问路径 18 | * 19 | * @return 服务地址 20 | */ 21 | public String getUrl() 22 | { 23 | HttpServletRequest request = ServletUtils.getRequest(); 24 | return getDomain(request); 25 | } 26 | 27 | public static String getDomain(HttpServletRequest request) 28 | { 29 | StringBuffer url = request.getRequestURL(); 30 | String contextPath = request.getServletContext().getContextPath(); 31 | return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/templates/demo/modal/table/frame2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 | 14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/context/PermissionContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.context; 2 | 3 | import org.springframework.web.context.request.RequestAttributes; 4 | import org.springframework.web.context.request.RequestContextHolder; 5 | import com.ruoyi.common.utils.text.Convert; 6 | 7 | /** 8 | * 权限信息 9 | * 10 | * @author ruoyi 11 | */ 12 | public class PermissionContextHolder 13 | { 14 | private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT"; 15 | 16 | public static void setContext(String permission) 17 | { 18 | RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission, 19 | RequestAttributes.SCOPE_REQUEST); 20 | } 21 | 22 | public static String getContext() 23 | { 24 | return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES, 25 | RequestAttributes.SCOPE_REQUEST)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/logininfor/service/ILogininforService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.logininfor.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.logininfor.domain.Logininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ILogininforService 12 | { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(Logininfor logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(Logininfor logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(String ids); 35 | 36 | /** 37 | * 清空系统登录日志 38 | */ 39 | public void cleanLogininfor(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/templates/tool/gen/createTable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 |
12 |
13 | 14 | 15 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/security/CipherUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.security; 2 | 3 | import java.security.Key; 4 | import java.security.NoSuchAlgorithmException; 5 | import javax.crypto.KeyGenerator; 6 | 7 | /** 8 | * 对称密钥密码算法工具类 9 | * 10 | * @author ruoyi 11 | */ 12 | public class CipherUtils 13 | { 14 | /** 15 | * 生成随机秘钥 16 | * 17 | * @param keyBitSize 字节大小 18 | * @param algorithmName 算法名称 19 | * @return 创建密匙 20 | */ 21 | public static Key generateNewKey(int keyBitSize, String algorithmName) 22 | { 23 | KeyGenerator kg; 24 | try 25 | { 26 | kg = KeyGenerator.getInstance(algorithmName); 27 | } 28 | catch (NoSuchAlgorithmException e) 29 | { 30 | String msg = "Unable to acquire " + algorithmName + " algorithm. This is required to function."; 31 | throw new IllegalStateException(msg, e); 32 | } 33 | kg.init(keyBitSize); 34 | return kg.generateKey(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/gen/util/VelocityInitializer.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.gen.util; 2 | 3 | import java.util.Properties; 4 | import org.apache.velocity.app.Velocity; 5 | import com.ruoyi.common.constant.Constants; 6 | 7 | /** 8 | * VelocityEngine工厂 9 | * 10 | * @author ruoyi 11 | */ 12 | public class VelocityInitializer 13 | { 14 | /** 15 | * 初始化vm方法 16 | */ 17 | public static void initVelocity() 18 | { 19 | Properties p = new Properties(); 20 | try 21 | { 22 | // 加载classpath目录下的vm文件 23 | p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); 24 | // 定义字符集 25 | p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); 26 | // 初始化Velocity引擎,指定配置Properties 27 | Velocity.init(p); 28 | } 29 | catch (Exception e) 30 | { 31 | throw new RuntimeException(e); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/logininfor/mapper/LogininforMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.logininfor.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.logininfor.domain.Logininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface LogininforMapper 12 | { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(Logininfor logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(Logininfor logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(String[] ids); 35 | 36 | /** 37 | * 清空系统登录日志 38 | * 39 | * @return 结果 40 | */ 41 | public int cleanLogininfor(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/templates/error/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 500 7 | 8 | 9 | 10 | 11 | 12 |
13 |

500

14 |

内部服务器错误!

15 | 16 |
17 | 服务器遇到意外事件,不允许完成请求。我们抱歉。您可以返回主页面。 18 | 主页 19 |
20 |
21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.ruoyi.common.utils.sql.SqlUtil; 5 | import com.ruoyi.framework.web.page.PageDomain; 6 | import com.ruoyi.framework.web.page.TableSupport; 7 | 8 | /** 9 | * 分页工具类 10 | * 11 | * @author ruoyi 12 | */ 13 | public class PageUtils extends PageHelper 14 | { 15 | /** 16 | * 设置请求分页数据 17 | */ 18 | public static void startPage() 19 | { 20 | PageDomain pageDomain = TableSupport.buildPageRequest(); 21 | Integer pageNum = pageDomain.getPageNum(); 22 | Integer pageSize = pageDomain.getPageSize(); 23 | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); 24 | Boolean reasonable = pageDomain.getReasonable(); 25 | PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); 26 | } 27 | 28 | /** 29 | * 清理分页的线程变量 30 | */ 31 | public static void clearPage() 32 | { 33 | PageHelper.clearPage(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/role/mapper/RoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.role.domain.RoleDept; 5 | 6 | /** 7 | * 角色与部门关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface RoleDeptMapper 12 | { 13 | /** 14 | * 通过角色ID删除角色和部门关联 15 | * 16 | * @param roleId 角色ID 17 | * @return 结果 18 | */ 19 | public int deleteRoleDeptByRoleId(Long roleId); 20 | 21 | /** 22 | * 批量删除角色部门关联信息 23 | * 24 | * @param ids 需要删除的数据ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleDept(Long[] ids); 28 | 29 | /** 30 | * 查询部门使用数量 31 | * 32 | * @param deptId 部门ID 33 | * @return 结果 34 | */ 35 | public int selectCountRoleDeptByDeptId(Long deptId); 36 | 37 | /** 38 | * 批量新增角色部门信息 39 | * 40 | * @param roleDeptList 角色部门列表 41 | * @return 结果 42 | */ 43 | public int batchRoleDept(List roleDeptList); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/mapper/UserPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.user.domain.UserPost; 5 | 6 | /** 7 | * 用户与岗位关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface UserPostMapper 12 | { 13 | /** 14 | * 通过用户ID删除用户和岗位关联 15 | * 16 | * @param userId 用户ID 17 | * @return 结果 18 | */ 19 | public int deleteUserPostByUserId(Long userId); 20 | 21 | /** 22 | * 通过岗位ID查询岗位使用数量 23 | * 24 | * @param postId 岗位ID 25 | * @return 结果 26 | */ 27 | public int countUserPostById(Long postId); 28 | 29 | /** 30 | * 批量删除用户和岗位关联 31 | * 32 | * @param ids 需要删除的数据ID 33 | * @return 结果 34 | */ 35 | public int deleteUserPost(Long[] ids); 36 | 37 | /** 38 | * 批量新增用户岗位信息 39 | * 40 | * @param userPostList 用户岗位列表 41 | * @return 结果 42 | */ 43 | public int batchUserPost(List userPostList); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/templates/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 404 7 | 8 | 9 | 10 | 11 | 12 |
13 |

404

14 |

找不到网页!

15 |
16 | 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。 17 | 主页 18 |
19 |
20 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/templates/error/unauth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 403 7 | 8 | 9 | 10 | 11 | 12 |
13 |

403

14 |

您没有访问权限!

15 | 16 |
17 | 对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面 18 | 返回主页 19 |
20 |
21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.uuid; 2 | 3 | /** 4 | * ID生成器工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class IdUtils 9 | { 10 | /** 11 | * 获取随机UUID 12 | * 13 | * @return 随机UUID 14 | */ 15 | public static String randomUUID() 16 | { 17 | return UUID.randomUUID().toString(); 18 | } 19 | 20 | /** 21 | * 简化的UUID,去掉了横线 22 | * 23 | * @return 简化的UUID,去掉了横线 24 | */ 25 | public static String simpleUUID() 26 | { 27 | return UUID.randomUUID().toString(true); 28 | } 29 | 30 | /** 31 | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID 32 | * 33 | * @return 随机UUID 34 | */ 35 | public static String fastUUID() 36 | { 37 | return UUID.fastUUID().toString(); 38 | } 39 | 40 | /** 41 | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID 42 | * 43 | * @return 简化的UUID,去掉了横线 44 | */ 45 | public static String fastSimpleUUID() 46 | { 47 | return UUID.fastUUID().toString(true); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/role/mapper/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.role.domain.RoleMenu; 5 | 6 | /** 7 | * 角色与菜单关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface RoleMenuMapper 12 | { 13 | /** 14 | * 通过角色ID删除角色和菜单关联 15 | * 16 | * @param roleId 角色ID 17 | * @return 结果 18 | */ 19 | public int deleteRoleMenuByRoleId(Long roleId); 20 | 21 | /** 22 | * 批量删除角色菜单关联信息 23 | * 24 | * @param ids 需要删除的数据ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleMenu(Long[] ids); 28 | 29 | /** 30 | * 查询菜单使用数量 31 | * 32 | * @param menuId 菜单ID 33 | * @return 结果 34 | */ 35 | public int selectCountRoleMenuByMenuId(Long menuId); 36 | 37 | /** 38 | * 批量新增角色菜单信息 39 | * 40 | * @param roleMenuList 角色菜单列表 41 | * @return 结果 42 | */ 43 | public int batchRoleMenu(List roleMenuList); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/validate/messages_zh.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Translated default messages for the jQuery validation plugin. 3 | * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) 4 | */ 5 | var icon = " "; 6 | $.extend($.validator.messages, { 7 | required: icon + "必填", 8 | remote: icon + "请修正此字段", 9 | email: icon + "请输入有效的电子邮件", 10 | url: icon + "请输入有效的网址", 11 | date: icon + "请输入有效的日期", 12 | dateISO: icon + "请输入有效的日期 (YYYY-MM-DD)", 13 | number: icon + "请输入有效的数字", 14 | digits: icon + "只能输入数字", 15 | creditcard: icon + "请输入有效的信用卡号码", 16 | equalTo: icon + "你的输入不相同", 17 | extension: icon + "请输入有效的后缀", 18 | maxlength: $.validator.format(icon + "最多可以输入 {0} 个字符"), 19 | minlength: $.validator.format(icon + "最少要输入 {0} 个字符"), 20 | rangelength: $.validator.format(icon + "请输入长度在 {0} 到 {1} 之间的字符串"), 21 | range: $.validator.format(icon + "请输入范围在 {0} 到 {1} 之间的数值"), 22 | step: $.validator.format(icon + "请输入 {0} 的整数倍值" ), 23 | max: $.validator.format(icon + "请输入不大于 {0} 的数值"), 24 | min: $.validator.format(icon + "请输入不小于 {0} 的数值") 25 | }); 26 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/server/controller/ServerController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.server.controller; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.ModelMap; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import com.ruoyi.framework.web.controller.BaseController; 9 | import com.ruoyi.project.monitor.server.domain.Server; 10 | 11 | /** 12 | * 服务器监控 13 | * 14 | * @author ruoyi 15 | */ 16 | @Controller 17 | @RequestMapping("/monitor/server") 18 | public class ServerController extends BaseController 19 | { 20 | private String prefix = "monitor/server"; 21 | 22 | @RequiresPermissions("monitor:server:view") 23 | @GetMapping() 24 | public String server(ModelMap mmap) throws Exception 25 | { 26 | Server server = new Server(); 27 | server.copyTo(); 28 | mmap.put("server", server); 29 | return prefix + "/server"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/operlog/service/IOperLogService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.operlog.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.operlog.domain.OperLog; 5 | 6 | /** 7 | * 操作日志 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IOperLogService 12 | { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(OperLog operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(OperLog operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(String ids); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public OperLog selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/domain/UserPost.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和岗位关联 sys_user_post 8 | * 9 | * @author ruoyi 10 | */ 11 | public class UserPost 12 | { 13 | /** 用户ID */ 14 | private Long userId; 15 | /** 岗位ID */ 16 | private Long postId; 17 | 18 | public Long getUserId() 19 | { 20 | return userId; 21 | } 22 | 23 | public void setUserId(Long userId) 24 | { 25 | this.userId = userId; 26 | } 27 | 28 | public Long getPostId() 29 | { 30 | return postId; 31 | } 32 | 33 | public void setPostId(Long postId) 34 | { 35 | this.postId = postId; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 41 | .append("userId", getUserId()) 42 | .append("postId", getPostId()) 43 | .toString(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 RuoYi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/PermissionsAspect.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.aspectj.lang.JoinPoint; 5 | import org.aspectj.lang.annotation.Aspect; 6 | import org.aspectj.lang.annotation.Before; 7 | import org.springframework.stereotype.Component; 8 | import com.ruoyi.common.utils.StringUtils; 9 | import com.ruoyi.framework.context.PermissionContextHolder; 10 | 11 | /** 12 | * 自定义权限拦截器,将权限字符串放到当前请求中以便用于多个角色匹配符合要求的权限 13 | * 14 | * @author ruoyi 15 | */ 16 | @Aspect 17 | @Component 18 | public class PermissionsAspect 19 | { 20 | @Before("@annotation(controllerRequiresPermissions)") 21 | public void doBefore(JoinPoint point, RequiresPermissions controllerRequiresPermissions) throws Throwable 22 | { 23 | handleRequiresPermissions(point, controllerRequiresPermissions); 24 | } 25 | 26 | protected void handleRequiresPermissions(final JoinPoint joinPoint, RequiresPermissions requiresPermissions) 27 | { 28 | PermissionContextHolder.setContext(StringUtils.join(requiresPermissions.value(), ",")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/operlog/mapper/OperLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.operlog.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.operlog.domain.OperLog; 5 | 6 | /** 7 | * 操作日志 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface OperLogMapper 12 | { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(OperLog operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(OperLog operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(String[] ids); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public OperLog selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/role/domain/RoleDept.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.role.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和部门关联 sys_role_dept 8 | * 9 | * @author ruoyi 10 | */ 11 | public class RoleDept 12 | { 13 | /** 角色ID */ 14 | private Long roleId; 15 | 16 | /** 部门ID */ 17 | private Long deptId; 18 | 19 | public Long getRoleId() 20 | { 21 | return roleId; 22 | } 23 | 24 | public void setRoleId(Long roleId) 25 | { 26 | this.roleId = roleId; 27 | } 28 | 29 | public Long getDeptId() 30 | { 31 | return deptId; 32 | } 33 | 34 | public void setDeptId(Long deptId) 35 | { 36 | this.deptId = deptId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("roleId", getRoleId()) 43 | .append("deptId", getDeptId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/role/domain/RoleMenu.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.role.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和菜单关联 sys_role_menu 8 | * 9 | * @author ruoyi 10 | */ 11 | public class RoleMenu 12 | { 13 | /** 角色ID */ 14 | private Long roleId; 15 | 16 | /** 菜单ID */ 17 | private Long menuId; 18 | 19 | public Long getRoleId() 20 | { 21 | return roleId; 22 | } 23 | 24 | public void setRoleId(Long roleId) 25 | { 26 | this.roleId = roleId; 27 | } 28 | 29 | public Long getMenuId() 30 | { 31 | return menuId; 32 | } 33 | 34 | public void setMenuId(Long menuId) 35 | { 36 | this.menuId = menuId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("roleId", getRoleId()) 43 | .append("menuId", getMenuId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/domain/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和角色关联 sys_user_role 8 | * 9 | * @author ruoyi 10 | */ 11 | public class UserRole 12 | { 13 | /** 用户ID */ 14 | private Long userId; 15 | 16 | /** 角色ID */ 17 | private Long roleId; 18 | 19 | public Long getUserId() 20 | { 21 | return userId; 22 | } 23 | 24 | public void setUserId(Long userId) 25 | { 26 | this.userId = userId; 27 | } 28 | 29 | public Long getRoleId() 30 | { 31 | return roleId; 32 | } 33 | 34 | public void setRoleId(Long roleId) 35 | { 36 | this.roleId = roleId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("userId", getUserId()) 43 | .append("roleId", getRoleId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/gen/service/IGenTableColumnService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.gen.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.tool.gen.domain.GenTableColumn; 5 | 6 | /** 7 | * 业务字段 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IGenTableColumnService 12 | { 13 | /** 14 | * 查询业务字段列表 15 | * 16 | * @param genTableColumn 业务字段信息 17 | * @return 业务字段集合 18 | */ 19 | public List selectGenTableColumnListByTableId(GenTableColumn genTableColumn); 20 | 21 | /** 22 | * 新增业务字段 23 | * 24 | * @param genTableColumn 业务字段信息 25 | * @return 结果 26 | */ 27 | public int insertGenTableColumn(GenTableColumn genTableColumn); 28 | 29 | /** 30 | * 修改业务字段 31 | * 32 | * @param genTableColumn 业务字段信息 33 | * @return 结果 34 | */ 35 | public int updateGenTableColumn(GenTableColumn genTableColumn); 36 | 37 | /** 38 | * 删除业务字段信息 39 | * 40 | * @param ids 需要删除的数据ID 41 | * @return 结果 42 | */ 43 | public int deleteGenTableColumnByIds(String ids); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/templates/system/notice/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |

[[${notice.noticeTitle}]]

13 |
14 | 发送时间:[[${#dates.format(notice.createTime, 'yyyy-MM-dd HH:mm:ss')}]] 15 | 发件人: [[${notice.createBy}]] 16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/notice/mapper/NoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.notice.mapper; 2 | 3 | import com.ruoyi.project.system.notice.domain.Notice; 4 | import java.util.List; 5 | 6 | /** 7 | * 公告 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface NoticeMapper 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public Notice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(Notice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(Notice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(Notice notice); 44 | 45 | /** 46 | * 批量删除公告 47 | * 48 | * @param noticeIds 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeByIds(String[] noticeIds); 52 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/notice/service/INoticeService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.notice.service; 2 | 3 | import com.ruoyi.project.system.notice.domain.Notice; 4 | import java.util.List; 5 | 6 | /** 7 | * 公告 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface INoticeService 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public Notice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(Notice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(Notice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(Notice notice); 44 | 45 | /** 46 | * 删除公告信息 47 | * 48 | * @param ids 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeByIds(String ids); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/demo/controller/DemoReportController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.demo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * 报表 9 | * 10 | * @author ruoyi 11 | */ 12 | @Controller 13 | @RequestMapping("/demo/report") 14 | public class DemoReportController 15 | { 16 | private String prefix = "demo/report"; 17 | 18 | /** 19 | * 百度ECharts 20 | */ 21 | @GetMapping("/echarts") 22 | public String echarts() 23 | { 24 | return prefix + "/echarts"; 25 | } 26 | 27 | /** 28 | * 图表插件 29 | */ 30 | @GetMapping("/peity") 31 | public String peity() 32 | { 33 | return prefix + "/peity"; 34 | } 35 | 36 | /** 37 | * 线状图插件 38 | */ 39 | @GetMapping("/sparkline") 40 | public String sparkline() 41 | { 42 | return prefix + "/sparkline"; 43 | } 44 | 45 | /** 46 | * 图表组合 47 | */ 48 | @GetMapping("/metrics") 49 | public String metrics() 50 | { 51 | return prefix + "/metrics"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.datasource; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * 数据源切换处理 8 | * 9 | * @author ruoyi 10 | */ 11 | public class DynamicDataSourceContextHolder 12 | { 13 | public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); 14 | 15 | /** 16 | * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, 17 | * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 18 | */ 19 | private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); 20 | 21 | /** 22 | * 设置数据源的变量 23 | */ 24 | public static void setDataSourceType(String dsType) 25 | { 26 | log.info("切换到{}数据源", dsType); 27 | CONTEXT_HOLDER.set(dsType); 28 | } 29 | 30 | /** 31 | * 获得数据源的变量 32 | */ 33 | public static String getDataSourceType() 34 | { 35 | return CONTEXT_HOLDER.get(); 36 | } 37 | 38 | /** 39 | * 清空数据源变量 40 | */ 41 | public static void clearDataSourceType() 42 | { 43 | CONTEXT_HOLDER.remove(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/xss/XssHttpServletRequestWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.xss; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletRequestWrapper; 5 | import com.ruoyi.common.utils.html.EscapeUtil; 6 | 7 | /** 8 | * XSS过滤处理 9 | * 10 | * @author ruoyi 11 | */ 12 | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper 13 | { 14 | /** 15 | * @param request 16 | */ 17 | public XssHttpServletRequestWrapper(HttpServletRequest request) 18 | { 19 | super(request); 20 | } 21 | 22 | @Override 23 | public String[] getParameterValues(String name) 24 | { 25 | String[] values = super.getParameterValues(name); 26 | if (values != null) 27 | { 28 | int length = values.length; 29 | String[] escapseValues = new String[length]; 30 | for (int i = 0; i < length; i++) 31 | { 32 | // 防xss攻击和过滤前后空格 33 | escapseValues[i] = EscapeUtil.clean(values[i]).trim(); 34 | } 35 | return escapseValues; 36 | } 37 | return super.getParameterValues(name); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/constant/ScheduleConstants.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.constant; 2 | 3 | /** 4 | * 任务调度通用常量 5 | * 6 | * @author ruoyi 7 | */ 8 | public class ScheduleConstants 9 | { 10 | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; 11 | 12 | /** 执行目标key */ 13 | public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; 14 | 15 | /** 默认 */ 16 | public static final String MISFIRE_DEFAULT = "0"; 17 | 18 | /** 立即触发执行 */ 19 | public static final String MISFIRE_IGNORE_MISFIRES = "1"; 20 | 21 | /** 触发一次执行 */ 22 | public static final String MISFIRE_FIRE_AND_PROCEED = "2"; 23 | 24 | /** 不触发立即执行 */ 25 | public static final String MISFIRE_DO_NOTHING = "3"; 26 | 27 | public enum Status 28 | { 29 | /** 30 | * 正常 31 | */ 32 | NORMAL("0"), 33 | /** 34 | * 暂停 35 | */ 36 | PAUSE("1"); 37 | 38 | private String value; 39 | 40 | private Status(String value) 41 | { 42 | this.value = value; 43 | } 44 | 45 | public String getValue() 46 | { 47 | return value; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | /** 4 | * 脱敏工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class DesensitizedUtil 9 | { 10 | /** 11 | * 密码的全部字符都用*代替,比如:****** 12 | * 13 | * @param password 密码 14 | * @return 脱敏后的密码 15 | */ 16 | public static String password(String password) 17 | { 18 | if (StringUtils.isBlank(password)) 19 | { 20 | return StringUtils.EMPTY; 21 | } 22 | return StringUtils.repeat('*', password.length()); 23 | } 24 | 25 | /** 26 | * 车牌中间用*代替,如果是错误的车牌,不处理 27 | * 28 | * @param carLicense 完整的车牌号 29 | * @return 脱敏后的车牌 30 | */ 31 | public static String carLicense(String carLicense) 32 | { 33 | if (StringUtils.isBlank(carLicense)) 34 | { 35 | return StringUtils.EMPTY; 36 | } 37 | // 普通车牌 38 | if (carLicense.length() == 7) 39 | { 40 | carLicense = StringUtils.hide(carLicense, 3, 6); 41 | } 42 | else if (carLicense.length() == 8) 43 | { 44 | // 新能源车牌 45 | carLicense = StringUtils.hide(carLicense, 3, 7); 46 | } 47 | return carLicense; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/xss/XssValidator.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.xss; 2 | 3 | import com.ruoyi.common.utils.StringUtils; 4 | import javax.validation.ConstraintValidator; 5 | import javax.validation.ConstraintValidatorContext; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | /** 10 | * 自定义xss校验注解实现 11 | * 12 | * @author ruoyi 13 | */ 14 | public class XssValidator implements ConstraintValidator 15 | { 16 | private static final String HTML_PATTERN = "<(\\S*?)[^>]*>.*?|<.*? />"; 17 | 18 | @Override 19 | public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) 20 | { 21 | if (StringUtils.isBlank(value)) 22 | { 23 | return true; 24 | } 25 | return !containsHtml(value); 26 | } 27 | 28 | public static boolean containsHtml(String value) 29 | { 30 | StringBuilder sHtml = new StringBuilder(); 31 | Pattern pattern = Pattern.compile(HTML_PATTERN); 32 | Matcher matcher = pattern.matcher(value); 33 | while (matcher.find()) 34 | { 35 | sHtml.append(matcher.group()); 36 | } 37 | return pattern.matcher(sHtml).matches(); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/online/mapper/UserOnlineMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.online.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.online.domain.UserOnline; 5 | 6 | /** 7 | * 在线用户 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface UserOnlineMapper 12 | { 13 | /** 14 | * 通过会话序号查询信息 15 | * 16 | * @param sessionId 会话ID 17 | * @return 在线用户信息 18 | */ 19 | public UserOnline selectOnlineById(String sessionId); 20 | 21 | /** 22 | * 通过会话序号删除信息 23 | * 24 | * @param sessionId 会话ID 25 | * @return 在线用户信息 26 | */ 27 | public int deleteOnlineById(String sessionId); 28 | 29 | /** 30 | * 保存会话信息 31 | * 32 | * @param online 会话信息 33 | * @return 结果 34 | */ 35 | public int saveOnline(UserOnline online); 36 | 37 | /** 38 | * 查询会话集合 39 | * 40 | * @param userOnline 会话参数 41 | * @return 会话集合 42 | */ 43 | public List selectUserOnlineList(UserOnline userOnline); 44 | 45 | /** 46 | * 查询过期会话集合 47 | * 48 | * @param lastAccessTime 过期时间 49 | * @return 会话集合 50 | */ 51 | public List selectOnlineByExpired(String lastAccessTime); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/resources/mybatis/system/UserPostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_user_post where user_id=#{userId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_user_post where user_id in 22 | 23 | #{userId} 24 | 25 | 26 | 27 | 28 | insert into sys_user_post(user_id, post_id) values 29 | 30 | (#{item.userId},#{item.postId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/server/domain/Mem.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.server.domain; 2 | 3 | import com.ruoyi.common.utils.Arith; 4 | 5 | /** 6 | * 內存相关信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Mem 11 | { 12 | /** 13 | * 内存总量 14 | */ 15 | private double total; 16 | 17 | /** 18 | * 已用内存 19 | */ 20 | private double used; 21 | 22 | /** 23 | * 剩余内存 24 | */ 25 | private double free; 26 | 27 | public double getTotal() 28 | { 29 | return Arith.div(total, (1024 * 1024 * 1024), 2); 30 | } 31 | 32 | public void setTotal(long total) 33 | { 34 | this.total = total; 35 | } 36 | 37 | public double getUsed() 38 | { 39 | return Arith.div(used, (1024 * 1024 * 1024), 2); 40 | } 41 | 42 | public void setUsed(long used) 43 | { 44 | this.used = used; 45 | } 46 | 47 | public double getFree() 48 | { 49 | return Arith.div(free, (1024 * 1024 * 1024), 2); 50 | } 51 | 52 | public void setFree(long free) 53 | { 54 | this.free = free; 55 | } 56 | 57 | public double getUsage() 58 | { 59 | return Arith.mul(Arith.div(used, total, 4), 100); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/RuoYiApplication.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 6 | 7 | /** 8 | * 启动程序 9 | * 10 | * @author ruoyi 11 | */ 12 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) 13 | public class RuoYiApplication 14 | { 15 | public static void main(String[] args) 16 | { 17 | // System.setProperty("spring.devtools.restart.enabled", "false"); 18 | SpringApplication.run(RuoYiApplication.class, args); 19 | System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + 20 | " .-------. ____ __ \n" + 21 | " | _ _ \\ \\ \\ / / \n" + 22 | " | ( ' ) | \\ _. / ' \n" + 23 | " |(_ o _) / _( )_ .' \n" + 24 | " | (_,_).' __ ___(_ o _)' \n" + 25 | " | |\\ \\ | || |(_,_)' \n" + 26 | " | | \\ `' /| `-' / \n" + 27 | " | | \\ / \\ / \n" + 28 | " ''-' `'-' `-..-' "); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/resources/mybatis/system/RoleDeptMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_role_dept where role_id=#{roleId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_role_dept where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_dept(role_id, dept_id) values 29 | 30 | (#{item.roleId},#{item.deptId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/mybatis/system/RoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_role_menu where role_id=#{roleId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_role_menu where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_menu(role_id, menu_id) values 29 | 30 | (#{item.roleId},#{item.menuId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/static/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | #错误消息 2 | not.null=* 必须填写 3 | user.jcaptcha.error=验证码错误 4 | user.not.exists=用户不存在/密码错误 5 | user.password.not.match=用户不存在/密码错误 6 | user.password.retry.limit.count=密码输入错误{0}次 7 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 8 | user.password.delete=对不起,您的账号已被删除 9 | user.blocked=用户已封禁,请联系管理员 10 | role.blocked=角色已封禁,请联系管理员 11 | login.blocked=很遗憾,访问IP已被列入系统黑名单 12 | user.logout.success=退出成功 13 | 14 | length.not.valid=长度必须在{min}到{max}个字符之间 15 | 16 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 17 | user.password.not.valid=* 5-50个字符 18 | 19 | user.email.not.valid=邮箱格式错误 20 | user.mobile.phone.number.not.valid=手机号格式错误 21 | user.login.success=登录成功 22 | user.register.success=注册成功 23 | user.notfound=请重新登录 24 | user.forcelogout=管理员强制退出,请重新登录 25 | user.unknown.error=未知错误,请重新登录 26 | 27 | ##文件上传消息 28 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 29 | upload.filename.exceed.length=上传的文件名最长{0}个字符 30 | 31 | ##权限 32 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 33 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 34 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 35 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 36 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 37 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 38 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/GlobalException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception; 2 | 3 | /** 4 | * 全局异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class GlobalException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | /** 13 | * 错误提示 14 | */ 15 | private String message; 16 | 17 | /** 18 | * 错误明细,内部调试错误 19 | * 20 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 21 | */ 22 | private String detailMessage; 23 | 24 | /** 25 | * 空构造方法,避免反序列化问题 26 | */ 27 | public GlobalException() 28 | { 29 | } 30 | 31 | public GlobalException(String message) 32 | { 33 | this.message = message; 34 | } 35 | 36 | public String getDetailMessage() 37 | { 38 | return detailMessage; 39 | } 40 | 41 | public GlobalException setDetailMessage(String detailMessage) 42 | { 43 | this.detailMessage = detailMessage; 44 | return this; 45 | } 46 | 47 | @Override 48 | public String getMessage() 49 | { 50 | return message; 51 | } 52 | 53 | public GlobalException setMessage(String message) 54 | { 55 | this.message = message; 56 | return this; 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/job/service/IJobLogService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.job.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.job.domain.JobLog; 5 | 6 | /** 7 | * 定时任务调度日志信息信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IJobLogService 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(JobLog jobLog); 20 | 21 | /** 22 | * 通过调度任务日志ID查询调度信息 23 | * 24 | * @param jobLogId 调度任务日志ID 25 | * @return 调度任务日志对象信息 26 | */ 27 | public JobLog selectJobLogById(Long jobLogId); 28 | 29 | /** 30 | * 新增任务日志 31 | * 32 | * @param jobLog 调度日志信息 33 | */ 34 | public void addJobLog(JobLog jobLog); 35 | 36 | /** 37 | * 批量删除调度日志信息 38 | * 39 | * @param ids 需要删除的数据ID 40 | * @return 结果 41 | */ 42 | public int deleteJobLogByIds(String ids); 43 | 44 | /** 45 | * 删除任务日志 46 | * 47 | * @param jobId 调度日志ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogById(Long jobId); 51 | 52 | /** 53 | * 清空任务日志 54 | */ 55 | public void cleanJobLog(); 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception; 2 | 3 | /** 4 | * 业务异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public final class ServiceException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | /** 13 | * 错误提示 14 | */ 15 | private String message; 16 | 17 | /** 18 | * 错误明细,内部调试错误 19 | * 20 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 21 | */ 22 | private String detailMessage; 23 | 24 | /** 25 | * 空构造方法,避免反序列化问题 26 | */ 27 | public ServiceException() 28 | { 29 | } 30 | 31 | public ServiceException(String message) 32 | { 33 | this.message = message; 34 | } 35 | 36 | public String getDetailMessage() 37 | { 38 | return detailMessage; 39 | } 40 | 41 | public ServiceException setDetailMessage(String detailMessage) 42 | { 43 | this.detailMessage = detailMessage; 44 | return this; 45 | } 46 | 47 | @Override 48 | public String getMessage() 49 | { 50 | return message; 51 | } 52 | 53 | public ServiceException setMessage(String message) 54 | { 55 | this.message = message; 56 | return this; 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/domain/CxSelect.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.domain; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * CxSelect树结构实体类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class CxSelect implements Serializable 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 16 | * 数据值字段名称 17 | */ 18 | private String v; 19 | 20 | /** 21 | * 数据标题字段名称 22 | */ 23 | private String n; 24 | 25 | /** 26 | * 子集数据字段名称 27 | */ 28 | private List s; 29 | 30 | public CxSelect() 31 | { 32 | } 33 | 34 | public CxSelect(String v, String n) 35 | { 36 | this.v = v; 37 | this.n = n; 38 | } 39 | 40 | public List getS() 41 | { 42 | return s; 43 | } 44 | 45 | public void setN(String n) 46 | { 47 | this.n = n; 48 | } 49 | 50 | public String getN() 51 | { 52 | return n; 53 | } 54 | 55 | public void setS(List s) 56 | { 57 | this.s = s; 58 | } 59 | 60 | public String getV() 61 | { 62 | return v; 63 | } 64 | 65 | public void setV(String v) 66 | { 67 | this.v = v; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/service/DictService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.ruoyi.project.system.dict.domain.DictData; 7 | import com.ruoyi.project.system.dict.service.IDictDataService; 8 | import com.ruoyi.project.system.dict.service.IDictTypeService; 9 | 10 | /** 11 | * RuoYi首创 html调用 thymeleaf 实现字典读取 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service("dict") 16 | public class DictService 17 | { 18 | @Autowired 19 | private IDictTypeService dictTypeService; 20 | 21 | @Autowired 22 | private IDictDataService dictDataService; 23 | 24 | /** 25 | * 根据字典类型查询字典数据信息 26 | * 27 | * @param dictType 字典类型 28 | * @return 参数键值 29 | */ 30 | public List getType(String dictType) 31 | { 32 | return dictTypeService.selectDictDataByType(dictType); 33 | } 34 | 35 | /** 36 | * 根据字典类型和字典键值查询字典数据信息 37 | * 38 | * @param dictType 字典类型 39 | * @param dictValue 字典键值 40 | * @return 字典标签 41 | */ 42 | public String getLabel(String dictType, String dictValue) 43 | { 44 | return dictDataService.selectDictLabel(dictType, dictValue); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; 9 | import com.ruoyi.framework.aspectj.lang.enums.OperatorType; 10 | 11 | /** 12 | * 自定义操作日志记录注解 13 | * 14 | * @author ruoyi 15 | * 16 | */ 17 | @Target({ ElementType.PARAMETER, ElementType.METHOD }) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Documented 20 | public @interface Log 21 | { 22 | /** 23 | * 模块 24 | */ 25 | public String title() default ""; 26 | 27 | /** 28 | * 功能 29 | */ 30 | public BusinessType businessType() default BusinessType.OTHER; 31 | 32 | /** 33 | * 操作人类别 34 | */ 35 | public OperatorType operatorType() default OperatorType.MANAGE; 36 | 37 | /** 38 | * 是否保存请求的参数 39 | */ 40 | public boolean isSaveRequestData() default true; 41 | 42 | /** 43 | * 是否保存响应的参数 44 | */ 45 | public boolean isSaveResponseData() default true; 46 | 47 | /** 48 | * 排除指定的请求参数 49 | */ 50 | public String[] excludeParamNames() default {}; 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import com.ruoyi.common.utils.Threads; 7 | import com.ruoyi.common.utils.spring.SpringUtils; 8 | 9 | /** 10 | * 异步任务管理器 11 | * 12 | * @author liuhulu 13 | */ 14 | public class AsyncManager 15 | { 16 | /** 17 | * 操作延迟10毫秒 18 | */ 19 | private final int OPERATE_DELAY_TIME = 10; 20 | 21 | /** 22 | * 异步操作任务调度线程池 23 | */ 24 | private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); 25 | 26 | /** 27 | * 单例模式 28 | */ 29 | private AsyncManager() 30 | { 31 | } 32 | 33 | private static AsyncManager me = new AsyncManager(); 34 | 35 | public static AsyncManager me() 36 | { 37 | return me; 38 | } 39 | 40 | /** 41 | * 执行任务 42 | * 43 | * @param task 任务 44 | */ 45 | public void execute(TimerTask task) 46 | { 47 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 48 | } 49 | 50 | /** 51 | * 停止任务线程池 52 | */ 53 | public void shutdown() 54 | { 55 | Threads.shutdownAndAwaitTermination(executor); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.domain; 2 | 3 | /** 4 | * Tree基类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class TreeEntity extends BaseEntity 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | /** 父菜单名称 */ 13 | private String parentName; 14 | 15 | /** 父菜单ID */ 16 | private Long parentId; 17 | 18 | /** 显示顺序 */ 19 | private Integer orderNum; 20 | 21 | /** 祖级列表 */ 22 | private String ancestors; 23 | 24 | public String getParentName() 25 | { 26 | return parentName; 27 | } 28 | 29 | public void setParentName(String parentName) 30 | { 31 | this.parentName = parentName; 32 | } 33 | 34 | public Long getParentId() 35 | { 36 | return parentId; 37 | } 38 | 39 | public void setParentId(Long parentId) 40 | { 41 | this.parentId = parentId; 42 | } 43 | 44 | public Integer getOrderNum() 45 | { 46 | return orderNum; 47 | } 48 | 49 | public void setOrderNum(Integer orderNum) 50 | { 51 | this.orderNum = orderNum; 52 | } 53 | 54 | public String getAncestors() 55 | { 56 | return ancestors; 57 | } 58 | 59 | public void setAncestors(String ancestors) 60 | { 61 | this.ancestors = ancestors; 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jsonview/jquery.jsonview.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | .jsonview { 3 | font-family: monospace; 4 | font-size: 1.1em; 5 | white-space: pre-wrap; } 6 | .jsonview .prop { 7 | font-weight: bold; } 8 | .jsonview .null { 9 | color: red; } 10 | .jsonview .bool { 11 | color: blue; } 12 | .jsonview .num { 13 | color: blue; } 14 | .jsonview .string { 15 | color: green; 16 | white-space: pre-wrap; } 17 | .jsonview .string.multiline { 18 | display: inline-block; 19 | vertical-align: text-top; } 20 | .jsonview .collapser { 21 | position: absolute; 22 | left: -1em; 23 | cursor: pointer; } 24 | .jsonview .collapsible { 25 | transition: height 1.2s; 26 | transition: width 1.2s; } 27 | .jsonview .collapsible.collapsed { 28 | height: .8em; 29 | width: 1em; 30 | display: inline-block; 31 | overflow: hidden; 32 | margin: 0; } 33 | .jsonview .collapsible.collapsed:before { 34 | content: "…"; 35 | width: 1em; 36 | margin-left: .2em; } 37 | .jsonview .collapser.collapsed { 38 | transform: rotate(0deg); } 39 | .jsonview .q { 40 | display: inline-block; 41 | width: 0px; 42 | color: transparent; } 43 | .jsonview li { 44 | position: relative; } 45 | .jsonview ul { 46 | list-style: none; 47 | margin: 0 0 0 2em; 48 | padding: 0; } 49 | .jsonview h1 { 50 | font-size: 1.2em; } 51 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/exception/file/FileUploadException.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.exception.file; 2 | 3 | import java.io.PrintStream; 4 | import java.io.PrintWriter; 5 | 6 | /** 7 | * 文件上传异常类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class FileUploadException extends Exception 12 | { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | private final Throwable cause; 17 | 18 | public FileUploadException() 19 | { 20 | this(null, null); 21 | } 22 | 23 | public FileUploadException(final String msg) 24 | { 25 | this(msg, null); 26 | } 27 | 28 | public FileUploadException(String msg, Throwable cause) 29 | { 30 | super(msg); 31 | this.cause = cause; 32 | } 33 | 34 | @Override 35 | public void printStackTrace(PrintStream stream) 36 | { 37 | super.printStackTrace(stream); 38 | if (cause != null) 39 | { 40 | stream.println("Caused by:"); 41 | cause.printStackTrace(stream); 42 | } 43 | } 44 | 45 | @Override 46 | public void printStackTrace(PrintWriter writer) 47 | { 48 | super.printStackTrace(writer); 49 | if (cause != null) 50 | { 51 | writer.println("Caused by:"); 52 | cause.printStackTrace(writer); 53 | } 54 | } 55 | 56 | @Override 57 | public Throwable getCause() 58 | { 59 | return cause; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/job/mapper/JobMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.job.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.job.domain.Job; 5 | 6 | /** 7 | * 调度任务信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface JobMapper 12 | { 13 | /** 14 | * 查询调度任务日志集合 15 | * 16 | * @param job 调度信息 17 | * @return 操作日志集合 18 | */ 19 | public List selectJobList(Job job); 20 | 21 | /** 22 | * 查询所有调度任务 23 | * 24 | * @return 调度任务列表 25 | */ 26 | public List selectJobAll(); 27 | 28 | /** 29 | * 通过调度ID查询调度任务信息 30 | * 31 | * @param jobId 调度ID 32 | * @return 角色对象信息 33 | */ 34 | public Job selectJobById(Long jobId); 35 | 36 | /** 37 | * 通过调度ID删除调度任务信息 38 | * 39 | * @param jobId 调度ID 40 | * @return 结果 41 | */ 42 | public int deleteJobById(Long jobId); 43 | 44 | /** 45 | * 批量删除调度任务信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobByIds(Long[] ids); 51 | 52 | /** 53 | * 修改调度任务信息 54 | * 55 | * @param job 调度任务信息 56 | * @return 结果 57 | */ 58 | public int updateJob(Job job); 59 | 60 | /** 61 | * 新增调度任务信息 62 | * 63 | * @param job 调度任务信息 64 | * @return 结果 65 | */ 66 | public int insertJob(Job job); 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/job/mapper/JobLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.job.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.monitor.job.domain.JobLog; 5 | 6 | /** 7 | * 调度任务日志信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface JobLogMapper 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(JobLog jobLog); 20 | 21 | /** 22 | * 查询所有调度任务日志 23 | * 24 | * @return 调度任务日志列表 25 | */ 26 | public List selectJobLogAll(); 27 | 28 | /** 29 | * 通过调度任务日志ID查询调度信息 30 | * 31 | * @param jobLogId 调度任务日志ID 32 | * @return 调度任务日志对象信息 33 | */ 34 | public JobLog selectJobLogById(Long jobLogId); 35 | 36 | /** 37 | * 新增任务日志 38 | * 39 | * @param jobLog 调度日志信息 40 | * @return 结果 41 | */ 42 | public int insertJobLog(JobLog jobLog); 43 | 44 | /** 45 | * 批量删除调度日志信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogByIds(String[] ids); 51 | 52 | /** 53 | * 删除任务日志 54 | * 55 | * @param jobId 调度日志ID 56 | * @return 结果 57 | */ 58 | public int deleteJobLogById(Long jobId); 59 | 60 | /** 61 | * 清空任务日志 62 | */ 63 | public void cleanJobLog(); 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/dict/service/IDictDataService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.dict.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.dict.domain.DictData; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IDictDataService 12 | { 13 | /** 14 | * 根据条件分页查询字典数据 15 | * 16 | * @param dictData 字典数据信息 17 | * @return 字典数据集合信息 18 | */ 19 | public List selectDictDataList(DictData dictData); 20 | 21 | /** 22 | * 根据字典类型和字典键值查询字典数据信息 23 | * 24 | * @param dictType 字典类型 25 | * @param dictValue 字典键值 26 | * @return 字典标签 27 | */ 28 | public String selectDictLabel(String dictType, String dictValue); 29 | 30 | /** 31 | * 根据字典数据ID查询信息 32 | * 33 | * @param dictCode 字典数据ID 34 | * @return 字典数据 35 | */ 36 | public DictData selectDictDataById(Long dictCode); 37 | 38 | /** 39 | * 批量删除字典数据 40 | * 41 | * @param ids 需要删除的数据 42 | */ 43 | public void deleteDictDataByIds(String ids); 44 | 45 | /** 46 | * 新增保存字典数据信息 47 | * 48 | * @param dictData 字典数据信息 49 | * @return 结果 50 | */ 51 | public int insertDictData(DictData dictData); 52 | 53 | /** 54 | * 修改保存字典数据信息 55 | * 56 | * @param dictData 字典数据信息 57 | * @return 结果 58 | */ 59 | public int updateDictData(DictData dictData); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/I18nConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.LocaleResolver; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; 9 | import org.springframework.web.servlet.i18n.SessionLocaleResolver; 10 | import com.ruoyi.common.constant.Constants; 11 | 12 | /** 13 | * 资源文件配置加载 14 | * 15 | * @author ruoyi 16 | */ 17 | @Configuration 18 | public class I18nConfig implements WebMvcConfigurer 19 | { 20 | @Bean 21 | public LocaleResolver localeResolver() 22 | { 23 | SessionLocaleResolver slr = new SessionLocaleResolver(); 24 | // 默认语言 25 | slr.setDefaultLocale(Constants.DEFAULT_LOCALE); 26 | return slr; 27 | } 28 | 29 | @Bean 30 | public LocaleChangeInterceptor localeChangeInterceptor() 31 | { 32 | LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); 33 | // 参数名 34 | lci.setParamName("lang"); 35 | return lci; 36 | } 37 | 38 | @Override 39 | public void addInterceptors(InterceptorRegistry registry) 40 | { 41 | registry.addInterceptor(localeChangeInterceptor()); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/shiro/web/filter/sync/SyncOnlineSessionFilter.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.shiro.web.filter.sync; 2 | 3 | import javax.servlet.ServletRequest; 4 | import javax.servlet.ServletResponse; 5 | import org.apache.shiro.web.filter.PathMatchingFilter; 6 | import com.ruoyi.common.constant.ShiroConstants; 7 | import com.ruoyi.framework.shiro.session.OnlineSessionDAO; 8 | import com.ruoyi.project.monitor.online.domain.OnlineSession; 9 | 10 | /** 11 | * 同步Session数据到Db 12 | * 13 | * @author ruoyi 14 | */ 15 | public class SyncOnlineSessionFilter extends PathMatchingFilter 16 | { 17 | private OnlineSessionDAO onlineSessionDAO; 18 | 19 | /** 20 | * 同步会话数据到DB 一次请求最多同步一次 防止过多处理 需要放到Shiro过滤器之前 21 | */ 22 | @Override 23 | protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception 24 | { 25 | OnlineSession session = (OnlineSession) request.getAttribute(ShiroConstants.ONLINE_SESSION); 26 | // 如果session stop了 也不同步 27 | // session停止时间,如果stopTimestamp不为null,则代表已停止 28 | if (session != null && session.getUserId() != null && session.getStopTimestamp() == null) 29 | { 30 | onlineSessionDAO.syncToDb(session); 31 | } 32 | return true; 33 | } 34 | 35 | public void setOnlineSessionDAO(OnlineSessionDAO onlineSessionDAO) 36 | { 37 | this.onlineSessionDAO = onlineSessionDAO; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/aspectj/lang/enums/DesensitizedType.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.aspectj.lang.enums; 2 | 3 | import java.util.function.Function; 4 | import com.ruoyi.common.utils.DesensitizedUtil; 5 | 6 | /** 7 | * 脱敏类型 8 | * 9 | * @author ruoyi 10 | */ 11 | public enum DesensitizedType 12 | { 13 | /** 14 | * 姓名,第2位星号替换 15 | */ 16 | USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")), 17 | 18 | /** 19 | * 密码,全部字符都用*代替 20 | */ 21 | PASSWORD(DesensitizedUtil::password), 22 | 23 | /** 24 | * 身份证,中间10位星号替换 25 | */ 26 | ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")), 27 | 28 | /** 29 | * 手机号,中间4位星号替换 30 | */ 31 | PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")), 32 | 33 | /** 34 | * 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换 35 | */ 36 | EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")), 37 | 38 | /** 39 | * 银行卡号,保留最后4位,其他星号替换 40 | */ 41 | BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")), 42 | 43 | /** 44 | * 车牌号码,包含普通车辆、新能源车辆 45 | */ 46 | CAR_LICENSE(DesensitizedUtil::carLicense); 47 | 48 | private final Function desensitizer; 49 | 50 | DesensitizedType(Function desensitizer) 51 | { 52 | this.desensitizer = desensitizer; 53 | } 54 | 55 | public Function desensitizer() 56 | { 57 | return desensitizer; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/highlight/default.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * GitHub Gist Theme 3 | * Author : Anthony Attard - https://github.com/AnthonyAttard 4 | * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | background: white; 10 | padding: 0.5em; 11 | color: #333333; 12 | overflow-x: auto; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-meta { 17 | color: #969896; 18 | } 19 | 20 | .hljs-variable, 21 | .hljs-template-variable, 22 | .hljs-strong, 23 | .hljs-emphasis, 24 | .hljs-quote { 25 | color: #df5000; 26 | } 27 | 28 | .hljs-keyword, 29 | .hljs-selector-tag, 30 | .hljs-type { 31 | color: #d73a49; 32 | } 33 | 34 | .hljs-literal, 35 | .hljs-symbol, 36 | .hljs-bullet, 37 | .hljs-attribute { 38 | color: #0086b3; 39 | } 40 | 41 | .hljs-section, 42 | .hljs-name { 43 | color: #63a35c; 44 | } 45 | 46 | .hljs-tag { 47 | color: #333333; 48 | } 49 | 50 | .hljs-title, 51 | .hljs-attr, 52 | .hljs-selector-id, 53 | .hljs-selector-class, 54 | .hljs-selector-attr, 55 | .hljs-selector-pseudo { 56 | color: #6f42c1; 57 | } 58 | 59 | .hljs-addition { 60 | color: #55a532; 61 | background-color: #eaffea; 62 | } 63 | 64 | .hljs-deletion { 65 | color: #bd2c00; 66 | background-color: #ffecec; 67 | } 68 | 69 | .hljs-link { 70 | text-decoration: underline; 71 | } 72 | 73 | .hljs-number { 74 | color: #005cc5; 75 | } 76 | 77 | .hljs-string { 78 | color: #032f62; 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableColumnMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.gen.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.tool.gen.domain.GenTableColumn; 5 | 6 | /** 7 | * 业务字段 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface GenTableColumnMapper 12 | { 13 | /** 14 | * 根据表名称查询列信息 15 | * 16 | * @param tableName 表名称 17 | * @return 列信息 18 | */ 19 | public List selectDbTableColumnsByName(String tableName); 20 | 21 | /** 22 | * 查询业务字段列表 23 | * 24 | * @param genTableColumn 业务字段信息 25 | * @return 业务字段集合 26 | */ 27 | public List selectGenTableColumnListByTableId(GenTableColumn genTableColumn); 28 | 29 | /** 30 | * 新增业务字段 31 | * 32 | * @param genTableColumn 业务字段信息 33 | * @return 结果 34 | */ 35 | public int insertGenTableColumn(GenTableColumn genTableColumn); 36 | 37 | /** 38 | * 修改业务字段 39 | * 40 | * @param genTableColumn 业务字段信息 41 | * @return 结果 42 | */ 43 | public int updateGenTableColumn(GenTableColumn genTableColumn); 44 | 45 | /** 46 | * 删除业务字段 47 | * 48 | * @param genTableColumns 列数据 49 | * @return 结果 50 | */ 51 | public int deleteGenTableColumns(List genTableColumns); 52 | 53 | /** 54 | * 批量删除业务字段 55 | * 56 | * @param ids 需要删除的数据ID 57 | * @return 结果 58 | */ 59 | public int deleteGenTableColumnByIds(Long[] ids); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/page/TableSupport.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.page; 2 | 3 | import com.ruoyi.common.utils.ServletUtils; 4 | import com.ruoyi.common.utils.text.Convert; 5 | 6 | /** 7 | * 表格数据处理 8 | * 9 | * @author ruoyi 10 | */ 11 | public class TableSupport 12 | { 13 | /** 14 | * 当前记录起始索引 15 | */ 16 | public static final String PAGE_NUM = "pageNum"; 17 | 18 | /** 19 | * 每页显示记录数 20 | */ 21 | public static final String PAGE_SIZE = "pageSize"; 22 | 23 | /** 24 | * 排序列 25 | */ 26 | public static final String ORDER_BY_COLUMN = "orderByColumn"; 27 | 28 | /** 29 | * 排序的方向 "desc" 或者 "asc". 30 | */ 31 | public static final String IS_ASC = "isAsc"; 32 | 33 | /** 34 | * 分页参数合理化 35 | */ 36 | public static final String REASONABLE = "reasonable"; 37 | 38 | /** 39 | * 封装分页对象 40 | */ 41 | public static PageDomain getPageDomain() 42 | { 43 | PageDomain pageDomain = new PageDomain(); 44 | pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); 45 | pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); 46 | pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); 47 | pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); 48 | pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); 49 | return pageDomain; 50 | } 51 | 52 | public static PageDomain buildPageRequest() 53 | { 54 | return getPageDomain(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/controller/RegisterController.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | import com.ruoyi.common.utils.StringUtils; 9 | import com.ruoyi.framework.shiro.service.RegisterService; 10 | import com.ruoyi.framework.web.controller.BaseController; 11 | import com.ruoyi.framework.web.domain.AjaxResult; 12 | import com.ruoyi.project.system.config.service.IConfigService; 13 | import com.ruoyi.project.system.user.domain.User; 14 | 15 | /** 16 | * 注册验证 17 | * 18 | * @author ruoyi 19 | */ 20 | @Controller 21 | public class RegisterController extends BaseController 22 | { 23 | @Autowired 24 | private RegisterService registerService; 25 | 26 | @Autowired 27 | private IConfigService configService; 28 | 29 | @GetMapping("/register") 30 | public String register() 31 | { 32 | return "register"; 33 | } 34 | 35 | @PostMapping("/register") 36 | @ResponseBody 37 | public AjaxResult ajaxRegister(User user) 38 | { 39 | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) 40 | { 41 | return error("当前系统没有开启注册功能!"); 42 | } 43 | String msg = registerService.register(user); 44 | return StringUtils.isEmpty(msg) ? success() : error(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/constant/CommonMap.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.constant; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 通用数据库映射Map数据 8 | * 9 | * @author ruoyi 10 | */ 11 | public class CommonMap 12 | { 13 | /** 状态编码转换 */ 14 | public static Map javaTypeMap = new HashMap(); 15 | 16 | static 17 | { 18 | initJavaTypeMap(); 19 | } 20 | 21 | /** 22 | * 返回状态映射 23 | */ 24 | public static void initJavaTypeMap() 25 | { 26 | javaTypeMap.put("tinyint", "Integer"); 27 | javaTypeMap.put("smallint", "Integer"); 28 | javaTypeMap.put("mediumint", "Integer"); 29 | javaTypeMap.put("int", "Integer"); 30 | javaTypeMap.put("number", "Integer"); 31 | javaTypeMap.put("integer", "integer"); 32 | javaTypeMap.put("bigint", "Long"); 33 | javaTypeMap.put("float", "Float"); 34 | javaTypeMap.put("double", "Double"); 35 | javaTypeMap.put("decimal", "BigDecimal"); 36 | javaTypeMap.put("bit", "Boolean"); 37 | javaTypeMap.put("char", "String"); 38 | javaTypeMap.put("varchar", "String"); 39 | javaTypeMap.put("varchar2", "String"); 40 | javaTypeMap.put("tinytext", "String"); 41 | javaTypeMap.put("text", "String"); 42 | javaTypeMap.put("mediumtext", "String"); 43 | javaTypeMap.put("longtext", "String"); 44 | javaTypeMap.put("time", "Date"); 45 | javaTypeMap.put("date", "Date"); 46 | javaTypeMap.put("datetime", "Date"); 47 | javaTypeMap.put("timestamp", "Date"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | Application Version: ${ruoyi.version} 2 | Spring Boot Version: ${spring-boot.version} 3 | //////////////////////////////////////////////////////////////////// 4 | // _ooOoo_ // 5 | // o8888888o // 6 | // 88" . "88 // 7 | // (| ^_^ |) // 8 | // O\ = /O // 9 | // ____/`---'\____ // 10 | // .' \\| |// `. // 11 | // / \\||| : |||// \ // 12 | // / _||||| -:- |||||- \ // 13 | // | | \\\ - /// | | // 14 | // | \_| ''\---/'' | | // 15 | // \ .-\__ `-` ___/-. / // 16 | // ___`. .' /--.--\ `. . ___ // 17 | // ."" '< `.___\_<|>_/___.' >'"". // 18 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // 19 | // \ \ `-. \_ __\ /__ _/ .-` / / // 20 | // ========`-.____`-.___\_____/___.-`____.-'======== // 21 | // `=---=' // 22 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // 23 | // 佛祖保佑 永不宕机 永无BUG // 24 | //////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/main/resources/templates/system/dict/type/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 23 |
24 |
25 | 26 | 27 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.page; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 表格分页数据对象 8 | * 9 | * @author ruoyi 10 | */ 11 | public class TableDataInfo implements Serializable 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 总记录数 */ 16 | private long total; 17 | 18 | /** 列表数据 */ 19 | private List rows; 20 | 21 | /** 消息状态码 */ 22 | private int code; 23 | 24 | /** 消息内容 */ 25 | private String msg; 26 | 27 | /** 28 | * 表格数据对象 29 | */ 30 | public TableDataInfo() 31 | { 32 | } 33 | 34 | /** 35 | * 分页 36 | * 37 | * @param list 列表数据 38 | * @param total 总记录数 39 | */ 40 | public TableDataInfo(List list, long total) 41 | { 42 | this.rows = list; 43 | this.total = total; 44 | } 45 | 46 | public long getTotal() 47 | { 48 | return total; 49 | } 50 | 51 | public void setTotal(long total) 52 | { 53 | this.total = total; 54 | } 55 | 56 | public List getRows() 57 | { 58 | return rows; 59 | } 60 | 61 | public void setRows(List rows) 62 | { 63 | this.rows = rows; 64 | } 65 | 66 | public int getCode() 67 | { 68 | return code; 69 | } 70 | 71 | public void setCode(int code) 72 | { 73 | this.code = code; 74 | } 75 | 76 | public String getMsg() 77 | { 78 | return msg; 79 | } 80 | 81 | public void setMsg(String msg) 82 | { 83 | this.msg = msg; 84 | } 85 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/server/domain/Sys.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.server.domain; 2 | 3 | /** 4 | * 系统相关信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class Sys 9 | { 10 | /** 11 | * 服务器名称 12 | */ 13 | private String computerName; 14 | 15 | /** 16 | * 服务器Ip 17 | */ 18 | private String computerIp; 19 | 20 | /** 21 | * 项目路径 22 | */ 23 | private String userDir; 24 | 25 | /** 26 | * 操作系统 27 | */ 28 | private String osName; 29 | 30 | /** 31 | * 系统架构 32 | */ 33 | private String osArch; 34 | 35 | public String getComputerName() 36 | { 37 | return computerName; 38 | } 39 | 40 | public void setComputerName(String computerName) 41 | { 42 | this.computerName = computerName; 43 | } 44 | 45 | public String getComputerIp() 46 | { 47 | return computerIp; 48 | } 49 | 50 | public void setComputerIp(String computerIp) 51 | { 52 | this.computerIp = computerIp; 53 | } 54 | 55 | public String getUserDir() 56 | { 57 | return userDir; 58 | } 59 | 60 | public void setUserDir(String userDir) 61 | { 62 | this.userDir = userDir; 63 | } 64 | 65 | public String getOsName() 66 | { 67 | return osName; 68 | } 69 | 70 | public void setOsName(String osName) 71 | { 72 | this.osName = osName; 73 | } 74 | 75 | public String getOsArch() 76 | { 77 | return osArch; 78 | } 79 | 80 | public void setOsArch(String osArch) 81 | { 82 | this.osArch = osArch; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Dennis Hernández 3 | * @version: v2.0.0 4 | */ 5 | 6 | const isInit = that => that.$el.data('resizableColumns') !== undefined 7 | 8 | const initResizable = that => { 9 | if ( 10 | that.options.resizable && 11 | !that.options.cardView && 12 | !isInit(that) && 13 | that.$el.is(':visible') 14 | ) { 15 | that.$el.resizableColumns({ 16 | store: window.store 17 | }) 18 | } 19 | } 20 | 21 | const destroy = that => { 22 | if (isInit(that)) { 23 | that.$el.data('resizableColumns').destroy() 24 | } 25 | } 26 | 27 | const reInitResizable = that => { 28 | destroy(that) 29 | initResizable(that) 30 | } 31 | 32 | Object.assign($.fn.bootstrapTable.defaults, { 33 | resizable: false 34 | }) 35 | 36 | $.BootstrapTable = class extends $.BootstrapTable { 37 | 38 | initBody (...args) { 39 | super.initBody(...args) 40 | 41 | this.$el.off('column-switch.bs.table page-change.bs.table') 42 | .on('column-switch.bs.table page-change.bs.table', () => { 43 | reInitResizable(this) 44 | }) 45 | 46 | reInitResizable(this) 47 | } 48 | 49 | toggleView (...args) { 50 | super.toggleView(...args) 51 | 52 | if (this.options.resizable && this.options.cardView) { 53 | // Destroy the plugin 54 | destroy(this) 55 | } 56 | } 57 | 58 | resetView (...args) { 59 | super.resetView(...args) 60 | 61 | if (this.options.resizable) { 62 | // because in fitHeader function, we use setTimeout(func, 100); 63 | setTimeout(() => { 64 | initResizable(this) 65 | }, 100) 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.config.mapper; 2 | 3 | import com.ruoyi.project.system.config.domain.Config; 4 | import java.util.List; 5 | 6 | /** 7 | * 参数配置 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ConfigMapper 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param config 参数配置信息 17 | * @return 参数配置信息 18 | */ 19 | public Config selectConfig(Config config); 20 | 21 | /** 22 | * 通过ID查询配置 23 | * 24 | * @param configId 参数ID 25 | * @return 参数配置信息 26 | */ 27 | public Config selectConfigById(Long configId); 28 | 29 | /** 30 | * 查询参数配置列表 31 | * 32 | * @param config 参数配置信息 33 | * @return 参数配置集合 34 | */ 35 | public List selectConfigList(Config config); 36 | 37 | /** 38 | * 根据键名查询参数配置信息 39 | * 40 | * @param configKey 参数键名 41 | * @return 参数配置信息 42 | */ 43 | public Config checkConfigKeyUnique(String configKey); 44 | 45 | /** 46 | * 新增参数配置 47 | * 48 | * @param config 参数配置信息 49 | * @return 结果 50 | */ 51 | public int insertConfig(Config config); 52 | 53 | /** 54 | * 修改参数配置 55 | * 56 | * @param config 参数配置信息 57 | * @return 结果 58 | */ 59 | public int updateConfig(Config config); 60 | 61 | /** 62 | * 删除参数配置 63 | * 64 | * @param configId 参数主键 65 | * @return 结果 66 | */ 67 | public int deleteConfigById(Long configId); 68 | 69 | /** 70 | * 批量删除参数配置 71 | * 72 | * @param configIds 需要删除的数据ID 73 | * @return 结果 74 | */ 75 | public int deleteConfigByIds(String[] configIds); 76 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/user/mapper/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.user.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.ruoyi.project.system.user.domain.UserRole; 6 | 7 | /** 8 | * 用户与角色关联表 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface UserRoleMapper 13 | { 14 | /** 15 | * 通过用户ID查询用户和角色关联 16 | * 17 | * @param userId 用户ID 18 | * @return 用户和角色关联列表 19 | */ 20 | public List selectUserRoleByUserId(Long userId); 21 | 22 | /** 23 | * 通过用户ID删除用户和角色关联 24 | * 25 | * @param userId 用户ID 26 | * @return 结果 27 | */ 28 | public int deleteUserRoleByUserId(Long userId); 29 | 30 | /** 31 | * 批量删除用户和角色关联 32 | * 33 | * @param ids 需要删除的数据ID 34 | * @return 结果 35 | */ 36 | public int deleteUserRole(Long[] ids); 37 | 38 | /** 39 | * 通过角色ID查询角色使用数量 40 | * 41 | * @param roleId 角色ID 42 | * @return 结果 43 | */ 44 | public int countUserRoleByRoleId(Long roleId); 45 | 46 | /** 47 | * 批量新增用户角色信息 48 | * 49 | * @param userRoleList 用户角色列表 50 | * @return 结果 51 | */ 52 | public int batchUserRole(List userRoleList); 53 | 54 | /** 55 | * 删除用户和角色关联信息 56 | * 57 | * @param userRole 用户和角色关联信息 58 | * @return 结果 59 | */ 60 | public int deleteUserRoleInfo(UserRole userRole); 61 | 62 | /** 63 | * 批量取消授权用户角色 64 | * 65 | * @param roleId 角色ID 66 | * @param userIds 需要删除的用户数据ID 67 | * @return 结果 68 | */ 69 | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/FilterConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import javax.servlet.DispatcherType; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 8 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | import com.ruoyi.common.utils.StringUtils; 12 | import com.ruoyi.common.xss.XssFilter; 13 | 14 | /** 15 | * Filter配置 16 | * 17 | * @author ruoyi 18 | */ 19 | @Configuration 20 | @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") 21 | public class FilterConfig 22 | { 23 | @Value("${xss.excludes}") 24 | private String excludes; 25 | 26 | @Value("${xss.urlPatterns}") 27 | private String urlPatterns; 28 | 29 | @SuppressWarnings({ "rawtypes", "unchecked" }) 30 | @Bean 31 | public FilterRegistrationBean xssFilterRegistration() 32 | { 33 | FilterRegistrationBean registration = new FilterRegistrationBean(); 34 | registration.setDispatcherTypes(DispatcherType.REQUEST); 35 | registration.setFilter(new XssFilter()); 36 | registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); 37 | registration.setName("xssFilter"); 38 | registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); 39 | Map initParameters = new HashMap(); 40 | initParameters.put("excludes", excludes); 41 | registration.setInitParameters(initParameters); 42 | return registration; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import com.alibaba.fastjson.JSONObject; 6 | import com.ruoyi.common.constant.Constants; 7 | import com.ruoyi.common.utils.http.HttpUtils; 8 | import com.ruoyi.framework.config.RuoYiConfig; 9 | 10 | /** 11 | * 获取地址类 12 | * 13 | * @author ruoyi 14 | */ 15 | public class AddressUtils 16 | { 17 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); 18 | 19 | // IP地址查询 20 | public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; 21 | 22 | // 未知地址 23 | public static final String UNKNOWN = "XX XX"; 24 | 25 | public static String getRealAddressByIP(String ip) 26 | { 27 | // 内网不查询 28 | if (IpUtils.internalIp(ip)) 29 | { 30 | return "内网IP"; 31 | } 32 | if (RuoYiConfig.isAddressEnabled()) 33 | { 34 | try 35 | { 36 | String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); 37 | if (StringUtils.isEmpty(rspStr)) 38 | { 39 | log.error("获取地理位置异常 {}", ip); 40 | return UNKNOWN; 41 | } 42 | JSONObject obj = JSONObject.parseObject(rspStr); 43 | String region = obj.getString("pro"); 44 | String city = obj.getString("city"); 45 | return String.format("%s %s", region, city); 46 | } 47 | catch (Exception e) 48 | { 49 | log.error("获取地理位置异常 {}", e); 50 | } 51 | } 52 | return UNKNOWN; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/logininfor/service/LogininforServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.logininfor.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.ruoyi.common.utils.text.Convert; 7 | import com.ruoyi.project.monitor.logininfor.domain.Logininfor; 8 | import com.ruoyi.project.monitor.logininfor.mapper.LogininforMapper; 9 | 10 | /** 11 | * 系统访问日志情况信息 服务层处理 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class LogininforServiceImpl implements ILogininforService 17 | { 18 | @Autowired 19 | private LogininforMapper logininforMapper; 20 | 21 | /** 22 | * 新增系统登录日志 23 | * 24 | * @param logininfor 访问日志对象 25 | */ 26 | @Override 27 | public void insertLogininfor(Logininfor logininfor) 28 | { 29 | logininforMapper.insertLogininfor(logininfor); 30 | } 31 | 32 | /** 33 | * 查询系统登录日志集合 34 | * 35 | * @param logininfor 访问日志对象 36 | * @return 登录记录集合 37 | */ 38 | @Override 39 | public List selectLogininforList(Logininfor logininfor) 40 | { 41 | return logininforMapper.selectLogininforList(logininfor); 42 | } 43 | 44 | /** 45 | * 批量删除系统登录日志 46 | * 47 | * @param ids 需要删除的数据 48 | * @return 结果 49 | */ 50 | @Override 51 | public int deleteLogininforByIds(String ids) 52 | { 53 | return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids)); 54 | } 55 | 56 | /** 57 | * 清空系统登录日志 58 | */ 59 | @Override 60 | public void cleanLogininfor() 61 | { 62 | logininforMapper.cleanLogininfor(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/duallistbox/bootstrap-duallistbox.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Bootstrap Duallistbox - v3.0.9 3 | * A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices. 4 | * https://www.virtuosoft.eu/code/bootstrap-duallistbox/ 5 | * 6 | * Made by István Ujj-Mészáros 7 | * Under Apache License v2.0 License 8 | */ 9 | .bootstrap-duallistbox-container .buttons{width:100%;margin-bottom:-1px}.bootstrap-duallistbox-container label{display:block}.bootstrap-duallistbox-container .info{display:inline-block;margin-bottom:5px;font-size:11px}.bootstrap-duallistbox-container .clear1,.bootstrap-duallistbox-container .clear2{display:none;font-size:10px}.bootstrap-duallistbox-container .box1.filtered .clear1,.bootstrap-duallistbox-container .box2.filtered .clear2{display:inline-block}.bootstrap-duallistbox-container .move,.bootstrap-duallistbox-container .remove{width:60%}.bootstrap-duallistbox-container .btn-group .btn{border-bottom-left-radius:0;border-bottom-right-radius:0}.bootstrap-duallistbox-container select{border-top-left-radius:0;border-top-right-radius:0}.bootstrap-duallistbox-container .moveall,.bootstrap-duallistbox-container .removeall{width:40%}.bootstrap-duallistbox-container.bs2compatible .btn-group>.btn+.btn{margin-left:0}.bootstrap-duallistbox-container select{width:100%;height:300px;padding:0}.bootstrap-duallistbox-container .filter{display:inline-block;width:100%;height:31px;margin:0 0 5px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-duallistbox-container .filter.placeholder{color:#aaa}.bootstrap-duallistbox-container.moveonselect .move,.bootstrap-duallistbox-container.moveonselect .remove{display:none}.bootstrap-duallistbox-container.moveonselect .moveall,.bootstrap-duallistbox-container.moveonselect .removeall{width:100%} -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/MapDataUtil.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.Map; 6 | import java.util.Map.Entry; 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | /** 10 | * Map通用处理方法 11 | * 12 | * @author ruoyi 13 | */ 14 | public class MapDataUtil 15 | { 16 | public static Map convertDataMap(HttpServletRequest request) 17 | { 18 | Map properties = request.getParameterMap(); 19 | Map returnMap = new HashMap(); 20 | Iterator entries = properties.entrySet().iterator(); 21 | Map.Entry entry; 22 | String name = ""; 23 | String value = ""; 24 | while (entries.hasNext()) 25 | { 26 | entry = (Entry) entries.next(); 27 | name = (String) entry.getKey(); 28 | Object valueObj = entry.getValue(); 29 | if (null == valueObj) 30 | { 31 | value = ""; 32 | } 33 | else if (valueObj instanceof String[]) 34 | { 35 | String[] values = (String[]) valueObj; 36 | value = ""; 37 | for (int i = 0; i < values.length; i++) 38 | { 39 | value += values[i] + ","; 40 | } 41 | if (value.length() > 0) 42 | { 43 | value = value.substring(0, value.length() - 1); 44 | } 45 | } 46 | else 47 | { 48 | value = valueObj.toString(); 49 | } 50 | returnMap.put(name, value); 51 | } 52 | return returnMap; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/post/mapper/PostMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.post.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.post.domain.Post; 5 | 6 | /** 7 | * 岗位信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface PostMapper 12 | { 13 | /** 14 | * 查询岗位数据集合 15 | * 16 | * @param post 岗位信息 17 | * @return 岗位数据集合 18 | */ 19 | public List selectPostList(Post post); 20 | 21 | /** 22 | * 查询所有岗位 23 | * 24 | * @return 岗位列表 25 | */ 26 | public List selectPostAll(); 27 | 28 | /** 29 | * 根据用户ID查询岗位 30 | * 31 | * @param userId 用户ID 32 | * @return 岗位列表 33 | */ 34 | public List selectPostsByUserId(Long userId); 35 | 36 | /** 37 | * 通过岗位ID查询岗位信息 38 | * 39 | * @param postId 岗位ID 40 | * @return 角色对象信息 41 | */ 42 | public Post selectPostById(Long postId); 43 | 44 | /** 45 | * 批量删除岗位信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deletePostByIds(Long[] ids); 51 | 52 | /** 53 | * 修改岗位信息 54 | * 55 | * @param post 岗位信息 56 | * @return 结果 57 | */ 58 | public int updatePost(Post post); 59 | 60 | /** 61 | * 新增岗位信息 62 | * 63 | * @param post 岗位信息 64 | * @return 结果 65 | */ 66 | public int insertPost(Post post); 67 | 68 | /** 69 | * 校验岗位名称 70 | * 71 | * @param postName 岗位名称 72 | * @return 结果 73 | */ 74 | public Post checkPostNameUnique(String postName); 75 | 76 | /** 77 | * 校验岗位编码 78 | * 79 | * @param postCode 岗位编码 80 | * @return 结果 81 | */ 82 | public Post checkPostCodeUnique(String postCode); 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/online/service/IUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.online.service; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | import com.ruoyi.project.monitor.online.domain.UserOnline; 6 | 7 | /** 8 | * 在线用户 服务层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface IUserOnlineService 13 | { 14 | /** 15 | * 通过会话序号查询信息 16 | * 17 | * @param sessionId 会话ID 18 | * @return 在线用户信息 19 | */ 20 | public UserOnline selectOnlineById(String sessionId); 21 | 22 | /** 23 | * 通过会话序号删除信息 24 | * 25 | * @param sessionId 会话ID 26 | * @return 在线用户信息 27 | */ 28 | public void deleteOnlineById(String sessionId); 29 | 30 | /** 31 | * 通过会话序号删除信息 32 | * 33 | * @param sessions 会话ID集合 34 | * @return 在线用户信息 35 | */ 36 | public void batchDeleteOnline(List sessions); 37 | 38 | /** 39 | * 保存会话信息 40 | * 41 | * @param online 会话信息 42 | */ 43 | public void saveOnline(UserOnline online); 44 | 45 | /** 46 | * 查询会话集合 47 | * 48 | * @param userOnline 分页参数 49 | * @return 会话集合 50 | */ 51 | public List selectUserOnlineList(UserOnline userOnline); 52 | 53 | /** 54 | * 强退用户 55 | * 56 | * @param sessionId 会话ID 57 | */ 58 | public void forceLogout(String sessionId); 59 | 60 | /** 61 | * 清理用户缓存 62 | * 63 | * @param loginName 登录名称 64 | * @param sessionId 会话ID 65 | */ 66 | public void removeUserCache(String loginName, String sessionId); 67 | 68 | /** 69 | * 查询会话集合 70 | * 71 | * @param expiredDate 有效期 72 | * @return 会话集合 73 | */ 74 | public List selectOnlineByExpired(Date expiredDate); 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/config/service/IConfigService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.config.service; 2 | 3 | import com.ruoyi.project.system.config.domain.Config; 4 | import java.util.List; 5 | 6 | /** 7 | * 参数配置 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IConfigService 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param configId 参数配置ID 17 | * @return 参数配置信息 18 | */ 19 | public Config selectConfigById(Long configId); 20 | 21 | /** 22 | * 根据键名查询参数配置信息 23 | * 24 | * @param configKey 参数键名 25 | * @return 参数键值 26 | */ 27 | public String selectConfigByKey(String configKey); 28 | 29 | /** 30 | * 查询参数配置列表 31 | * 32 | * @param config 参数配置信息 33 | * @return 参数配置集合 34 | */ 35 | public List selectConfigList(Config config); 36 | 37 | /** 38 | * 新增参数配置 39 | * 40 | * @param config 参数配置信息 41 | * @return 结果 42 | */ 43 | public int insertConfig(Config config); 44 | 45 | /** 46 | * 修改参数配置 47 | * 48 | * @param config 参数配置信息 49 | * @return 结果 50 | */ 51 | public int updateConfig(Config config); 52 | 53 | /** 54 | * 批量删除参数配置信息 55 | * 56 | * @param ids 需要删除的数据ID 57 | */ 58 | public void deleteConfigByIds(String ids); 59 | 60 | /** 61 | * 加载参数缓存数据 62 | */ 63 | public void loadingConfigCache(); 64 | 65 | /** 66 | * 清空参数缓存数据 67 | */ 68 | public void clearConfigCache(); 69 | 70 | /** 71 | * 重置参数缓存数据 72 | */ 73 | public void resetConfigCache(); 74 | 75 | /** 76 | * 校验参数键名是否唯一 77 | * 78 | * @param config 参数信息 79 | * @return 结果 80 | */ 81 | public boolean checkConfigKeyUnique(Config config); 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/role/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.role.domain.Role; 5 | 6 | /** 7 | * 角色表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface RoleMapper 12 | { 13 | /** 14 | * 根据条件分页查询角色数据 15 | * 16 | * @param role 角色信息 17 | * @return 角色数据集合信息 18 | */ 19 | public List selectRoleList(Role role); 20 | 21 | /** 22 | * 根据用户ID查询角色 23 | * 24 | * @param userId 用户ID 25 | * @return 角色列表 26 | */ 27 | public List selectRolesByUserId(Long userId); 28 | 29 | /** 30 | * 通过角色ID查询角色 31 | * 32 | * @param roleId 角色ID 33 | * @return 角色对象信息 34 | */ 35 | public Role selectRoleById(Long roleId); 36 | 37 | /** 38 | * 通过角色ID删除角色 39 | * 40 | * @param roleId 角色ID 41 | * @return 结果 42 | */ 43 | public int deleteRoleById(Long roleId); 44 | 45 | /** 46 | * 批量角色用户信息 47 | * 48 | * @param ids 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteRoleByIds(Long[] ids); 52 | 53 | /** 54 | * 修改角色信息 55 | * 56 | * @param role 角色信息 57 | * @return 结果 58 | */ 59 | public int updateRole(Role role); 60 | 61 | /** 62 | * 新增角色信息 63 | * 64 | * @param role 角色信息 65 | * @return 结果 66 | */ 67 | public int insertRole(Role role); 68 | 69 | /** 70 | * 校验角色名称是否唯一 71 | * 72 | * @param roleName 角色名称 73 | * @return 角色信息 74 | */ 75 | public Role checkRoleNameUnique(String roleName); 76 | 77 | /** 78 | * 校验角色权限是否唯一 79 | * 80 | * @param roleKey 角色权限 81 | * @return 角色信息 82 | */ 83 | public Role checkRoleKeyUnique(String roleKey); 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.file; 2 | 3 | /** 4 | * 媒体类型工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class MimeTypeUtils 9 | { 10 | public static final String IMAGE_PNG = "image/png"; 11 | 12 | public static final String IMAGE_JPG = "image/jpg"; 13 | 14 | public static final String IMAGE_JPEG = "image/jpeg"; 15 | 16 | public static final String IMAGE_BMP = "image/bmp"; 17 | 18 | public static final String IMAGE_GIF = "image/gif"; 19 | 20 | public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; 21 | 22 | public static final String[] FLASH_EXTENSION = { "swf", "flv" }; 23 | 24 | public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", 25 | "asf", "rm", "rmvb" }; 26 | 27 | public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" }; 28 | 29 | public static final String[] DEFAULT_ALLOWED_EXTENSION = { 30 | // 图片 31 | "bmp", "gif", "jpg", "jpeg", "png", 32 | // word excel powerpoint 33 | "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", 34 | // 压缩文件 35 | "rar", "zip", "gz", "bz2", 36 | // 视频格式 37 | "mp4", "avi", "rmvb", 38 | // pdf 39 | "pdf" }; 40 | 41 | public static String getExtension(String prefix) 42 | { 43 | switch (prefix) 44 | { 45 | case IMAGE_PNG: 46 | return "png"; 47 | case IMAGE_JPG: 48 | return "jpg"; 49 | case IMAGE_JPEG: 50 | return "jpeg"; 51 | case IMAGE_BMP: 52 | return "bmp"; 53 | case IMAGE_GIF: 54 | return "gif"; 55 | default: 56 | return ""; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/resources/templates/demo/form/localrefresh.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |

任务列表

13 |

14 | 15 | 点击刷新按钮刷新数据到列表中 16 |

17 | 18 |
19 | 20 | 21 | 25 | 26 |
27 |
28 |
    29 |
  • 30 | [[${item.name}]] 31 |
    32 | [[${item.type}]] 33 | 34 | [[${item.date}]] 35 |
    36 |
  • 37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 45 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/resources/vm/sql/sql.vm: -------------------------------------------------------------------------------- 1 | -- 菜单 SQL 2 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 3 | values('${functionName}', '${parentMenuId}', '1', '/${moduleName}/${businessName}', 'C', '0', '${permissionPrefix}:view', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); 4 | 5 | -- 按钮父菜单ID 6 | SELECT @parentId := LAST_INSERT_ID(); 7 | 8 | -- 按钮 SQL 9 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 10 | values('${functionName}查询', @parentId, '1', '#', 'F', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, ''); 11 | 12 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 13 | values('${functionName}新增', @parentId, '2', '#', 'F', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); 14 | 15 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 16 | values('${functionName}修改', @parentId, '3', '#', 'F', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); 17 | 18 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 19 | values('${functionName}删除', @parentId, '4', '#', 'F', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); 20 | 21 | insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 22 | values('${functionName}导出', @parentId, '5', '#', 'F', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); 23 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/Md5Utils.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import java.nio.charset.StandardCharsets; 4 | import java.security.MessageDigest; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | /** 9 | * Md5加密方法 10 | * 11 | * @author ruoyi 12 | */ 13 | public class Md5Utils 14 | { 15 | private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); 16 | 17 | private static byte[] md5(String s) 18 | { 19 | MessageDigest algorithm; 20 | try 21 | { 22 | algorithm = MessageDigest.getInstance("MD5"); 23 | algorithm.reset(); 24 | algorithm.update(s.getBytes("UTF-8")); 25 | byte[] messageDigest = algorithm.digest(); 26 | return messageDigest; 27 | } 28 | catch (Exception e) 29 | { 30 | log.error("MD5 Error...", e); 31 | } 32 | return null; 33 | } 34 | 35 | private static final String toHex(byte hash[]) 36 | { 37 | if (hash == null) 38 | { 39 | return null; 40 | } 41 | StringBuffer buf = new StringBuffer(hash.length * 2); 42 | int i; 43 | 44 | for (i = 0; i < hash.length; i++) 45 | { 46 | if ((hash[i] & 0xff) < 0x10) 47 | { 48 | buf.append("0"); 49 | } 50 | buf.append(Long.toString(hash[i] & 0xff, 16)); 51 | } 52 | return buf.toString(); 53 | } 54 | 55 | public static String hash(String s) 56 | { 57 | try 58 | { 59 | return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); 60 | } 61 | catch (Exception e) 62 | { 63 | log.error("not supported charset...{}", e); 64 | return s; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/resources/mybatis/system/UserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | delete from sys_user_role where user_id = #{userId} 18 | 19 | 20 | 23 | 24 | 25 | delete from sys_user_role where user_id in 26 | 27 | #{userId} 28 | 29 | 30 | 31 | 32 | insert into sys_user_role(user_id, role_id) values 33 | 34 | (#{item.userId},#{item.roleId}) 35 | 36 | 37 | 38 | 39 | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} 40 | 41 | 42 | 43 | delete from sys_user_role where role_id=#{roleId} and user_id in 44 | 45 | #{userId} 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/gen/service/GenTableColumnServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.gen.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.ruoyi.common.utils.text.Convert; 7 | import com.ruoyi.project.tool.gen.domain.GenTableColumn; 8 | import com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper; 9 | 10 | /** 11 | * 业务字段 服务层实现 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class GenTableColumnServiceImpl implements IGenTableColumnService 17 | { 18 | @Autowired 19 | private GenTableColumnMapper genTableColumnMapper; 20 | 21 | /** 22 | * 查询业务字段列表 23 | * 24 | * @param genTableColumn 业务字段信息 25 | * @return 业务字段集合 26 | */ 27 | @Override 28 | public List selectGenTableColumnListByTableId(GenTableColumn genTableColumn) 29 | { 30 | return genTableColumnMapper.selectGenTableColumnListByTableId(genTableColumn); 31 | } 32 | 33 | /** 34 | * 新增业务字段 35 | * 36 | * @param genTableColumn 业务字段信息 37 | * @return 结果 38 | */ 39 | @Override 40 | public int insertGenTableColumn(GenTableColumn genTableColumn) 41 | { 42 | return genTableColumnMapper.insertGenTableColumn(genTableColumn); 43 | } 44 | 45 | /** 46 | * 修改业务字段 47 | * 48 | * @param genTableColumn 业务字段信息 49 | * @return 结果 50 | */ 51 | @Override 52 | public int updateGenTableColumn(GenTableColumn genTableColumn) 53 | { 54 | return genTableColumnMapper.updateGenTableColumn(genTableColumn); 55 | } 56 | 57 | /** 58 | * 删除业务字段对象 59 | * 60 | * @param ids 需要删除的数据ID 61 | * @return 结果 62 | */ 63 | @Override 64 | public int deleteGenTableColumnByIds(String ids) 65 | { 66 | return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); 67 | } 68 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/dict/mapper/DictTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.dict.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.dict.domain.DictType; 5 | 6 | /** 7 | * 字典表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface DictTypeMapper 12 | { 13 | /** 14 | * 根据条件分页查询字典类型 15 | * 16 | * @param dictType 字典类型信息 17 | * @return 字典类型集合信息 18 | */ 19 | public List selectDictTypeList(DictType dictType); 20 | 21 | /** 22 | * 根据所有字典类型 23 | * 24 | * @return 字典类型集合信息 25 | */ 26 | public List selectDictTypeAll(); 27 | 28 | /** 29 | * 根据字典类型ID查询信息 30 | * 31 | * @param dictId 字典类型ID 32 | * @return 字典类型 33 | */ 34 | public DictType selectDictTypeById(Long dictId); 35 | 36 | /** 37 | * 根据字典类型查询信息 38 | * 39 | * @param dictType 字典类型 40 | * @return 字典类型 41 | */ 42 | public DictType selectDictTypeByType(String dictType); 43 | 44 | /** 45 | * 通过字典ID删除字典信息 46 | * 47 | * @param dictId 字典ID 48 | * @return 结果 49 | */ 50 | public int deleteDictTypeById(Long dictId); 51 | 52 | /** 53 | * 批量删除字典类型 54 | * 55 | * @param ids 需要删除的数据 56 | * @return 结果 57 | */ 58 | public int deleteDictTypeByIds(Long[] ids); 59 | 60 | /** 61 | * 新增字典类型信息 62 | * 63 | * @param dictType 字典类型信息 64 | * @return 结果 65 | */ 66 | public int insertDictType(DictType dictType); 67 | 68 | /** 69 | * 修改字典类型信息 70 | * 71 | * @param dictType 字典类型信息 72 | * @return 结果 73 | */ 74 | public int updateDictType(DictType dictType); 75 | 76 | /** 77 | * 校验字典类型称是否唯一 78 | * 79 | * @param dictType 字典类型 80 | * @return 结果 81 | */ 82 | public DictType checkDictTypeUnique(String dictType); 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import org.apache.commons.lang3.exception.ExceptionUtils; 6 | import com.ruoyi.common.utils.StringUtils; 7 | 8 | /** 9 | * 错误信息处理类。 10 | * 11 | * @author ruoyi 12 | */ 13 | public class ExceptionUtil 14 | { 15 | /** 16 | * 获取exception的详细错误信息。 17 | */ 18 | public static String getExceptionMessage(Throwable e) 19 | { 20 | StringWriter sw = new StringWriter(); 21 | e.printStackTrace(new PrintWriter(sw, true)); 22 | return sw.toString(); 23 | } 24 | 25 | public static String getRootErrorMessage(Exception e) 26 | { 27 | Throwable root = ExceptionUtils.getRootCause(e); 28 | root = (root == null ? e : root); 29 | if (root == null) 30 | { 31 | return ""; 32 | } 33 | String msg = root.getMessage(); 34 | if (msg == null) 35 | { 36 | return "null"; 37 | } 38 | return StringUtils.defaultString(msg); 39 | } 40 | 41 | /** 42 | * 检测异常e被触发的原因是不是因为异常cause。 43 | * 44 | * @param e 捕获的异常。 45 | * @param cause 异常触发原因。 46 | * @return 如果异常e是由cause类异常触发,则返回true;否则返回false。 47 | */ 48 | public static boolean isCausedBy(final Throwable e, final Class cause) 49 | { 50 | if (cause.isAssignableFrom(e.getClass())) 51 | { 52 | return true; 53 | } 54 | else 55 | { 56 | Throwable t = e.getCause(); 57 | while (t != null && t != e) 58 | { 59 | if (cause.isAssignableFrom(t.getClass())) 60 | { 61 | return true; 62 | } 63 | t = t.getCause(); 64 | } 65 | return false; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/monitor/operlog/service/OperLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.monitor.operlog.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.ruoyi.common.utils.text.Convert; 7 | import com.ruoyi.project.monitor.operlog.domain.OperLog; 8 | import com.ruoyi.project.monitor.operlog.mapper.OperLogMapper; 9 | 10 | /** 11 | * 操作日志 服务层处理 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class OperLogServiceImpl implements IOperLogService 17 | { 18 | @Autowired 19 | private OperLogMapper operLogMapper; 20 | 21 | /** 22 | * 新增操作日志 23 | * 24 | * @param operLog 操作日志对象 25 | */ 26 | @Override 27 | public void insertOperlog(OperLog operLog) 28 | { 29 | operLogMapper.insertOperlog(operLog); 30 | } 31 | 32 | /** 33 | * 查询系统操作日志集合 34 | * 35 | * @param operLog 操作日志对象 36 | * @return 操作日志集合 37 | */ 38 | @Override 39 | public List selectOperLogList(OperLog operLog) 40 | { 41 | return operLogMapper.selectOperLogList(operLog); 42 | } 43 | 44 | /** 45 | * 批量删除系统操作日志 46 | * 47 | * @param ids 需要删除的数据 48 | * @return 49 | */ 50 | @Override 51 | public int deleteOperLogByIds(String ids) 52 | { 53 | return operLogMapper.deleteOperLogByIds(Convert.toStrArray(ids)); 54 | } 55 | 56 | /** 57 | * 查询操作日志详细 58 | * 59 | * @param operId 操作ID 60 | * @return 操作日志对象 61 | */ 62 | @Override 63 | public OperLog selectOperLogById(Long operId) 64 | { 65 | return operLogMapper.selectOperLogById(operId); 66 | } 67 | 68 | /** 69 | * 清空操作日志 70 | */ 71 | @Override 72 | public void cleanOperLog() 73 | { 74 | operLogMapper.cleanOperLog(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/resources/templates/system/menu/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 22 |
23 | 展开 / 24 | 折叠 25 |
26 |
27 |
28 | 29 | 30 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/GenConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * 读取代码生成相关配置 8 | * 9 | * @author ruoyi 10 | */ 11 | @Component 12 | @ConfigurationProperties(prefix = "gen") 13 | public class GenConfig 14 | { 15 | /** 作者 */ 16 | public static String author; 17 | 18 | /** 生成包路径 */ 19 | public static String packageName; 20 | 21 | /** 自动去除表前缀 */ 22 | public static boolean autoRemovePre; 23 | 24 | /** 表前缀 */ 25 | public static String tablePrefix; 26 | 27 | /** 是否允许生成文件覆盖到本地(自定义路径) */ 28 | public static boolean allowOverwrite; 29 | 30 | public static String getAuthor() 31 | { 32 | return author; 33 | } 34 | 35 | public void setAuthor(String author) 36 | { 37 | GenConfig.author = author; 38 | } 39 | 40 | public static String getPackageName() 41 | { 42 | return packageName; 43 | } 44 | 45 | public void setPackageName(String packageName) 46 | { 47 | GenConfig.packageName = packageName; 48 | } 49 | 50 | public static boolean getAutoRemovePre() 51 | { 52 | return autoRemovePre; 53 | } 54 | 55 | public void setAutoRemovePre(boolean autoRemovePre) 56 | { 57 | GenConfig.autoRemovePre = autoRemovePre; 58 | } 59 | 60 | public static String getTablePrefix() 61 | { 62 | return tablePrefix; 63 | } 64 | 65 | public void setTablePrefix(String tablePrefix) 66 | { 67 | GenConfig.tablePrefix = tablePrefix; 68 | } 69 | 70 | public static boolean isAllowOverwrite() 71 | { 72 | return allowOverwrite; 73 | } 74 | 75 | public void setAllowOverwrite(boolean allowOverwrite) 76 | { 77 | GenConfig.allowOverwrite = allowOverwrite; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /ry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ./ry.sh start 启动 stop 停止 restart 重启 status 状态 3 | AppName=target/ruoyi.jar 4 | 5 | # JVM参数 6 | JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" 7 | APP_HOME=`pwd` 8 | LOG_PATH=$APP_HOME/logs/$AppName.log 9 | 10 | if [ "$1" = "" ]; 11 | then 12 | echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" 13 | exit 1 14 | fi 15 | 16 | if [ "$AppName" = "" ]; 17 | then 18 | echo -e "\033[0;31m 未输入应用名 \033[0m" 19 | exit 1 20 | fi 21 | 22 | function start() 23 | { 24 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` 25 | 26 | if [ x"$PID" != x"" ]; then 27 | echo "$AppName is running..." 28 | else 29 | nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 & 30 | echo "Start $AppName success..." 31 | fi 32 | } 33 | 34 | function stop() 35 | { 36 | echo "Stop $AppName" 37 | 38 | PID="" 39 | query(){ 40 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` 41 | } 42 | 43 | query 44 | if [ x"$PID" != x"" ]; then 45 | kill -TERM $PID 46 | echo "$AppName (pid:$PID) exiting..." 47 | while [ x"$PID" != x"" ] 48 | do 49 | sleep 1 50 | query 51 | done 52 | echo "$AppName exited." 53 | else 54 | echo "$AppName already stopped." 55 | fi 56 | } 57 | 58 | function restart() 59 | { 60 | stop 61 | sleep 2 62 | start 63 | } 64 | 65 | function status() 66 | { 67 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` 68 | if [ $PID != 0 ];then 69 | echo "$AppName is running..." 70 | else 71 | echo "$AppName is not running..." 72 | fi 73 | } 74 | 75 | case $1 in 76 | start) 77 | start;; 78 | stop) 79 | stop;; 80 | restart) 81 | restart;; 82 | status) 83 | status;; 84 | *) 85 | 86 | esac 87 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/constant/ShiroConstants.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.constant; 2 | 3 | /** 4 | * Shiro通用常量 5 | * 6 | * @author ruoyi 7 | */ 8 | public class ShiroConstants 9 | { 10 | /** 11 | * 当前登录的用户 12 | */ 13 | public static final String CURRENT_USER = "currentUser"; 14 | 15 | /** 16 | * 用户名字段 17 | */ 18 | public static final String CURRENT_USERNAME = "username"; 19 | 20 | /** 21 | * 锁定屏幕字段 22 | */ 23 | public static final String LOCK_SCREEN = "lockscreen"; 24 | 25 | /** 26 | * 消息key 27 | */ 28 | public static final String MESSAGE = "message"; 29 | 30 | /** 31 | * 错误key 32 | */ 33 | public static final String ERROR = "errorMsg"; 34 | 35 | /** 36 | * csrf session content 37 | */ 38 | public static final String CSRF_TOKEN = "csrf_token"; 39 | 40 | /** 41 | * csrf request header 42 | */ 43 | public static final String X_CSRF_TOKEN = "X-CSRF-Token"; 44 | 45 | /** 46 | * 当前在线会话 47 | */ 48 | public static final String ONLINE_SESSION = "online_session"; 49 | 50 | /** 51 | * 验证码key 52 | */ 53 | public static final String CURRENT_CAPTCHA = "captcha"; 54 | 55 | /** 56 | * 验证码开关 57 | */ 58 | public static final String CURRENT_ENABLED = "captchaEnabled"; 59 | 60 | /** 61 | * 验证码类型 62 | */ 63 | public static final String CURRENT_TYPE = "captchaType"; 64 | 65 | /** 66 | * 验证码 67 | */ 68 | public static final String CURRENT_VALIDATECODE = "validateCode"; 69 | 70 | /** 71 | * 验证码错误 72 | */ 73 | public static final String CAPTCHA_ERROR = "captchaError"; 74 | 75 | /** 76 | * 登录记录缓存 77 | */ 78 | public static final String LOGIN_RECORD_CACHE = "loginRecordCache"; 79 | 80 | /** 81 | * 系统活跃用户缓存 82 | */ 83 | public static final String SYS_USERCACHE = "sys-userCache"; 84 | } -------------------------------------------------------------------------------- /src/main/resources/templates/system/user/resetPwd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
19 |
20 | 21 | 24 |
25 |
26 |
27 |
28 |
29 | 30 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/templates/demo/modal/table/frame1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/templates/system/user/deptTree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 22 |
23 | 展开 / 24 | 折叠 25 |
26 |
27 |
28 | 29 | 30 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/system/post/service/IPostService.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.system.post.service; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.system.post.domain.Post; 5 | 6 | /** 7 | * 岗位信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IPostService 12 | { 13 | /** 14 | * 查询岗位信息集合 15 | * 16 | * @param post 岗位信息 17 | * @return 岗位信息集合 18 | */ 19 | public List selectPostList(Post post); 20 | 21 | /** 22 | * 查询所有岗位 23 | * 24 | * @return 岗位列表 25 | */ 26 | public List selectPostAll(); 27 | 28 | /** 29 | * 根据用户ID查询岗位 30 | * 31 | * @param userId 用户ID 32 | * @return 岗位列表 33 | */ 34 | public List selectPostsByUserId(Long userId); 35 | 36 | /** 37 | * 通过岗位ID查询岗位信息 38 | * 39 | * @param postId 岗位ID 40 | * @return 角色对象信息 41 | */ 42 | public Post selectPostById(Long postId); 43 | 44 | /** 45 | * 批量删除岗位信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deletePostByIds(String ids); 51 | 52 | /** 53 | * 新增保存岗位信息 54 | * 55 | * @param post 岗位信息 56 | * @return 结果 57 | */ 58 | public int insertPost(Post post); 59 | 60 | /** 61 | * 修改保存岗位信息 62 | * 63 | * @param post 岗位信息 64 | * @return 结果 65 | */ 66 | public int updatePost(Post post); 67 | 68 | /** 69 | * 通过岗位ID查询岗位使用数量 70 | * 71 | * @param postId 岗位ID 72 | * @return 结果 73 | */ 74 | public int countUserPostById(Long postId); 75 | 76 | /** 77 | * 校验岗位名称 78 | * 79 | * @param post 岗位信息 80 | * @return 结果 81 | */ 82 | public boolean checkPostNameUnique(Post post); 83 | 84 | /** 85 | * 校验岗位编码 86 | * 87 | * @param post 岗位信息 88 | * @return 结果 89 | */ 90 | public boolean checkPostCodeUnique(Post post); 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.common.utils.sql; 2 | 3 | import com.ruoyi.common.exception.UtilException; 4 | import com.ruoyi.common.utils.StringUtils; 5 | 6 | /** 7 | * sql操作工具类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SqlUtil 12 | { 13 | /** 14 | * 定义常用的 sql关键字 15 | */ 16 | public static String SQL_REGEX = "\u000B|and |extractvalue|updatexml|sleep|information_schema|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()"; 17 | 18 | /** 19 | * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) 20 | */ 21 | public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; 22 | 23 | /** 24 | * 限制orderBy最大长度 25 | */ 26 | private static final int ORDER_BY_MAX_LENGTH = 500; 27 | 28 | /** 29 | * 检查字符,防止注入绕过 30 | */ 31 | public static String escapeOrderBySql(String value) 32 | { 33 | if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) 34 | { 35 | throw new UtilException("参数不符合规范,不能进行查询"); 36 | } 37 | if (StringUtils.length(value) > ORDER_BY_MAX_LENGTH) 38 | { 39 | throw new UtilException("参数已超过最大限制,不能进行查询"); 40 | } 41 | return value; 42 | } 43 | 44 | /** 45 | * 验证 order by 语法是否符合规范 46 | */ 47 | public static boolean isValidOrderBySql(String value) 48 | { 49 | return value.matches(SQL_PATTERN); 50 | } 51 | 52 | /** 53 | * SQL关键字检查 54 | */ 55 | public static void filterKeyword(String value) 56 | { 57 | if (StringUtils.isEmpty(value)) 58 | { 59 | return; 60 | } 61 | String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); 62 | for (String sqlKeyword : sqlKeywords) 63 | { 64 | if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) 65 | { 66 | throw new UtilException("参数存在SQL注入风险"); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.interceptor; 2 | 3 | import java.lang.reflect.Method; 4 | import javax.servlet.http.HttpServletRequest; 5 | import javax.servlet.http.HttpServletResponse; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.web.method.HandlerMethod; 8 | import org.springframework.web.servlet.HandlerInterceptor; 9 | import com.alibaba.fastjson.JSONObject; 10 | import com.ruoyi.common.utils.ServletUtils; 11 | import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; 12 | import com.ruoyi.framework.web.domain.AjaxResult; 13 | 14 | /** 15 | * 防止重复提交拦截器 16 | * 17 | * @author ruoyi 18 | */ 19 | @Component 20 | public abstract class RepeatSubmitInterceptor implements HandlerInterceptor 21 | { 22 | @Override 23 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception 24 | { 25 | if (handler instanceof HandlerMethod) 26 | { 27 | HandlerMethod handlerMethod = (HandlerMethod) handler; 28 | Method method = handlerMethod.getMethod(); 29 | RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); 30 | if (annotation != null) 31 | { 32 | if (this.isRepeatSubmit(request, annotation)) 33 | { 34 | AjaxResult ajaxResult = AjaxResult.error(annotation.message()); 35 | ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult)); 36 | return false; 37 | } 38 | } 39 | return true; 40 | } 41 | else 42 | { 43 | return true; 44 | } 45 | } 46 | 47 | /** 48 | * 验证是否重复提交由子类实现具体的防重复提交的规则 49 | * 50 | * @param request 请求对象 51 | * @param annotation 防复注解 52 | * @return 结果 53 | */ 54 | public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation); 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/page/PageDomain.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.page; 2 | 3 | import com.ruoyi.common.utils.StringUtils; 4 | 5 | /** 6 | * 分页数据 7 | * 8 | * @author ruoyi 9 | */ 10 | public class PageDomain 11 | { 12 | /** 当前记录起始索引 */ 13 | private Integer pageNum; 14 | 15 | /** 每页显示记录数 */ 16 | private Integer pageSize; 17 | 18 | /** 排序列 */ 19 | private String orderByColumn; 20 | 21 | /** 排序的方向desc或者asc */ 22 | private String isAsc = "asc"; 23 | 24 | /** 分页参数合理化 */ 25 | private Boolean reasonable = true; 26 | 27 | public String getOrderBy() 28 | { 29 | if (StringUtils.isEmpty(orderByColumn)) 30 | { 31 | return ""; 32 | } 33 | return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; 34 | } 35 | 36 | public Integer getPageNum() 37 | { 38 | return pageNum; 39 | } 40 | 41 | public void setPageNum(Integer pageNum) 42 | { 43 | this.pageNum = pageNum; 44 | } 45 | 46 | public Integer getPageSize() 47 | { 48 | return pageSize; 49 | } 50 | 51 | public void setPageSize(Integer pageSize) 52 | { 53 | this.pageSize = pageSize; 54 | } 55 | 56 | public String getOrderByColumn() 57 | { 58 | return orderByColumn; 59 | } 60 | 61 | public void setOrderByColumn(String orderByColumn) 62 | { 63 | this.orderByColumn = orderByColumn; 64 | } 65 | 66 | public String getIsAsc() 67 | { 68 | return isAsc; 69 | } 70 | 71 | public void setIsAsc(String isAsc) 72 | { 73 | this.isAsc = isAsc; 74 | } 75 | 76 | public Boolean getReasonable() 77 | { 78 | if (StringUtils.isNull(reasonable)) 79 | { 80 | return Boolean.TRUE; 81 | } 82 | return reasonable; 83 | } 84 | 85 | public void setReasonable(Boolean reasonable) 86 | { 87 | this.reasonable = reasonable; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/config/ResourcesConfig.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.config; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 8 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 10 | import com.ruoyi.common.constant.Constants; 11 | import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; 12 | 13 | /** 14 | * 通用配置 15 | * 16 | * @author ruoyi 17 | */ 18 | @Configuration 19 | public class ResourcesConfig implements WebMvcConfigurer 20 | { 21 | /** 22 | * 首页地址 23 | */ 24 | @Value("${shiro.user.indexUrl}") 25 | private String indexUrl; 26 | 27 | @Autowired 28 | private RepeatSubmitInterceptor repeatSubmitInterceptor; 29 | 30 | /** 31 | * 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页 32 | */ 33 | @Override 34 | public void addViewControllers(ViewControllerRegistry registry) 35 | { 36 | registry.addViewController("/").setViewName("forward:" + indexUrl); 37 | } 38 | 39 | @Override 40 | public void addResourceHandlers(ResourceHandlerRegistry registry) 41 | { 42 | /** 本地文件上传路径 */ 43 | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); 44 | 45 | /** swagger配置 */ 46 | registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); 47 | } 48 | 49 | /** 50 | * 自定义拦截规则 51 | */ 52 | @Override 53 | public void addInterceptors(InterceptorRegistry registry) 54 | { 55 | registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableMapper.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.project.tool.gen.mapper; 2 | 3 | import java.util.List; 4 | import com.ruoyi.project.tool.gen.domain.GenTable; 5 | 6 | /** 7 | * 业务 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface GenTableMapper 12 | { 13 | /** 14 | * 查询业务列表 15 | * 16 | * @param genTable 业务信息 17 | * @return 业务集合 18 | */ 19 | public List selectGenTableList(GenTable genTable); 20 | 21 | /** 22 | * 查询据库列表 23 | * 24 | * @param genTable 业务信息 25 | * @return 数据库表集合 26 | */ 27 | public List selectDbTableList(GenTable genTable); 28 | 29 | /** 30 | * 查询据库列表 31 | * 32 | * @param tableNames 表名称组 33 | * @return 数据库表集合 34 | */ 35 | public List selectDbTableListByNames(String[] tableNames); 36 | 37 | /** 38 | * 查询所有表信息 39 | * 40 | * @return 表信息集合 41 | */ 42 | public List selectGenTableAll(); 43 | 44 | /** 45 | * 查询表ID业务信息 46 | * 47 | * @param id 业务ID 48 | * @return 业务信息 49 | */ 50 | public GenTable selectGenTableById(Long id); 51 | 52 | /** 53 | * 查询表名称业务信息 54 | * 55 | * @param tableName 表名称 56 | * @return 业务信息 57 | */ 58 | public GenTable selectGenTableByName(String tableName); 59 | 60 | /** 61 | * 新增业务 62 | * 63 | * @param genTable 业务信息 64 | * @return 结果 65 | */ 66 | public int insertGenTable(GenTable genTable); 67 | 68 | /** 69 | * 修改业务 70 | * 71 | * @param genTable 业务信息 72 | * @return 结果 73 | */ 74 | public int updateGenTable(GenTable genTable); 75 | 76 | /** 77 | * 批量删除业务 78 | * 79 | * @param ids 需要删除的数据ID 80 | * @return 结果 81 | */ 82 | public int deleteGenTableByIds(Long[] ids); 83 | 84 | /** 85 | * 创建表 86 | * 87 | * @param sql 88 | * @return 结果 89 | */ 90 | public int createTable(String sql); 91 | } -------------------------------------------------------------------------------- /src/main/resources/templates/system/dept/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 22 |
23 | 展开 / 24 | 折叠 25 |
26 |
27 |
28 | 29 | 30 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/ruoyi/framework/web/domain/Ztree.java: -------------------------------------------------------------------------------- 1 | package com.ruoyi.framework.web.domain; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Ztree树结构实体类 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Ztree implements Serializable 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | /** 节点ID */ 15 | private Long id; 16 | 17 | /** 节点父ID */ 18 | private Long pId; 19 | 20 | /** 节点名称 */ 21 | private String name; 22 | 23 | /** 节点标题 */ 24 | private String title; 25 | 26 | /** 是否勾选 */ 27 | private boolean checked = false; 28 | 29 | /** 是否展开 */ 30 | private boolean open = false; 31 | 32 | /** 是否能勾选 */ 33 | private boolean nocheck = false; 34 | 35 | public Long getId() 36 | { 37 | return id; 38 | } 39 | 40 | public void setId(Long id) 41 | { 42 | this.id = id; 43 | } 44 | 45 | public Long getpId() 46 | { 47 | return pId; 48 | } 49 | 50 | public void setpId(Long pId) 51 | { 52 | this.pId = pId; 53 | } 54 | 55 | public String getName() 56 | { 57 | return name; 58 | } 59 | 60 | public void setName(String name) 61 | { 62 | this.name = name; 63 | } 64 | 65 | public String getTitle() 66 | { 67 | return title; 68 | } 69 | 70 | public void setTitle(String title) 71 | { 72 | this.title = title; 73 | } 74 | 75 | public boolean isChecked() 76 | { 77 | return checked; 78 | } 79 | 80 | public void setChecked(boolean checked) 81 | { 82 | this.checked = checked; 83 | } 84 | 85 | public boolean isOpen() 86 | { 87 | return open; 88 | } 89 | 90 | public void setOpen(boolean open) 91 | { 92 | this.open = open; 93 | } 94 | 95 | public boolean isNocheck() 96 | { 97 | return nocheck; 98 | } 99 | 100 | public void setNocheck(boolean nocheck) 101 | { 102 | this.nocheck = nocheck; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/resources/vm/java/service.java.vm: -------------------------------------------------------------------------------- 1 | package ${packageName}.${businessName}.service; 2 | 3 | import java.util.List; 4 | import ${packageName}.${businessName}.domain.${ClassName}; 5 | #if($table.tree) 6 | import com.ruoyi.framework.web.domain.Ztree; 7 | #end 8 | 9 | /** 10 | * ${functionName}Service接口 11 | * 12 | * @author ${author} 13 | * @date ${datetime} 14 | */ 15 | public interface I${ClassName}Service 16 | { 17 | /** 18 | * 查询${functionName} 19 | * 20 | * @param ${pkColumn.javaField} ${functionName}主键 21 | * @return ${functionName} 22 | */ 23 | public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); 24 | 25 | /** 26 | * 查询${functionName}列表 27 | * 28 | * @param ${className} ${functionName} 29 | * @return ${functionName}集合 30 | */ 31 | public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); 32 | 33 | /** 34 | * 新增${functionName} 35 | * 36 | * @param ${className} ${functionName} 37 | * @return 结果 38 | */ 39 | public int insert${ClassName}(${ClassName} ${className}); 40 | 41 | /** 42 | * 修改${functionName} 43 | * 44 | * @param ${className} ${functionName} 45 | * @return 结果 46 | */ 47 | public int update${ClassName}(${ClassName} ${className}); 48 | 49 | /** 50 | * 批量删除${functionName} 51 | * 52 | * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 53 | * @return 结果 54 | */ 55 | public int delete${ClassName}By${pkColumn.capJavaField}s(String ${pkColumn.javaField}s); 56 | 57 | /** 58 | * 删除${functionName}信息 59 | * 60 | * @param ${pkColumn.javaField} ${functionName}主键 61 | * @return 结果 62 | */ 63 | public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); 64 | #if($table.tree) 65 | 66 | /** 67 | * 查询${functionName}树列表 68 | * 69 | * @return 所有${functionName}信息 70 | */ 71 | public List select${ClassName}Tree(); 72 | #end 73 | } 74 | --------------------------------------------------------------------------------