├── src └── main │ ├── resources │ ├── static │ │ ├── file │ │ │ └── rml.txt │ │ ├── ruoyi.png │ │ ├── favicon.ico │ │ ├── img │ │ │ ├── blue.png │ │ │ ├── locked.png │ │ │ ├── user.png │ │ │ ├── loading.gif │ │ │ ├── profile.jpg │ │ │ ├── progress.png │ │ │ ├── qr_code.png │ │ │ ├── loading-upload.gif │ │ │ └── login-background.jpg │ │ ├── fonts │ │ │ ├── zenicon.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 │ │ │ │ └── custom.css │ │ │ │ ├── layer │ │ │ │ └── theme │ │ │ │ │ ├── default │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ └── loading-2.gif │ │ │ │ │ └── moon │ │ │ │ │ └── default.png │ │ │ │ ├── bootstrap-fileinput │ │ │ │ ├── loading.gif │ │ │ │ └── loading-sm.gif │ │ │ │ ├── summernote │ │ │ │ └── font │ │ │ │ │ ├── summernote.eot │ │ │ │ │ ├── summernote.ttf │ │ │ │ │ ├── summernote.woff │ │ │ │ │ └── summernote.woff2 │ │ │ │ ├── jquery-ztree │ │ │ │ └── 3.5 │ │ │ │ │ └── css │ │ │ │ │ ├── metro │ │ │ │ │ └── img │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── line_conn.png │ │ │ │ │ │ └── loading.gif │ │ │ │ │ ├── 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 │ │ │ │ ├── layui │ │ │ │ └── css │ │ │ │ │ └── modules │ │ │ │ │ └── laydate │ │ │ │ │ └── default │ │ │ │ │ └── font │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ └── iconfont.woff │ │ │ │ ├── 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 │ │ │ ├── unauth.html │ │ │ └── 404.html │ │ ├── shop │ │ │ ├── info │ │ │ │ └── charts.html │ │ │ └── car │ │ │ │ ├── add.html │ │ │ │ └── edit.html │ │ └── system │ │ │ ├── user │ │ │ └── resetPwd.html │ │ │ ├── dict │ │ │ └── type │ │ │ │ └── tree.html │ │ │ ├── menu │ │ │ └── tree.html │ │ │ └── dept │ │ │ └── tree.html │ ├── mybatis │ │ ├── mybatis-config.xml │ │ └── system │ │ │ ├── UserPostMapper.xml │ │ │ ├── RoleDeptMapper.xml │ │ │ ├── RoleMenuMapper.xml │ │ │ └── UserRoleMapper.xml │ └── application-druid.yml │ └── java │ └── com │ └── book │ ├── framework │ ├── aspectj │ │ ├── lang │ │ │ ├── enums │ │ │ │ ├── DataSourceType.java │ │ │ │ ├── BusinessStatus.java │ │ │ │ ├── OperatorType.java │ │ │ │ └── BusinessType.java │ │ │ └── annotation │ │ │ │ ├── Excels.java │ │ │ │ ├── DataScope.java │ │ │ │ ├── DataSource.java │ │ │ │ └── Log.java │ │ └── DataSourceAspect.java │ ├── config │ │ ├── ApplicationConfig.java │ │ ├── ServerConfig.java │ │ ├── I18nConfig.java │ │ ├── GenConfig.java │ │ ├── FilterConfig.java │ │ ├── ResourcesConfig.java │ │ └── ThreadPoolConfig.java │ ├── interceptor │ │ ├── annotation │ │ │ └── RepeatSubmit.java │ │ └── RepeatSubmitInterceptor.java │ ├── web │ │ ├── service │ │ │ ├── ConfigService.java │ │ │ ├── DictService.java │ │ │ └── CacheService.java │ │ ├── domain │ │ │ ├── CxSelect.java │ │ │ ├── TreeEntity.java │ │ │ └── Ztree.java │ │ └── page │ │ │ ├── TableSupport.java │ │ │ ├── TableDataInfo.java │ │ │ └── PageDomain.java │ ├── datasource │ │ ├── DynamicDataSource.java │ │ └── DynamicDataSourceContextHolder.java │ ├── manager │ │ └── AsyncManager.java │ └── shiro │ │ ├── web │ │ └── filter │ │ │ └── sync │ │ │ └── SyncOnlineSessionFilter.java │ │ └── session │ │ └── OnlineSessionFactory.java │ ├── common │ ├── exception │ │ ├── DemoModeException.java │ │ ├── user │ │ │ ├── CaptchaException.java │ │ │ ├── UserBlockedException.java │ │ │ ├── RoleBlockedException.java │ │ │ ├── UserDeleteException.java │ │ │ ├── UserNotExistsException.java │ │ │ ├── UserPasswordNotMatchException.java │ │ │ ├── UserException.java │ │ │ ├── UserPasswordRetryLimitCountException.java │ │ │ └── UserPasswordRetryLimitExceedException.java │ │ ├── file │ │ │ ├── FileException.java │ │ │ ├── FileSizeLimitExceededException.java │ │ │ └── FileNameLengthLimitExceededException.java │ │ ├── UtilException.java │ │ ├── job │ │ │ └── TaskException.java │ │ ├── GlobalException.java │ │ └── ServiceException.java │ ├── utils │ │ ├── poi │ │ │ └── ExcelHandlerAdapter.java │ │ ├── MessageUtils.java │ │ ├── bean │ │ │ └── BeanValidators.java │ │ ├── security │ │ │ ├── AuthorizationUtils.java │ │ │ ├── CipherUtils.java │ │ │ └── ShiroUtils.java │ │ ├── PageUtils.java │ │ ├── ExceptionUtil.java │ │ ├── uuid │ │ │ ├── IdUtils.java │ │ │ └── Seq.java │ │ ├── sql │ │ │ └── SqlUtil.java │ │ ├── AddressUtils.java │ │ ├── MapDataUtil.java │ │ ├── Md5Utils.java │ │ └── file │ │ │ ├── MimeTypeUtils.java │ │ │ └── FileTypeUtils.java │ ├── constant │ │ ├── PermissionConstants.java │ │ ├── CommonMap.java │ │ └── ShiroConstants.java │ └── xss │ │ ├── Xss.java │ │ ├── XssValidator.java │ │ └── XssHttpServletRequestWrapper.java │ ├── project │ ├── 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 │ │ │ │ └── NoticeServiceImpl.java │ │ ├── dict │ │ │ ├── service │ │ │ │ └── IDictDataService.java │ │ │ └── mapper │ │ │ │ ├── DictTypeMapper.java │ │ │ │ └── DictDataMapper.java │ │ ├── config │ │ │ ├── mapper │ │ │ │ └── ConfigMapper.java │ │ │ └── service │ │ │ │ └── IConfigService.java │ │ └── post │ │ │ ├── mapper │ │ │ └── PostMapper.java │ │ │ └── service │ │ │ └── IPostService.java │ ├── monitor │ │ ├── druid │ │ │ └── DruidController.java │ │ ├── logininfor │ │ │ ├── service │ │ │ │ ├── ILogininforService.java │ │ │ │ └── LogininforServiceImpl.java │ │ │ └── mapper │ │ │ │ └── LogininforMapper.java │ │ ├── server │ │ │ ├── controller │ │ │ │ └── ServerController.java │ │ │ └── domain │ │ │ │ ├── Mem.java │ │ │ │ ├── Sys.java │ │ │ │ ├── Cpu.java │ │ │ │ └── SysFile.java │ │ ├── operlog │ │ │ ├── service │ │ │ │ ├── IOperLogService.java │ │ │ │ └── OperLogServiceImpl.java │ │ │ └── mapper │ │ │ │ └── OperLogMapper.java │ │ └── online │ │ │ ├── mapper │ │ │ └── UserOnlineMapper.java │ │ │ └── service │ │ │ └── IUserOnlineService.java │ └── shop │ │ ├── car │ │ ├── mapper │ │ │ └── BookCarMapper.java │ │ └── service │ │ │ └── IBookCarService.java │ │ ├── pic │ │ ├── mapper │ │ │ └── BookPicMapper.java │ │ ├── service │ │ │ └── IBookPicService.java │ │ └── domain │ │ │ └── BookPic.java │ │ ├── order │ │ ├── mapper │ │ │ └── BookOrderMapper.java │ │ └── service │ │ │ ├── IBookOrderService.java │ │ │ └── impl │ │ │ └── BookOrderServiceImpl.java │ │ ├── comments │ │ ├── mapper │ │ │ └── BookCommentsMapper.java │ │ └── service │ │ │ └── IBookCommentsService.java │ │ └── info │ │ ├── mapper │ │ └── BookInfoMapper.java │ │ └── service │ │ └── IBookInfoService.java │ └── BookApplication.java ├── .DS_Store ├── .gitattributes └── README.md /src/main/resources/static/file/rml.txt: -------------------------------------------------------------------------------- 1 | 下载临时目录 -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | *.vue linguist-language=java -------------------------------------------------------------------------------- /src/main/resources/static/ruoyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ruoyi.png -------------------------------------------------------------------------------- /src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/img/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/blue.png -------------------------------------------------------------------------------- /src/main/resources/static/img/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/locked.png -------------------------------------------------------------------------------- /src/main/resources/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/user.png -------------------------------------------------------------------------------- /src/main/resources/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/img/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/profile.jpg -------------------------------------------------------------------------------- /src/main/resources/static/img/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/progress.png -------------------------------------------------------------------------------- /src/main/resources/static/img/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/qr_code.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/zenicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/zenicon.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/resources/static/img/loading-upload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/loading-upload.gif -------------------------------------------------------------------------------- /src/main/resources/static/img/login-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/img/login-background.jpg -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/iCheck/green.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/iCheck/green@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/green-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/iCheck/green-login.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layer/theme/default/icon.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/moon/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/summernote/font/summernote.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/summernote/font/summernote.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/default/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/metro/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/simple/img/left_menu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/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/simple/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/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/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/BookstoreManagementSystem/HEAD/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff -------------------------------------------------------------------------------- /src/main/java/com/book/framework/aspectj/lang/enums/DataSourceType.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/aspectj/lang/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/DemoModeException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/CaptchaException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/aspectj/lang/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/RoleBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserDeleteException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserNotExistsException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/utils/poi/ExcelHandlerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.poi; 2 | 3 | /** 4 | * Excel数据格式处理适配器 5 | * 6 | * @author ruoyi 7 | */ 8 | public interface ExcelHandlerAdapter 9 | { 10 | /** 11 | * 格式化 12 | * 13 | * @param value 单元格数据值 14 | * @param args excel注解args参数组 15 | * 16 | * @return 处理后的值 17 | */ 18 | Object format(Object value, String[] args); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/exception/user/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserException.java: -------------------------------------------------------------------------------- 1 | package com.book.common.exception.user; 2 | 3 | import com.book.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/book/common/exception/file/FileException.java: -------------------------------------------------------------------------------- 1 | package com.book.common.exception.file; 2 | 3 | import com.book.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/book/common/exception/file/FileSizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/aspectj/lang/annotation/Excels.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserPasswordRetryLimitCountException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/user/UserPasswordRetryLimitExceedException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/exception/file/FileNameLengthLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/config/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.project.**.mapper") 17 | public class ApplicationConfig 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/exception/UtilException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/system/user/domain/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.book.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/java/com/book/BookApplication.java: -------------------------------------------------------------------------------- 1 | package com.book; 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 11 | */ 12 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) 13 | public class BookApplication 14 | { 15 | public static void main(String[] args) 16 | { 17 | // System.setProperty("spring.devtools.restart.enabled", "false"); 18 | SpringApplication.run(BookApplication.class, args); 19 | System.out.println("启动成功\n"); 20 | } 21 | } -------------------------------------------------------------------------------- /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/book/common/constant/PermissionConstants.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/aspectj/lang/annotation/DataScope.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/interceptor/annotation/RepeatSubmit.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/web/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.web.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.book.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/book/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils; 2 | 3 | import org.springframework.context.MessageSource; 4 | import org.springframework.context.i18n.LocaleContextHolder; 5 | import com.book.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/book/common/xss/Xss.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/utils/bean/BeanValidators.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/exception/job/TaskException.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/monitor/druid/DruidController.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.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/book/common/utils/security/AuthorizationUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.security; 2 | 3 | import org.apache.shiro.SecurityUtils; 4 | import org.apache.shiro.mgt.RealmSecurityManager; 5 | import com.book.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/book/framework/aspectj/lang/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/datasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/framework/aspectj/lang/annotation/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.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/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/book/project/monitor/logininfor/service/ILogininforService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.logininfor.service; 2 | 3 | import java.util.List; 4 | import com.book.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/java/com/book/framework/config/ServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.springframework.stereotype.Component; 5 | import com.book.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/java/com/book/project/monitor/logininfor/mapper/LogininforMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.logininfor.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/java/com/book/project/system/role/mapper/RoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/book/common/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.book.common.utils.sql.SqlUtil; 5 | import com.book.framework.web.page.PageDomain; 6 | import com.book.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 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) 24 | { 25 | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); 26 | Boolean reasonable = pageDomain.getReasonable(); 27 | PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/security/CipherUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/system/user/mapper/UserPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.user.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/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/book/project/system/role/mapper/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/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/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/java/com/book/common/xss/XssValidator.java: -------------------------------------------------------------------------------- 1 | package com.book.common.xss; 2 | 3 | import com.book.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 | Pattern pattern = Pattern.compile(HTML_PATTERN); 31 | Matcher matcher = pattern.matcher(value); 32 | return matcher.matches(); 33 | } 34 | } -------------------------------------------------------------------------------- /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/book/common/utils/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import org.apache.commons.lang3.exception.ExceptionUtils; 6 | 7 | /** 8 | * 错误信息处理类。 9 | * 10 | * @author ruoyi 11 | */ 12 | public class ExceptionUtil 13 | { 14 | /** 15 | * 获取exception的详细错误信息。 16 | */ 17 | public static String getExceptionMessage(Throwable e) 18 | { 19 | StringWriter sw = new StringWriter(); 20 | e.printStackTrace(new PrintWriter(sw, true)); 21 | return sw.toString(); 22 | } 23 | 24 | public static String getRootErrorMessage(Exception e) 25 | { 26 | Throwable root = ExceptionUtils.getRootCause(e); 27 | root = (root == null ? e : root); 28 | if (root == null) 29 | { 30 | return ""; 31 | } 32 | String msg = root.getMessage(); 33 | if (msg == null) 34 | { 35 | return "null"; 36 | } 37 | return StringUtils.defaultString(msg); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/uuid/IdUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/monitor/server/controller/ServerController.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.framework.web.controller.BaseController; 9 | import com.book.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/book/project/monitor/operlog/service/IOperLogService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.operlog.service; 2 | 3 | import java.util.List; 4 | import com.book.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/book/project/system/user/domain/UserPost.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/monitor/operlog/mapper/OperLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.operlog.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/book/project/system/role/domain/RoleDept.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/system/role/domain/RoleMenu.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/system/user/domain/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/system/notice/mapper/NoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.notice.mapper; 2 | 3 | import com.book.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/book/project/system/notice/service/INoticeService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.notice.service; 2 | 3 | import com.book.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/book/framework/datasource/DynamicDataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/common/xss/XssHttpServletRequestWrapper.java: -------------------------------------------------------------------------------- 1 | package com.book.common.xss; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletRequestWrapper; 5 | import com.book.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/book/framework/aspectj/lang/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.framework.aspectj.lang.enums.BusinessType; 9 | import com.book.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 | -------------------------------------------------------------------------------- /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 | user.logout.success=退出成功 12 | 13 | length.not.valid=长度必须在{min}到{max}个字符之间 14 | 15 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 16 | user.password.not.valid=* 5-50个字符 17 | 18 | user.email.not.valid=邮箱格式错误 19 | user.mobile.phone.number.not.valid=手机号格式错误 20 | user.login.success=登录成功 21 | user.register.success=注册成功 22 | user.notfound=请重新登录 23 | user.forcelogout=管理员强制退出,请重新登录 24 | user.unknown.error=未知错误,请重新登录 25 | 26 | ##文件上传消息 27 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 28 | upload.filename.exceed.length=上传的文件名最长{0}个字符 29 | 30 | ##权限 31 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 32 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 33 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 34 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 35 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 36 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 37 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/monitor/server/domain/Mem.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.server.domain; 2 | 3 | import com.book.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/book/common/exception/GlobalException.java: -------------------------------------------------------------------------------- 1 | package com.book.common.exception; 2 | 3 | /** 4 | * 全局异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class GlobalException extends RuntimeException 9 | { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | /** 14 | * 错误提示 15 | */ 16 | private String message; 17 | 18 | /** 19 | * 错误明细,内部调试错误 20 | * 21 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 22 | */ 23 | private String detailMessage; 24 | 25 | /** 26 | * 空构造方法,避免反序列化问题 27 | */ 28 | public GlobalException() 29 | { 30 | } 31 | 32 | public GlobalException(String message) 33 | { 34 | this.message = message; 35 | } 36 | 37 | public String getDetailMessage() 38 | { 39 | return detailMessage; 40 | } 41 | 42 | public GlobalException setDetailMessage(String detailMessage) 43 | { 44 | this.detailMessage = detailMessage; 45 | return this; 46 | } 47 | 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/book/project/monitor/online/mapper/UserOnlineMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.online.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/java/com/book/common/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | public String getMessage() 48 | { 49 | return message; 50 | } 51 | 52 | public ServiceException setMessage(String message) 53 | { 54 | this.message = message; 55 | return this; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/book/framework/web/domain/CxSelect.java: -------------------------------------------------------------------------------- 1 | package com.book.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/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/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/java/com/book/framework/web/service/DictService.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.project.system.dict.domain.DictData; 7 | import com.book.project.system.dict.service.IDictDataService; 8 | import com.book.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/book/project/shop/car/mapper/BookCarMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.car.mapper; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.car.domain.BookCar; 5 | 6 | /** 7 | * 购物车Mapper接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface BookCarMapper 13 | { 14 | /** 15 | * 查询购物车 16 | * 17 | * @param id 购物车主键 18 | * @return 购物车 19 | */ 20 | public BookCar selectBookCarById(Long id); 21 | 22 | /** 23 | * 查询购物车列表 24 | * 25 | * @param bookCar 购物车 26 | * @return 购物车集合 27 | */ 28 | public List selectBookCarList(BookCar bookCar); 29 | 30 | /** 31 | * 新增购物车 32 | * 33 | * @param bookCar 购物车 34 | * @return 结果 35 | */ 36 | public int insertBookCar(BookCar bookCar); 37 | 38 | /** 39 | * 修改购物车 40 | * 41 | * @param bookCar 购物车 42 | * @return 结果 43 | */ 44 | public int updateBookCar(BookCar bookCar); 45 | 46 | /** 47 | * 删除购物车 48 | * 49 | * @param id 购物车主键 50 | * @return 结果 51 | */ 52 | public int deleteBookCarById(Long id); 53 | 54 | /** 55 | * 批量删除购物车 56 | * 57 | * @param ids 需要删除的数据主键集合 58 | * @return 结果 59 | */ 60 | public int deleteBookCarByIds(String[] ids); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/pic/mapper/BookPicMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.pic.mapper; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.pic.domain.BookPic; 5 | 6 | /** 7 | * 轮播图Mapper接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface BookPicMapper 13 | { 14 | /** 15 | * 查询轮播图 16 | * 17 | * @param id 轮播图主键 18 | * @return 轮播图 19 | */ 20 | public BookPic selectBookPicById(Long id); 21 | 22 | /** 23 | * 查询轮播图列表 24 | * 25 | * @param bookPic 轮播图 26 | * @return 轮播图集合 27 | */ 28 | public List selectBookPicList(BookPic bookPic); 29 | 30 | /** 31 | * 新增轮播图 32 | * 33 | * @param bookPic 轮播图 34 | * @return 结果 35 | */ 36 | public int insertBookPic(BookPic bookPic); 37 | 38 | /** 39 | * 修改轮播图 40 | * 41 | * @param bookPic 轮播图 42 | * @return 结果 43 | */ 44 | public int updateBookPic(BookPic bookPic); 45 | 46 | /** 47 | * 删除轮播图 48 | * 49 | * @param id 轮播图主键 50 | * @return 结果 51 | */ 52 | public int deleteBookPicById(Long id); 53 | 54 | /** 55 | * 批量删除轮播图 56 | * 57 | * @param ids 需要删除的数据主键集合 58 | * @return 结果 59 | */ 60 | public int deleteBookPicByIds(String[] ids); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import com.book.common.utils.Threads; 7 | import com.book.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/book/project/shop/car/service/IBookCarService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.car.service; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.car.domain.BookCar; 5 | 6 | /** 7 | * 购物车Service接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface IBookCarService 13 | { 14 | /** 15 | * 查询购物车 16 | * 17 | * @param id 购物车主键 18 | * @return 购物车 19 | */ 20 | public BookCar selectBookCarById(Long id); 21 | 22 | /** 23 | * 查询购物车列表 24 | * 25 | * @param bookCar 购物车 26 | * @return 购物车集合 27 | */ 28 | public List selectBookCarList(BookCar bookCar); 29 | 30 | /** 31 | * 新增购物车 32 | * 33 | * @param bookCar 购物车 34 | * @return 结果 35 | */ 36 | public int insertBookCar(BookCar bookCar); 37 | 38 | /** 39 | * 修改购物车 40 | * 41 | * @param bookCar 购物车 42 | * @return 结果 43 | */ 44 | public int updateBookCar(BookCar bookCar); 45 | 46 | /** 47 | * 批量删除购物车 48 | * 49 | * @param ids 需要删除的购物车主键集合 50 | * @return 结果 51 | */ 52 | public int deleteBookCarByIds(String ids); 53 | 54 | /** 55 | * 删除购物车信息 56 | * 57 | * @param id 购物车主键 58 | * @return 结果 59 | */ 60 | public int deleteBookCarById(Long id); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/pic/service/IBookPicService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.pic.service; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.pic.domain.BookPic; 5 | 6 | /** 7 | * 轮播图Service接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface IBookPicService 13 | { 14 | /** 15 | * 查询轮播图 16 | * 17 | * @param id 轮播图主键 18 | * @return 轮播图 19 | */ 20 | public BookPic selectBookPicById(Long id); 21 | 22 | /** 23 | * 查询轮播图列表 24 | * 25 | * @param bookPic 轮播图 26 | * @return 轮播图集合 27 | */ 28 | public List selectBookPicList(BookPic bookPic); 29 | 30 | /** 31 | * 新增轮播图 32 | * 33 | * @param bookPic 轮播图 34 | * @return 结果 35 | */ 36 | public int insertBookPic(BookPic bookPic); 37 | 38 | /** 39 | * 修改轮播图 40 | * 41 | * @param bookPic 轮播图 42 | * @return 结果 43 | */ 44 | public int updateBookPic(BookPic bookPic); 45 | 46 | /** 47 | * 批量删除轮播图 48 | * 49 | * @param ids 需要删除的轮播图主键集合 50 | * @return 结果 51 | */ 52 | public int deleteBookPicByIds(String ids); 53 | 54 | /** 55 | * 删除轮播图信息 56 | * 57 | * @param id 轮播图主键 58 | * @return 结果 59 | */ 60 | public int deleteBookPicById(Long id); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/web/domain/TreeEntity.java: -------------------------------------------------------------------------------- 1 | package com.book.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/java/com/book/project/shop/order/mapper/BookOrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.order.mapper; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.order.domain.BookOrder; 5 | 6 | /** 7 | * 订单Mapper接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface BookOrderMapper 13 | { 14 | /** 15 | * 查询订单 16 | * 17 | * @param id 订单主键 18 | * @return 订单 19 | */ 20 | public BookOrder selectBookOrderById(Long id); 21 | 22 | /** 23 | * 查询订单列表 24 | * 25 | * @param bookOrder 订单 26 | * @return 订单集合 27 | */ 28 | public List selectBookOrderList(BookOrder bookOrder); 29 | 30 | /** 31 | * 新增订单 32 | * 33 | * @param bookOrder 订单 34 | * @return 结果 35 | */ 36 | public int insertBookOrder(BookOrder bookOrder); 37 | 38 | /** 39 | * 修改订单 40 | * 41 | * @param bookOrder 订单 42 | * @return 结果 43 | */ 44 | public int updateBookOrder(BookOrder bookOrder); 45 | 46 | /** 47 | * 删除订单 48 | * 49 | * @param id 订单主键 50 | * @return 结果 51 | */ 52 | public int deleteBookOrderById(Long id); 53 | 54 | /** 55 | * 批量删除订单 56 | * 57 | * @param ids 需要删除的数据主键集合 58 | * @return 结果 59 | */ 60 | public int deleteBookOrderByIds(String[] ids); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/order/service/IBookOrderService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.order.service; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.order.domain.BookOrder; 5 | 6 | /** 7 | * 订单Service接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface IBookOrderService 13 | { 14 | /** 15 | * 查询订单 16 | * 17 | * @param id 订单主键 18 | * @return 订单 19 | */ 20 | public BookOrder selectBookOrderById(Long id); 21 | 22 | /** 23 | * 查询订单列表 24 | * 25 | * @param bookOrder 订单 26 | * @return 订单集合 27 | */ 28 | public List selectBookOrderList(BookOrder bookOrder); 29 | 30 | /** 31 | * 新增订单 32 | * 33 | * @param bookOrder 订单 34 | * @return 结果 35 | */ 36 | public int insertBookOrder(BookOrder bookOrder); 37 | 38 | /** 39 | * 修改订单 40 | * 41 | * @param bookOrder 订单 42 | * @return 结果 43 | */ 44 | public int updateBookOrder(BookOrder bookOrder); 45 | 46 | /** 47 | * 批量删除订单 48 | * 49 | * @param ids 需要删除的订单主键集合 50 | * @return 结果 51 | */ 52 | public int deleteBookOrderByIds(String ids); 53 | 54 | /** 55 | * 删除订单信息 56 | * 57 | * @param id 订单主键 58 | * @return 结果 59 | */ 60 | public int deleteBookOrderById(Long id); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/comments/mapper/BookCommentsMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.comments.mapper; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.comments.domain.BookComments; 5 | 6 | /** 7 | * 评论Mapper接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface BookCommentsMapper 13 | { 14 | /** 15 | * 查询评论 16 | * 17 | * @param id 评论主键 18 | * @return 评论 19 | */ 20 | public BookComments selectBookCommentsById(Long id); 21 | 22 | /** 23 | * 查询评论列表 24 | * 25 | * @param bookComments 评论 26 | * @return 评论集合 27 | */ 28 | public List selectBookCommentsList(BookComments bookComments); 29 | 30 | /** 31 | * 新增评论 32 | * 33 | * @param bookComments 评论 34 | * @return 结果 35 | */ 36 | public int insertBookComments(BookComments bookComments); 37 | 38 | /** 39 | * 修改评论 40 | * 41 | * @param bookComments 评论 42 | * @return 结果 43 | */ 44 | public int updateBookComments(BookComments bookComments); 45 | 46 | /** 47 | * 删除评论 48 | * 49 | * @param id 评论主键 50 | * @return 结果 51 | */ 52 | public int deleteBookCommentsById(Long id); 53 | 54 | /** 55 | * 批量删除评论 56 | * 57 | * @param ids 需要删除的数据主键集合 58 | * @return 结果 59 | */ 60 | public int deleteBookCommentsByIds(String[] ids); 61 | } 62 | -------------------------------------------------------------------------------- /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/book/project/shop/comments/service/IBookCommentsService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.comments.service; 2 | 3 | import java.util.List; 4 | import com.book.project.shop.comments.domain.BookComments; 5 | 6 | /** 7 | * 评论Service接口 8 | * 9 | * @author book 10 | * @date 2022-05-08 11 | */ 12 | public interface IBookCommentsService 13 | { 14 | /** 15 | * 查询评论 16 | * 17 | * @param id 评论主键 18 | * @return 评论 19 | */ 20 | public BookComments selectBookCommentsById(Long id); 21 | 22 | /** 23 | * 查询评论列表 24 | * 25 | * @param bookComments 评论 26 | * @return 评论集合 27 | */ 28 | public List selectBookCommentsList(BookComments bookComments); 29 | 30 | /** 31 | * 新增评论 32 | * 33 | * @param bookComments 评论 34 | * @return 结果 35 | */ 36 | public int insertBookComments(BookComments bookComments); 37 | 38 | /** 39 | * 修改评论 40 | * 41 | * @param bookComments 评论 42 | * @return 结果 43 | */ 44 | public int updateBookComments(BookComments bookComments); 45 | 46 | /** 47 | * 批量删除评论 48 | * 49 | * @param ids 需要删除的评论主键集合 50 | * @return 结果 51 | */ 52 | public int deleteBookCommentsByIds(String ids); 53 | 54 | /** 55 | * 删除评论信息 56 | * 57 | * @param id 评论主键 58 | * @return 结果 59 | */ 60 | public int deleteBookCommentsById(Long id); 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/info/mapper/BookInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.info.mapper; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.book.project.shop.info.domain.BookInfo; 7 | 8 | /** 9 | * 书籍信息Mapper接口 10 | * 11 | * @author book 12 | * @date 2022-05-08 13 | */ 14 | public interface BookInfoMapper 15 | { 16 | List> charts(); 17 | /** 18 | * 查询书籍信息 19 | * 20 | * @param id 书籍信息主键 21 | * @return 书籍信息 22 | */ 23 | public BookInfo selectBookInfoById(Long id); 24 | 25 | /** 26 | * 查询书籍信息列表 27 | * 28 | * @param bookInfo 书籍信息 29 | * @return 书籍信息集合 30 | */ 31 | public List selectBookInfoList(BookInfo bookInfo); 32 | 33 | /** 34 | * 新增书籍信息 35 | * 36 | * @param bookInfo 书籍信息 37 | * @return 结果 38 | */ 39 | public int insertBookInfo(BookInfo bookInfo); 40 | 41 | /** 42 | * 修改书籍信息 43 | * 44 | * @param bookInfo 书籍信息 45 | * @return 结果 46 | */ 47 | public int updateBookInfo(BookInfo bookInfo); 48 | 49 | /** 50 | * 删除书籍信息 51 | * 52 | * @param id 书籍信息主键 53 | * @return 结果 54 | */ 55 | public int deleteBookInfoById(Long id); 56 | 57 | /** 58 | * 批量删除书籍信息 59 | * 60 | * @param ids 需要删除的数据主键集合 61 | * @return 结果 62 | */ 63 | public int deleteBookInfoByIds(String[] ids); 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/dict/service/IDictDataService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.dict.service; 2 | 3 | import java.util.List; 4 | import com.book.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/book/framework/config/I18nConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.config; 2 | 3 | import java.util.Locale; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.LocaleResolver; 7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; 10 | import org.springframework.web.servlet.i18n.SessionLocaleResolver; 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(Locale.SIMPLIFIED_CHINESE); 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/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/book/framework/shiro/web/filter/sync/SyncOnlineSessionFilter.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.constant.ShiroConstants; 7 | import com.book.framework.shiro.session.OnlineSessionDAO; 8 | import com.book.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/book/project/shop/info/service/IBookInfoService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.info.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | import java.util.Objects; 6 | 7 | import com.book.project.shop.info.domain.BookInfo; 8 | 9 | /** 10 | * 书籍信息Service接口 11 | * 12 | * @author book 13 | * @date 2022-05-08 14 | */ 15 | public interface IBookInfoService 16 | { 17 | 18 | List> charts(); 19 | /** 20 | * 查询书籍信息 21 | * 22 | * @param id 书籍信息主键 23 | * @return 书籍信息 24 | */ 25 | public BookInfo selectBookInfoById(Long id); 26 | 27 | /** 28 | * 查询书籍信息列表 29 | * 30 | * @param bookInfo 书籍信息 31 | * @return 书籍信息集合 32 | */ 33 | public List selectBookInfoList(BookInfo bookInfo); 34 | 35 | /** 36 | * 新增书籍信息 37 | * 38 | * @param bookInfo 书籍信息 39 | * @return 结果 40 | */ 41 | public int insertBookInfo(BookInfo bookInfo); 42 | 43 | /** 44 | * 修改书籍信息 45 | * 46 | * @param bookInfo 书籍信息 47 | * @return 结果 48 | */ 49 | public int updateBookInfo(BookInfo bookInfo); 50 | 51 | /** 52 | * 批量删除书籍信息 53 | * 54 | * @param ids 需要删除的书籍信息主键集合 55 | * @return 结果 56 | */ 57 | public int deleteBookInfoByIds(String ids); 58 | 59 | /** 60 | * 删除书籍信息信息 61 | * 62 | * @param id 书籍信息主键 63 | * @return 结果 64 | */ 65 | public int deleteBookInfoById(Long id); 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/web/page/TableSupport.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.web.page; 2 | 3 | import com.book.common.utils.ServletUtils; 4 | 5 | /** 6 | * 表格数据处理 7 | * 8 | * @author ruoyi 9 | */ 10 | public class TableSupport 11 | { 12 | /** 13 | * 当前记录起始索引 14 | */ 15 | public static final String PAGE_NUM = "pageNum"; 16 | 17 | /** 18 | * 每页显示记录数 19 | */ 20 | public static final String PAGE_SIZE = "pageSize"; 21 | 22 | /** 23 | * 排序列 24 | */ 25 | public static final String ORDER_BY_COLUMN = "orderByColumn"; 26 | 27 | /** 28 | * 排序的方向 "desc" 或者 "asc". 29 | */ 30 | public static final String IS_ASC = "isAsc"; 31 | 32 | /** 33 | * 分页参数合理化 34 | */ 35 | public static final String REASONABLE = "reasonable"; 36 | 37 | /** 38 | * 封装分页对象 39 | */ 40 | public static PageDomain getPageDomain() 41 | { 42 | PageDomain pageDomain = new PageDomain(); 43 | pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); 44 | pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); 45 | pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); 46 | pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); 47 | pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); 48 | return pageDomain; 49 | } 50 | 51 | public static PageDomain buildPageRequest() 52 | { 53 | return getPageDomain(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/config/mapper/ConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.config.mapper; 2 | 3 | import com.book.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 | * 查询参数配置列表 23 | * 24 | * @param config 参数配置信息 25 | * @return 参数配置集合 26 | */ 27 | public List selectConfigList(Config config); 28 | 29 | /** 30 | * 根据键名查询参数配置信息 31 | * 32 | * @param configKey 参数键名 33 | * @return 参数配置信息 34 | */ 35 | public Config checkConfigKeyUnique(String configKey); 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 configId 参数主键 57 | * @return 结果 58 | */ 59 | public int deleteConfigById(Long configId); 60 | 61 | /** 62 | * 批量删除参数配置 63 | * 64 | * @param configIds 需要删除的数据ID 65 | * @return 结果 66 | */ 67 | public int deleteConfigByIds(String[] configIds); 68 | } -------------------------------------------------------------------------------- /src/main/resources/templates/shop/info/charts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 | 13 | 14 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /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 |
22 |
23 |
24 | 25 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 全目录 2 | 3 | [更多系统、论文,供君选择 ~~>](https://www.yuque.com/wisebit/blog) 4 | 5 | # 244.BookstoreManagementSystem 6 | 7 |

群: 983063232(入群获取sql文件)

8 |

QQ: 206157502(加好友获取sql文件)

9 | 10 |

244.书店管理系统

11 | 12 | 13 |

14 | 15 | 16 | 17 | 18 |

19 | 20 | # 简介 21 | 22 | > 本代码来源于网络,仅供学习参考使用,请入群(983063232)后联系群主索要sql文件! 23 | > 24 | > 提供1.远程部署/2.修改代码/3.设计文档指导/4.框架代码讲解等服务 25 | > 26 | > 后端登录地址:http://localhost:81/login 27 | > 28 | > 管理员: admin 密码: 123456 29 | > 30 | > 店家: manager 密码: 123456 31 | > 32 | > 用户: buyer 密码: 123456 33 | > 34 | 35 | # 环境 36 | 37 | - IntelliJ IDEA 2021.3 38 | 39 | - Mysql 5.7.26 40 | 41 | - Tomcat 7.0.73 42 | 43 | - JDK 1.8 44 | 45 | 46 | 47 | 48 | ## 缩略图 49 | 50 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/71c03213-1ba4-45a0-82ce-621b95ef13b2.png) 51 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/ed96a5a8-f15b-4685-add9-46c046e079f0.png) 52 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/659cab64-8f93-40e9-bce4-ac8b0a5e20ce.png) 53 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/02e5608c-edb2-419b-91e4-a9a2adbbf10e.png) 54 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/367ff1a5-a7ff-4b40-8968-1e9ea6d00d67.png) 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/config/GenConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | /** 自动去除表前缀,默认是true */ 22 | public static boolean autoRemovePre; 23 | 24 | /** 表前缀(类名不会包含表前缀) */ 25 | public static String tablePrefix; 26 | 27 | public static String getAuthor() 28 | { 29 | return author; 30 | } 31 | 32 | public void setAuthor(String author) 33 | { 34 | GenConfig.author = author; 35 | } 36 | 37 | public static String getPackageName() 38 | { 39 | return packageName; 40 | } 41 | 42 | public void setPackageName(String packageName) 43 | { 44 | GenConfig.packageName = packageName; 45 | } 46 | 47 | public static boolean getAutoRemovePre() 48 | { 49 | return autoRemovePre; 50 | } 51 | 52 | public void setAutoRemovePre(boolean autoRemovePre) 53 | { 54 | GenConfig.autoRemovePre = autoRemovePre; 55 | } 56 | 57 | public static String getTablePrefix() 58 | { 59 | return tablePrefix; 60 | } 61 | 62 | public void setTablePrefix(String tablePrefix) 63 | { 64 | GenConfig.tablePrefix = tablePrefix; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/user/controller/RegisterController.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.utils.StringUtils; 9 | import com.book.framework.shiro.service.RegisterService; 10 | import com.book.framework.web.controller.BaseController; 11 | import com.book.framework.web.domain.AjaxResult; 12 | import com.book.project.system.config.service.IConfigService; 13 | import com.book.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/book/common/constant/CommonMap.java: -------------------------------------------------------------------------------- 1 | package com.book.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/java/com/book/framework/web/page/TableDataInfo.java: -------------------------------------------------------------------------------- 1 | package com.book.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, int 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/book/project/monitor/server/domain/Sys.java: -------------------------------------------------------------------------------- 1 | package com.book.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/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/book/common/utils/sql/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.sql; 2 | 3 | import com.book.common.exception.UtilException; 4 | import com.book.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 = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; 17 | 18 | /** 19 | * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) 20 | */ 21 | public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; 22 | 23 | /** 24 | * 检查字符,防止注入绕过 25 | */ 26 | public static String escapeOrderBySql(String value) 27 | { 28 | if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) 29 | { 30 | throw new UtilException("参数不符合规范,不能进行查询"); 31 | } 32 | return value; 33 | } 34 | 35 | /** 36 | * 验证 order by 语法是否符合规范 37 | */ 38 | public static boolean isValidOrderBySql(String value) 39 | { 40 | return value.matches(SQL_PATTERN); 41 | } 42 | 43 | /** 44 | * SQL关键字检查 45 | */ 46 | public static void filterKeyword(String value) 47 | { 48 | if (StringUtils.isEmpty(value)) 49 | { 50 | return; 51 | } 52 | String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); 53 | for (String sqlKeyword : sqlKeywords) 54 | { 55 | if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) 56 | { 57 | throw new UtilException("参数存在SQL注入风险"); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/user/mapper/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.user.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.book.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/resources/templates/shop/car/add.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 |
26 |
27 |
28 |
29 | 30 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/config/FilterConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.utils.StringUtils; 12 | import com.book.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/book/common/utils/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import com.alibaba.fastjson.JSONObject; 6 | import com.book.common.constant.Constants; 7 | import com.book.common.utils.http.HttpUtils; 8 | import com.book.framework.config.BookConfig; 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 (BookConfig.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/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Dennis Hernández 3 | * @webSite: http://djhvscf.github.io/Blog 4 | * @version: v2.0.0 5 | */ 6 | 7 | const isInit = that => that.$el.data('resizableColumns') !== undefined 8 | 9 | const initResizable = that => { 10 | if ( 11 | that.options.resizable && 12 | !that.options.cardView && 13 | !isInit(that) && 14 | that.$el.is(':visible') 15 | ) { 16 | that.$el.resizableColumns({ 17 | store: window.store 18 | }) 19 | } 20 | } 21 | 22 | const destroy = that => { 23 | if (isInit(that)) { 24 | that.$el.data('resizableColumns').destroy() 25 | } 26 | } 27 | 28 | const reInitResizable = that => { 29 | destroy(that) 30 | initResizable(that) 31 | } 32 | 33 | $.extend($.fn.bootstrapTable.defaults, { 34 | resizable: false 35 | }) 36 | 37 | $.BootstrapTable = class extends $.BootstrapTable { 38 | 39 | initBody (...args) { 40 | super.initBody(...args) 41 | 42 | this.$el.off('column-switch.bs.table page-change.bs.table') 43 | .on('column-switch.bs.table page-change.bs.table', () => { 44 | reInitResizable(this) 45 | }) 46 | 47 | reInitResizable(this) 48 | } 49 | 50 | toggleView (...args) { 51 | super.toggleView(...args) 52 | 53 | if (this.options.resizable && this.options.cardView) { 54 | // Destroy the plugin 55 | destroy(this) 56 | } 57 | } 58 | 59 | resetView (...args) { 60 | super.resetView(...args) 61 | 62 | if (this.options.resizable) { 63 | // because in fitHeader function, we use setTimeout(func, 100); 64 | setTimeout(() => { 65 | initResizable(this) 66 | }, 100) 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/resources/templates/shop/car/edit.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 | 26 |
27 |
28 |
29 |
30 | 31 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/monitor/logininfor/service/LogininforServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.utils.text.Convert; 7 | import com.book.project.monitor.logininfor.domain.Logininfor; 8 | import com.book.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/java/com/book/project/system/post/mapper/PostMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.post.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/book/common/constant/ShiroConstants.java: -------------------------------------------------------------------------------- 1 | package com.book.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 | * 编码格式 37 | */ 38 | public static final String ENCODING = "UTF-8"; 39 | 40 | /** 41 | * 当前在线会话 42 | */ 43 | public static final String ONLINE_SESSION = "online_session"; 44 | 45 | /** 46 | * 验证码key 47 | */ 48 | public static final String CURRENT_CAPTCHA = "captcha"; 49 | 50 | /** 51 | * 验证码开关 52 | */ 53 | public static final String CURRENT_ENABLED = "captchaEnabled"; 54 | 55 | /** 56 | * 验证码类型 57 | */ 58 | public static final String CURRENT_TYPE = "captchaType"; 59 | 60 | /** 61 | * 验证码 62 | */ 63 | public static final String CURRENT_VALIDATECODE = "validateCode"; 64 | 65 | /** 66 | * 验证码错误 67 | */ 68 | public static final String CAPTCHA_ERROR = "captchaError"; 69 | 70 | /** 71 | * 登录记录缓存 72 | */ 73 | public static final String LOGINRECORDCACHE = "loginRecordCache"; 74 | 75 | /** 76 | * 系统活跃用户缓存 77 | */ 78 | public static final String SYS_USERCACHE = "sys-userCache"; 79 | } -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/MapDataUtil.java: -------------------------------------------------------------------------------- 1 | package com.book.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/book/project/monitor/online/service/IUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.online.service; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | import com.book.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/book/project/shop/pic/domain/BookPic.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.pic.domain; 2 | 3 | import com.book.framework.aspectj.lang.annotation.Excel; 4 | import com.book.framework.web.domain.BaseEntity; 5 | import org.apache.commons.lang3.builder.ToStringBuilder; 6 | import org.apache.commons.lang3.builder.ToStringStyle; 7 | 8 | /** 9 | * 轮播图对象 book_pic 10 | * 11 | * @author book 12 | * @date 2022-05-08 13 | */ 14 | public class BookPic extends BaseEntity 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** id */ 19 | private Long id; 20 | 21 | /** 图片地址 */ 22 | @Excel(name = "图片地址") 23 | private String picAdress; 24 | 25 | private String title; 26 | 27 | private Integer type; 28 | 29 | public Integer getType() { 30 | return type; 31 | } 32 | 33 | public void setType(Integer type) { 34 | this.type = type; 35 | } 36 | 37 | public String getTitle() { 38 | return title; 39 | } 40 | 41 | public void setTitle(String title) { 42 | this.title = title; 43 | } 44 | 45 | public void setId(Long id) 46 | { 47 | this.id = id; 48 | } 49 | 50 | public Long getId() 51 | { 52 | return id; 53 | } 54 | public void setPicAdress(String picAdress) 55 | { 56 | this.picAdress = picAdress; 57 | } 58 | 59 | public String getPicAdress() 60 | { 61 | return picAdress; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) 67 | .append("id", getId()) 68 | .append("picAdress", getPicAdress()) 69 | .append("createTime", getCreateTime()) 70 | .toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/config/service/IConfigService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.config.service; 2 | 3 | import com.book.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 String checkConfigKeyUnique(Config config); 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/role/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.role.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/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/book/common/utils/Md5Utils.java: -------------------------------------------------------------------------------- 1 | package com.book.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/java/com/book/project/system/dict/mapper/DictTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.dict.mapper; 2 | 3 | import java.util.List; 4 | import com.book.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/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/book/project/monitor/operlog/service/OperLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.utils.text.Convert; 7 | import com.book.project.monitor.operlog.domain.OperLog; 8 | import com.book.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/java/com/book/common/utils/file/MimeTypeUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.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/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/book/project/system/post/service/IPostService.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.post.service; 2 | 3 | import java.util.List; 4 | import com.book.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 String checkPostNameUnique(Post post); 83 | 84 | /** 85 | * 校验岗位编码 86 | * 87 | * @param post 岗位信息 88 | * @return 结果 89 | */ 90 | public String checkPostCodeUnique(Post post); 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/web/page/PageDomain.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.web.page; 2 | 3 | import com.book.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/resources/application-druid.yml: -------------------------------------------------------------------------------- 1 | # 数据源配置 2 | spring: 3 | datasource: 4 | type: com.alibaba.druid.pool.DruidDataSource 5 | driverClassName: com.mysql.jdbc.Driver 6 | druid: 7 | # 主库数据源 8 | master: 9 | url: jdbc:mysql://127.0.0.1:3306/graduation_244_book_shop 10 | username: root 11 | password: 123456 12 | # 从库数据源 13 | slave: 14 | # 从数据源开关/默认关闭 15 | enabled: false 16 | url: 17 | username: 18 | password: 19 | # 初始连接数 20 | initialSize: 5 21 | # 最小连接池数量 22 | minIdle: 10 23 | # 最大连接池数量 24 | maxActive: 20 25 | # 配置获取连接等待超时的时间 26 | maxWait: 60000 27 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 28 | timeBetweenEvictionRunsMillis: 60000 29 | # 配置一个连接在池中最小生存的时间,单位是毫秒 30 | minEvictableIdleTimeMillis: 300000 31 | # 配置一个连接在池中最大生存的时间,单位是毫秒 32 | maxEvictableIdleTimeMillis: 900000 33 | # 配置检测连接是否有效 34 | validationQuery: SELECT 1 FROM DUAL 35 | testWhileIdle: true 36 | testOnBorrow: false 37 | testOnReturn: false 38 | webStatFilter: 39 | enabled: true 40 | statViewServlet: 41 | enabled: true 42 | # 设置白名单,不填则允许所有访问 43 | allow: 44 | url-pattern: /druid/* 45 | # 控制台管理用户名和密码 46 | login-username: ruoyi 47 | login-password: 123456 48 | filter: 49 | stat: 50 | enabled: true 51 | # 慢SQL记录 52 | log-slow-sql: true 53 | slow-sql-millis: 1000 54 | merge-sql: true 55 | wall: 56 | config: 57 | multi-statement-allow: true -------------------------------------------------------------------------------- /src/main/java/com/book/framework/interceptor/RepeatSubmitInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.utils.ServletUtils; 11 | import com.book.framework.interceptor.annotation.RepeatSubmit; 12 | import com.book.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/book/framework/config/ResourcesConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.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.book.common.constant.Constants; 11 | import com.book.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:" + BookConfig.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/book/framework/web/service/CacheService.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.web.service; 2 | 3 | import java.util.Set; 4 | import org.apache.commons.lang3.ArrayUtils; 5 | import org.springframework.stereotype.Service; 6 | import com.book.common.constant.Constants; 7 | import com.book.common.utils.CacheUtils; 8 | 9 | /** 10 | * 缓存操作处理 11 | * 12 | * @author ruoyi 13 | */ 14 | @Service 15 | public class CacheService 16 | { 17 | /** 18 | * 获取所有缓存名称 19 | * 20 | * @return 缓存列表 21 | */ 22 | public String[] getCacheNames() 23 | { 24 | String[] cacheNames = CacheUtils.getCacheNames(); 25 | return ArrayUtils.removeElement(cacheNames, Constants.SYS_AUTH_CACHE); 26 | } 27 | 28 | /** 29 | * 根据缓存名称获取所有键名 30 | * 31 | * @param cacheName 缓存名称 32 | * @return 键名列表 33 | */ 34 | public Set getCacheKeys(String cacheName) 35 | { 36 | return CacheUtils.getCache(cacheName).keys(); 37 | } 38 | 39 | /** 40 | * 根据缓存名称和键名获取内容值 41 | * 42 | * @param cacheName 缓存名称 43 | * @param cacheKey 键名 44 | * @return 键值 45 | */ 46 | public Object getCacheValue(String cacheName, String cacheKey) 47 | { 48 | return CacheUtils.get(cacheName, cacheKey); 49 | } 50 | 51 | /** 52 | * 根据名称删除缓存信息 53 | * 54 | * @param cacheName 缓存名称 55 | */ 56 | public void clearCacheName(String cacheName) 57 | { 58 | CacheUtils.removeAll(cacheName); 59 | } 60 | 61 | /** 62 | * 根据名称和键名删除缓存信息 63 | * 64 | * @param cacheName 缓存名称 65 | * @param cacheKey 键名 66 | */ 67 | public void clearCacheKey(String cacheName, String cacheKey) 68 | { 69 | CacheUtils.remove(cacheName, cacheKey); 70 | } 71 | 72 | /** 73 | * 清理所有缓存 74 | */ 75 | public void clearAll() 76 | { 77 | String[] cacheNames = getCacheNames(); 78 | for (String cacheName : cacheNames) 79 | { 80 | CacheUtils.removeAll(cacheName); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /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/book/project/monitor/server/domain/Cpu.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.server.domain; 2 | 3 | import com.book.common.utils.Arith; 4 | 5 | /** 6 | * CPU相关信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Cpu 11 | { 12 | /** 13 | * 核心数 14 | */ 15 | private int cpuNum; 16 | 17 | /** 18 | * CPU总的使用率 19 | */ 20 | private double total; 21 | 22 | /** 23 | * CPU系统使用率 24 | */ 25 | private double sys; 26 | 27 | /** 28 | * CPU用户使用率 29 | */ 30 | private double used; 31 | 32 | /** 33 | * CPU当前等待率 34 | */ 35 | private double wait; 36 | 37 | /** 38 | * CPU当前空闲率 39 | */ 40 | private double free; 41 | 42 | public int getCpuNum() 43 | { 44 | return cpuNum; 45 | } 46 | 47 | public void setCpuNum(int cpuNum) 48 | { 49 | this.cpuNum = cpuNum; 50 | } 51 | 52 | public double getTotal() 53 | { 54 | return Arith.round(Arith.mul(total, 100), 2); 55 | } 56 | 57 | public void setTotal(double total) 58 | { 59 | this.total = total; 60 | } 61 | 62 | public double getSys() 63 | { 64 | return Arith.round(Arith.mul(sys / total, 100), 2); 65 | } 66 | 67 | public void setSys(double sys) 68 | { 69 | this.sys = sys; 70 | } 71 | 72 | public double getUsed() 73 | { 74 | return Arith.round(Arith.mul(used / total, 100), 2); 75 | } 76 | 77 | public void setUsed(double used) 78 | { 79 | this.used = used; 80 | } 81 | 82 | public double getWait() 83 | { 84 | return Arith.round(Arith.mul(wait / total, 100), 2); 85 | } 86 | 87 | public void setWait(double wait) 88 | { 89 | this.wait = wait; 90 | } 91 | 92 | public double getFree() 93 | { 94 | return Arith.round(Arith.mul(free / total, 100), 2); 95 | } 96 | 97 | public void setFree(double free) 98 | { 99 | this.free = free; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/web/domain/Ztree.java: -------------------------------------------------------------------------------- 1 | package com.book.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/java/com/book/project/system/notice/service/NoticeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.notice.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.book.common.utils.security.ShiroUtils; 7 | import com.book.common.utils.text.Convert; 8 | import com.book.project.system.notice.mapper.NoticeMapper; 9 | import com.book.project.system.notice.domain.Notice; 10 | 11 | /** 12 | * 公告 服务层实现 13 | * 14 | * @author ruoyi 15 | * @date 2018-06-25 16 | */ 17 | @Service 18 | public class NoticeServiceImpl implements INoticeService 19 | { 20 | @Autowired 21 | private NoticeMapper noticeMapper; 22 | 23 | /** 24 | * 查询公告信息 25 | * 26 | * @param noticeId 公告ID 27 | * @return 公告信息 28 | */ 29 | @Override 30 | public Notice selectNoticeById(Long noticeId) 31 | { 32 | return noticeMapper.selectNoticeById(noticeId); 33 | } 34 | 35 | /** 36 | * 查询公告列表 37 | * 38 | * @param notice 公告信息 39 | * @return 公告集合 40 | */ 41 | @Override 42 | public List selectNoticeList(Notice notice) 43 | { 44 | return noticeMapper.selectNoticeList(notice); 45 | } 46 | 47 | /** 48 | * 新增公告 49 | * 50 | * @param notice 公告信息 51 | * @return 结果 52 | */ 53 | @Override 54 | public int insertNotice(Notice notice) 55 | { 56 | notice.setCreateBy(ShiroUtils.getLoginName()); 57 | return noticeMapper.insertNotice(notice); 58 | } 59 | 60 | /** 61 | * 修改公告 62 | * 63 | * @param notice 公告信息 64 | * @return 结果 65 | */ 66 | @Override 67 | public int updateNotice(Notice notice) 68 | { 69 | notice.setUpdateBy(ShiroUtils.getLoginName()); 70 | return noticeMapper.updateNotice(notice); 71 | } 72 | 73 | /** 74 | * 删除公告对象 75 | * 76 | * @param ids 需要删除的数据ID 77 | * @return 结果 78 | */ 79 | @Override 80 | public int deleteNoticeByIds(String ids) 81 | { 82 | return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/file/FileTypeUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.file; 2 | 3 | import java.io.File; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | /** 7 | * 文件类型工具类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class FileTypeUtils 12 | { 13 | /** 14 | * 获取文件类型 15 | *

16 | * 例如: ruoyi.txt, 返回: txt 17 | * 18 | * @param file 文件名 19 | * @return 后缀(不含".") 20 | */ 21 | public static String getFileType(File file) 22 | { 23 | if (null == file) 24 | { 25 | return StringUtils.EMPTY; 26 | } 27 | return getFileType(file.getName()); 28 | } 29 | 30 | /** 31 | * 获取文件类型 32 | *

33 | * 例如: ruoyi.txt, 返回: txt 34 | * 35 | * @param fileName 文件名 36 | * @return 后缀(不含".") 37 | */ 38 | public static String getFileType(String fileName) 39 | { 40 | int separatorIndex = fileName.lastIndexOf("."); 41 | if (separatorIndex < 0) 42 | { 43 | return ""; 44 | } 45 | return fileName.substring(separatorIndex + 1).toLowerCase(); 46 | } 47 | 48 | /** 49 | * 获取文件类型 50 | * 51 | * @param photoByte 文件字节码 52 | * @return 后缀(不含".") 53 | */ 54 | public static String getFileExtendName(byte[] photoByte) 55 | { 56 | String strFileExtendName = "JPG"; 57 | if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) 58 | && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) 59 | { 60 | strFileExtendName = "GIF"; 61 | } 62 | else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) 63 | { 64 | strFileExtendName = "JPG"; 65 | } 66 | else if ((photoByte[0] == 66) && (photoByte[1] == 77)) 67 | { 68 | strFileExtendName = "BMP"; 69 | } 70 | else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) 71 | { 72 | strFileExtendName = "PNG"; 73 | } 74 | return strFileExtendName; 75 | } 76 | } -------------------------------------------------------------------------------- /src/main/resources/static/ajax/libs/iCheck/custom.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, green 2 | ----------------------------------- */ 3 | .icheckbox_square-green, 4 | .iradio_square-green { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(green.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-green-login{ 18 | display: inline-block; 19 | *display: inline; 20 | vertical-align: middle; 21 | margin: 0; 22 | padding: 0; 23 | width: 22px; 24 | height: 22px; 25 | background: url(green-login.png) no-repeat; 26 | border: none; 27 | cursor: pointer; 28 | } 29 | 30 | .icheckbox_square-green,.icheckbox_square-green-login { 31 | background-position: 0 0; 32 | } 33 | .icheckbox_square-green.hover,.icheckbox_square-green-login.hover { 34 | background-position: -24px 0; 35 | } 36 | .icheckbox_square-green.checked,.icheckbox_square-green-login.checked { 37 | background-position: -48px 0; 38 | } 39 | .icheckbox_square-green.disabled,.icheckbox_square-green.disabled-login { 40 | background-position: -72px 0; 41 | cursor: default; 42 | } 43 | .icheckbox_square-green.checked.disabled,.icheckbox_square-green-login.checked.disabled { 44 | background-position: -96px 0; 45 | } 46 | 47 | .iradio_square-green { 48 | background-position: -120px 0; 49 | } 50 | .iradio_square-green.hover { 51 | background-position: -144px 0; 52 | } 53 | .iradio_square-green.checked { 54 | background-position: -168px 0; 55 | } 56 | .iradio_square-green.disabled { 57 | background-position: -192px 0; 58 | cursor: default; 59 | } 60 | .iradio_square-green.checked.disabled { 61 | background-position: -216px 0; 62 | } 63 | 64 | /* HiDPI support */ 65 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { 66 | .icheckbox_square-green,.icheckbox_square-green-login, 67 | .iradio_square-green { 68 | background-image: url(green%402x.png); 69 | -webkit-background-size: 240px 24px; 70 | background-size: 240px 24px; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/config/ThreadPoolConfig.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.config; 2 | 3 | import java.util.concurrent.ScheduledExecutorService; 4 | import java.util.concurrent.ScheduledThreadPoolExecutor; 5 | import java.util.concurrent.ThreadPoolExecutor; 6 | import org.apache.commons.lang3.concurrent.BasicThreadFactory; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 10 | import com.book.common.utils.Threads; 11 | 12 | /** 13 | * 线程池配置 14 | * 15 | * @author ruoyi 16 | **/ 17 | @Configuration 18 | public class ThreadPoolConfig 19 | { 20 | // 核心线程池大小 21 | private int corePoolSize = 50; 22 | 23 | // 最大可创建的线程数 24 | private int maxPoolSize = 200; 25 | 26 | // 队列最大长度 27 | private int queueCapacity = 1000; 28 | 29 | // 线程池维护线程所允许的空闲时间 30 | private int keepAliveSeconds = 300; 31 | 32 | @Bean(name = "threadPoolTaskExecutor") 33 | public ThreadPoolTaskExecutor threadPoolTaskExecutor() 34 | { 35 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 36 | executor.setMaxPoolSize(maxPoolSize); 37 | executor.setCorePoolSize(corePoolSize); 38 | executor.setQueueCapacity(queueCapacity); 39 | executor.setKeepAliveSeconds(keepAliveSeconds); 40 | // 线程池对拒绝任务(无线程可用)的处理策略 41 | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); 42 | return executor; 43 | } 44 | 45 | /** 46 | * 执行周期性或定时任务 47 | */ 48 | @Bean(name = "scheduledExecutorService") 49 | protected ScheduledExecutorService scheduledExecutorService() 50 | { 51 | return new ScheduledThreadPoolExecutor(corePoolSize, 52 | new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), 53 | new ThreadPoolExecutor.CallerRunsPolicy()) 54 | { 55 | @Override 56 | protected void afterExecute(Runnable r, Throwable t) 57 | { 58 | super.afterExecute(r, t); 59 | Threads.printException(r, t); 60 | } 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/security/ShiroUtils.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.security; 2 | 3 | import org.apache.shiro.SecurityUtils; 4 | import org.apache.shiro.session.Session; 5 | import org.apache.shiro.subject.Subject; 6 | import org.apache.shiro.subject.PrincipalCollection; 7 | import org.apache.shiro.subject.SimplePrincipalCollection; 8 | import com.book.common.utils.StringUtils; 9 | import com.book.common.utils.bean.BeanUtils; 10 | import com.book.project.system.user.domain.User; 11 | 12 | /** 13 | * shiro 工具类 14 | * 15 | * @author ruoyi 16 | */ 17 | public class ShiroUtils 18 | { 19 | public static Subject getSubject() 20 | { 21 | return SecurityUtils.getSubject(); 22 | } 23 | 24 | public static Session getSession() 25 | { 26 | return SecurityUtils.getSubject().getSession(); 27 | } 28 | 29 | public static void logout() 30 | { 31 | getSubject().logout(); 32 | } 33 | 34 | public static User getSysUser() 35 | { 36 | User user = null; 37 | Object obj = getSubject().getPrincipal(); 38 | if (StringUtils.isNotNull(obj)) 39 | { 40 | user = new User(); 41 | BeanUtils.copyBeanProp(user, obj); 42 | } 43 | return user; 44 | } 45 | 46 | public static void setSysUser(User user) 47 | { 48 | Subject subject = getSubject(); 49 | PrincipalCollection principalCollection = subject.getPrincipals(); 50 | String realmName = principalCollection.getRealmNames().iterator().next(); 51 | PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName); 52 | // 重新加载Principal 53 | subject.runAs(newPrincipalCollection); 54 | } 55 | 56 | public static Long getUserId() 57 | { 58 | return getSysUser().getUserId().longValue(); 59 | } 60 | 61 | public static String getLoginName() 62 | { 63 | return getSysUser().getLoginName(); 64 | } 65 | 66 | public static String getIp() 67 | { 68 | return getSubject().getSession().getHost(); 69 | } 70 | 71 | public static String getSessionId() 72 | { 73 | return String.valueOf(getSubject().getSession().getId()); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/monitor/server/domain/SysFile.java: -------------------------------------------------------------------------------- 1 | package com.book.project.monitor.server.domain; 2 | 3 | /** 4 | * 系统文件相关信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class SysFile 9 | { 10 | /** 11 | * 盘符路径 12 | */ 13 | private String dirName; 14 | 15 | /** 16 | * 盘符类型 17 | */ 18 | private String sysTypeName; 19 | 20 | /** 21 | * 文件类型 22 | */ 23 | private String typeName; 24 | 25 | /** 26 | * 总大小 27 | */ 28 | private String total; 29 | 30 | /** 31 | * 剩余大小 32 | */ 33 | private String free; 34 | 35 | /** 36 | * 已经使用量 37 | */ 38 | private String used; 39 | 40 | /** 41 | * 资源的使用率 42 | */ 43 | private double usage; 44 | 45 | public String getDirName() 46 | { 47 | return dirName; 48 | } 49 | 50 | public void setDirName(String dirName) 51 | { 52 | this.dirName = dirName; 53 | } 54 | 55 | public String getSysTypeName() 56 | { 57 | return sysTypeName; 58 | } 59 | 60 | public void setSysTypeName(String sysTypeName) 61 | { 62 | this.sysTypeName = sysTypeName; 63 | } 64 | 65 | public String getTypeName() 66 | { 67 | return typeName; 68 | } 69 | 70 | public void setTypeName(String typeName) 71 | { 72 | this.typeName = typeName; 73 | } 74 | 75 | public String getTotal() 76 | { 77 | return total; 78 | } 79 | 80 | public void setTotal(String total) 81 | { 82 | this.total = total; 83 | } 84 | 85 | public String getFree() 86 | { 87 | return free; 88 | } 89 | 90 | public void setFree(String free) 91 | { 92 | this.free = free; 93 | } 94 | 95 | public String getUsed() 96 | { 97 | return used; 98 | } 99 | 100 | public void setUsed(String used) 101 | { 102 | this.used = used; 103 | } 104 | 105 | public double getUsage() 106 | { 107 | return usage; 108 | } 109 | 110 | public void setUsage(double usage) 111 | { 112 | this.usage = usage; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/shiro/session/OnlineSessionFactory.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.shiro.session; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.apache.shiro.session.Session; 5 | import org.apache.shiro.session.mgt.SessionContext; 6 | import org.apache.shiro.session.mgt.SessionFactory; 7 | import org.apache.shiro.web.session.mgt.WebSessionContext; 8 | import org.springframework.stereotype.Component; 9 | import com.book.common.utils.ServletUtils; 10 | import com.book.common.utils.IpUtils; 11 | import com.book.common.utils.StringUtils; 12 | import com.book.project.monitor.online.domain.OnlineSession; 13 | import com.book.project.monitor.online.domain.UserOnline; 14 | import eu.bitwalker.useragentutils.UserAgent; 15 | 16 | /** 17 | * 自定义sessionFactory会话 18 | * 19 | * @author ruoyi 20 | */ 21 | @Component 22 | public class OnlineSessionFactory implements SessionFactory 23 | { 24 | public Session createSession(UserOnline userOnline) 25 | { 26 | OnlineSession onlineSession = userOnline.getSession(); 27 | if (StringUtils.isNotNull(onlineSession) && onlineSession.getId() == null) 28 | { 29 | onlineSession.setId(userOnline.getSessionId()); 30 | } 31 | return userOnline.getSession(); 32 | } 33 | 34 | @Override 35 | public Session createSession(SessionContext initData) 36 | { 37 | OnlineSession session = new OnlineSession(); 38 | if (initData != null && initData instanceof WebSessionContext) 39 | { 40 | WebSessionContext sessionContext = (WebSessionContext) initData; 41 | HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); 42 | if (request != null) 43 | { 44 | UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); 45 | // 获取客户端操作系统 46 | String os = userAgent.getOperatingSystem().getName(); 47 | // 获取客户端浏览器 48 | String browser = userAgent.getBrowser().getName(); 49 | session.setHost(IpUtils.getIpAddr(request)); 50 | session.setBrowser(browser); 51 | session.setOs(os); 52 | } 53 | } 54 | return session; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/book/common/utils/uuid/Seq.java: -------------------------------------------------------------------------------- 1 | package com.book.common.utils.uuid; 2 | 3 | import java.util.concurrent.atomic.AtomicInteger; 4 | import com.book.common.utils.DateUtils; 5 | import com.book.common.utils.StringUtils; 6 | 7 | /** 8 | * @author ruoyi 序列生成类 9 | */ 10 | public class Seq 11 | { 12 | // 通用序列类型 13 | public static final String commSeqType = "COMMON"; 14 | 15 | // 上传序列类型 16 | public static final String uploadSeqType = "UPLOAD"; 17 | 18 | // 通用接口序列数 19 | private static AtomicInteger commSeq = new AtomicInteger(1); 20 | 21 | // 上传接口序列数 22 | private static AtomicInteger uploadSeq = new AtomicInteger(1); 23 | 24 | // 机器标识 25 | private static String machineCode = "A"; 26 | 27 | /** 28 | * 获取通用序列号 29 | * 30 | * @return 序列值 31 | */ 32 | public static String getId() 33 | { 34 | return getId(commSeqType); 35 | } 36 | 37 | /** 38 | * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串 39 | * 40 | * @return 序列值 41 | */ 42 | public static String getId(String type) 43 | { 44 | AtomicInteger atomicInt = commSeq; 45 | if (uploadSeqType.equals(type)) 46 | { 47 | atomicInt = uploadSeq; 48 | } 49 | return getId(atomicInt, 3); 50 | } 51 | 52 | /** 53 | * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串 54 | * 55 | * @param atomicInt 序列数 56 | * @param length 数值长度 57 | * @return 序列值 58 | */ 59 | public static String getId(AtomicInteger atomicInt, int length) 60 | { 61 | String result = DateUtils.dateTimeNow(); 62 | result += machineCode; 63 | result += getSeq(atomicInt, length); 64 | return result; 65 | } 66 | 67 | /** 68 | * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数 69 | * 70 | * @return 序列值 71 | */ 72 | private synchronized static String getSeq(AtomicInteger atomicInt, int length) 73 | { 74 | // 先取值再+1 75 | int value = atomicInt.getAndIncrement(); 76 | 77 | // 如果更新后值>=10 的 (length)幂次方则重置为1 78 | int maxSeq = (int) Math.pow(10, length); 79 | if (atomicInt.get() >= maxSeq) 80 | { 81 | atomicInt.set(1); 82 | } 83 | // 转字符串,用0左补齐 84 | return StringUtils.padl(value, length); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/system/dict/mapper/DictDataMapper.java: -------------------------------------------------------------------------------- 1 | package com.book.project.system.dict.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.book.project.system.dict.domain.DictData; 6 | 7 | /** 8 | * 字典表 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface DictDataMapper 13 | { 14 | /** 15 | * 根据条件分页查询字典数据 16 | * 17 | * @param dictData 字典数据信息 18 | * @return 字典数据集合信息 19 | */ 20 | public List selectDictDataList(DictData dictData); 21 | 22 | /** 23 | * 根据字典类型查询字典数据 24 | * 25 | * @param dictType 字典类型 26 | * @return 字典数据集合信息 27 | */ 28 | public List selectDictDataByType(String dictType); 29 | 30 | /** 31 | * 根据字典类型和字典键值查询字典数据信息 32 | * 33 | * @param dictType 字典类型 34 | * @param dictValue 字典键值 35 | * @return 字典标签 36 | */ 37 | public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); 38 | 39 | /** 40 | * 根据字典数据ID查询信息 41 | * 42 | * @param dictCode 字典数据ID 43 | * @return 字典数据 44 | */ 45 | public DictData selectDictDataById(Long dictCode); 46 | 47 | /** 48 | * 查询字典数据 49 | * 50 | * @param dictType 字典类型 51 | * @return 字典数据 52 | */ 53 | public int countDictDataByType(String dictType); 54 | 55 | /** 56 | * 通过字典ID删除字典数据信息 57 | * 58 | * @param dictCode 字典数据ID 59 | * @return 结果 60 | */ 61 | public int deleteDictDataById(Long dictCode); 62 | 63 | /** 64 | * 批量删除字典数据 65 | * 66 | * @param ids 需要删除的数据 67 | * @return 结果 68 | */ 69 | public int deleteDictDataByIds(String[] ids); 70 | 71 | /** 72 | * 新增字典数据信息 73 | * 74 | * @param dictData 字典数据信息 75 | * @return 结果 76 | */ 77 | public int insertDictData(DictData dictData); 78 | 79 | /** 80 | * 修改字典数据信息 81 | * 82 | * @param dictData 字典数据信息 83 | * @return 结果 84 | */ 85 | public int updateDictData(DictData dictData); 86 | 87 | /** 88 | * 同步修改字典类型 89 | * 90 | * @param oldDictType 旧字典类型 91 | * @param newDictType 新旧字典类型 92 | * @return 结果 93 | */ 94 | public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/book/framework/aspectj/DataSourceAspect.java: -------------------------------------------------------------------------------- 1 | package com.book.framework.aspectj; 2 | 3 | import java.util.Objects; 4 | import org.aspectj.lang.ProceedingJoinPoint; 5 | import org.aspectj.lang.annotation.Around; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.aspectj.lang.reflect.MethodSignature; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.core.annotation.AnnotationUtils; 12 | import org.springframework.core.annotation.Order; 13 | import org.springframework.stereotype.Component; 14 | import com.book.common.utils.StringUtils; 15 | import com.book.framework.aspectj.lang.annotation.DataSource; 16 | import com.book.framework.datasource.DynamicDataSourceContextHolder; 17 | 18 | /** 19 | * 多数据源处理 20 | * 21 | * @author ruoyi 22 | */ 23 | @Aspect 24 | @Order(1) 25 | @Component 26 | public class DataSourceAspect 27 | { 28 | protected Logger logger = LoggerFactory.getLogger(getClass()); 29 | 30 | @Pointcut("@annotation(com.book.framework.aspectj.lang.annotation.DataSource)" 31 | + "|| @within(com.book.framework.aspectj.lang.annotation.DataSource)") 32 | public void dsPointCut() 33 | { 34 | 35 | } 36 | 37 | @Around("dsPointCut()") 38 | public Object around(ProceedingJoinPoint point) throws Throwable 39 | { 40 | DataSource dataSource = getDataSource(point); 41 | 42 | if (StringUtils.isNotNull(dataSource)) 43 | { 44 | DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); 45 | } 46 | 47 | try 48 | { 49 | return point.proceed(); 50 | } 51 | finally 52 | { 53 | // 销毁数据源 在执行方法之后 54 | DynamicDataSourceContextHolder.clearDataSourceType(); 55 | } 56 | } 57 | 58 | /** 59 | * 获取需要切换的数据源 60 | */ 61 | public DataSource getDataSource(ProceedingJoinPoint point) 62 | { 63 | MethodSignature signature = (MethodSignature) point.getSignature(); 64 | DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class); 65 | if (Objects.nonNull(dataSource)) 66 | { 67 | return dataSource; 68 | } 69 | 70 | return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/book/project/shop/order/service/impl/BookOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.book.project.shop.order.service.impl; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.book.project.shop.order.mapper.BookOrderMapper; 7 | import com.book.project.shop.order.domain.BookOrder; 8 | import com.book.project.shop.order.service.IBookOrderService; 9 | import com.book.common.utils.text.Convert; 10 | 11 | /** 12 | * 订单Service业务层处理 13 | * 14 | * @author book 15 | * @date 2022-05-08 16 | */ 17 | @Service 18 | public class BookOrderServiceImpl implements IBookOrderService 19 | { 20 | @Autowired 21 | private BookOrderMapper bookOrderMapper; 22 | 23 | /** 24 | * 查询订单 25 | * 26 | * @param id 订单主键 27 | * @return 订单 28 | */ 29 | @Override 30 | public BookOrder selectBookOrderById(Long id) 31 | { 32 | return bookOrderMapper.selectBookOrderById(id); 33 | } 34 | 35 | /** 36 | * 查询订单列表 37 | * 38 | * @param bookOrder 订单 39 | * @return 订单 40 | */ 41 | @Override 42 | public List selectBookOrderList(BookOrder bookOrder) 43 | { 44 | return bookOrderMapper.selectBookOrderList(bookOrder); 45 | } 46 | 47 | /** 48 | * 新增订单 49 | * 50 | * @param bookOrder 订单 51 | * @return 结果 52 | */ 53 | @Override 54 | public int insertBookOrder(BookOrder bookOrder) 55 | { 56 | return bookOrderMapper.insertBookOrder(bookOrder); 57 | } 58 | 59 | /** 60 | * 修改订单 61 | * 62 | * @param bookOrder 订单 63 | * @return 结果 64 | */ 65 | @Override 66 | public int updateBookOrder(BookOrder bookOrder) 67 | { 68 | return bookOrderMapper.updateBookOrder(bookOrder); 69 | } 70 | 71 | /** 72 | * 批量删除订单 73 | * 74 | * @param ids 需要删除的订单主键 75 | * @return 结果 76 | */ 77 | @Override 78 | public int deleteBookOrderByIds(String ids) 79 | { 80 | return bookOrderMapper.deleteBookOrderByIds(Convert.toStrArray(ids)); 81 | } 82 | 83 | /** 84 | * 删除订单信息 85 | * 86 | * @param id 订单主键 87 | * @return 结果 88 | */ 89 | @Override 90 | public int deleteBookOrderById(Long id) 91 | { 92 | return bookOrderMapper.deleteBookOrderById(id); 93 | } 94 | } 95 | --------------------------------------------------------------------------------