Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
cc9c67cd
Commit
cc9c67cd
authored
Jul 22, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
若依2.2版本发布
parent
9e8d80a6
Hide whitespace changes
Inline
Side-by-side
Showing
115 changed files
with
1570 additions
and
1206 deletions
+1570
-1206
pom.xml
+1
-1
sql/ry_20180723.sql
+73
-92
src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java
+6
-10
src/main/java/com/ruoyi/framework/shiro/service/LoginService.java
+1
-1
src/main/java/com/ruoyi/framework/web/controller/BaseController.java
+11
-0
src/main/java/com/ruoyi/framework/web/service/ConfigService.java
+3
-3
src/main/java/com/ruoyi/framework/web/service/DictService.java
+15
-3
src/main/java/com/ruoyi/framework/web/service/PermissionService.java
+3
-3
src/main/java/com/ruoyi/project/common/CommonController.java
+22
-5
src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java
+25
-30
src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java
+1
-10
src/main/java/com/ruoyi/project/monitor/job/service/IJobService.java
+2
-9
src/main/java/com/ruoyi/project/monitor/job/service/JobLogServiceImpl.java
+1
-1
src/main/java/com/ruoyi/project/monitor/job/service/JobServiceImpl.java
+4
-28
src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java
+1
-6
src/main/java/com/ruoyi/project/monitor/logininfor/domain/Logininfor.java
+3
-3
src/main/java/com/ruoyi/project/monitor/logininfor/service/LogininforServiceImpl.java
+1
-1
src/main/java/com/ruoyi/project/monitor/online/service/UserOnlineServiceImpl.java
+1
-1
src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java
+4
-10
src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java
+3
-3
src/main/java/com/ruoyi/project/monitor/operlog/service/OperLogServiceImpl.java
+1
-1
src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java
+23
-25
src/main/java/com/ruoyi/project/system/config/domain/Config.java
+3
-3
src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java
+10
-19
src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java
+14
-46
src/main/java/com/ruoyi/project/system/config/service/IConfigService.java
+1
-17
src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java
+29
-31
src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java
+21
-21
src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java
+10
-2
src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java
+28
-30
src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java
+30
-30
src/main/java/com/ruoyi/project/system/dict/domain/DictData.java
+13
-0
src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
+16
-4
src/main/java/com/ruoyi/project/system/dict/service/DictDataServiceImpl.java
+30
-15
src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java
+19
-19
src/main/java/com/ruoyi/project/system/dict/service/IDictDataService.java
+22
-5
src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java
+13
-6
src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java
+35
-35
src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java
+10
-2
src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java
+22
-23
src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java
+25
-27
src/main/java/com/ruoyi/project/system/notice/domain/Notice.java
+5
-5
src/main/java/com/ruoyi/project/system/notice/mapper/NoticeMapper.java
+1
-1
src/main/java/com/ruoyi/project/system/notice/service/INoticeService.java
+1
-9
src/main/java/com/ruoyi/project/system/notice/service/NoticeServiceImpl.java
+3
-28
src/main/java/com/ruoyi/project/system/post/controller/PostController.java
+23
-21
src/main/java/com/ruoyi/project/system/post/mapper/PostMapper.java
+0
-8
src/main/java/com/ruoyi/project/system/post/service/IPostService.java
+10
-10
src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java
+20
-34
src/main/java/com/ruoyi/project/system/role/controller/RoleController.java
+25
-21
src/main/java/com/ruoyi/project/system/role/service/IRoleService.java
+13
-5
src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java
+28
-26
src/main/java/com/ruoyi/project/system/user/controller/IndexController.java
+7
-7
src/main/java/com/ruoyi/project/system/user/controller/LoginController.java
+1
-2
src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java
+20
-31
src/main/java/com/ruoyi/project/system/user/controller/UserController.java
+60
-57
src/main/java/com/ruoyi/project/system/user/service/IUserService.java
+11
-3
src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java
+42
-50
src/main/java/com/ruoyi/project/tool/gen/service/GenServiceImpl.java
+1
-1
src/main/resources/application.yml
+1
-1
src/main/resources/mybatis/system/ConfigMapper.xml
+18
-10
src/main/resources/mybatis/system/DictDataMapper.xml
+11
-2
src/main/resources/mybatis/system/NoticeMapper.xml
+1
-1
src/main/resources/mybatis/system/PostMapper.xml
+0
-4
src/main/resources/static/ruoyi/index.js
+7
-3
src/main/resources/static/ruoyi/js/ry-ui.js
+11
-0
src/main/resources/static/ruoyi/js/ry-ui.min.js
+460
-5
src/main/resources/templates/include.html
+2
-2
src/main/resources/templates/index.html
+3
-3
src/main/resources/templates/login.html
+2
-2
src/main/resources/templates/main.html
+26
-2
src/main/resources/templates/monitor/job/add.html
+2
-2
src/main/resources/templates/monitor/job/edit.html
+2
-2
src/main/resources/templates/monitor/job/job.html
+6
-9
src/main/resources/templates/monitor/job/jobLog.html
+4
-7
src/main/resources/templates/monitor/logininfor/logininfor.html
+4
-7
src/main/resources/templates/monitor/online/online.html
+1
-1
src/main/resources/templates/monitor/operlog/detail.html
+1
-1
src/main/resources/templates/monitor/operlog/operlog.html
+4
-23
src/main/resources/templates/system/config/add.html
+2
-2
src/main/resources/templates/system/config/config.html
+5
-8
src/main/resources/templates/system/config/edit.html
+2
-2
src/main/resources/templates/system/dept/add.html
+2
-2
src/main/resources/templates/system/dept/dept.html
+6
-9
src/main/resources/templates/system/dept/edit.html
+2
-2
src/main/resources/templates/system/dict/data/add.html
+9
-3
src/main/resources/templates/system/dict/data/data.html
+5
-8
src/main/resources/templates/system/dict/data/edit.html
+9
-3
src/main/resources/templates/system/dict/type/add.html
+2
-2
src/main/resources/templates/system/dict/type/edit.html
+2
-2
src/main/resources/templates/system/dict/type/type.html
+6
-9
src/main/resources/templates/system/menu/add.html
+2
-2
src/main/resources/templates/system/menu/edit.html
+2
-2
src/main/resources/templates/system/menu/menu.html
+6
-9
src/main/resources/templates/system/notice/add.html
+3
-3
src/main/resources/templates/system/notice/edit.html
+3
-3
src/main/resources/templates/system/notice/notice.html
+7
-13
src/main/resources/templates/system/post/add.html
+2
-2
src/main/resources/templates/system/post/edit.html
+2
-2
src/main/resources/templates/system/post/post.html
+5
-8
src/main/resources/templates/system/role/add.html
+1
-1
src/main/resources/templates/system/role/edit.html
+1
-1
src/main/resources/templates/system/role/role.html
+6
-8
src/main/resources/templates/system/user/add.html
+3
-3
src/main/resources/templates/system/user/edit.html
+2
-2
src/main/resources/templates/system/user/profile/profile.html
+1
-1
src/main/resources/templates/system/user/user.html
+6
-9
src/main/resources/templates/vm/html/add.html.vm
+1
-1
src/main/resources/templates/vm/html/edit.html.vm
+1
-1
src/main/resources/templates/vm/java/Controller.java.vm
+24
-25
src/main/resources/templates/vm/java/Service.java.vm
+1
-10
src/main/resources/templates/vm/java/ServiceImpl.java.vm
+1
-24
src/main/resources/templates/vm/sql/sql.vm
+0
-3
src/test/java/com/ruoyi/common/utils/AddressUtilsTest.java
+10
-7
src/test/java/com/ruoyi/project/system/dept/service/DeptServiceImplTest.java
+35
-27
No files found.
pom.xml
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@
<groupId>
com.ruoyi
</groupId>
<artifactId>
RuoYi
</artifactId>
<version>
2.
1
.0
</version>
<version>
2.
2
.0
</version>
<packaging>
jar
</packaging>
<name>
RuoYi
</name>
...
...
sql/ry_2018072
0
.sql
→
sql/ry_2018072
3
.sql
View file @
cc9c67cd
...
...
@@ -146,9 +146,9 @@ create table sys_menu (
-- 初始化-菜单信息表数据
-- ----------------------------
-- 一级菜单
insert
into
sys_menu
values
(
'1'
,
'系统管理'
,
'0'
,
'1'
,
'#'
,
'M'
,
'0'
,
'
#
'
,
'fa fa-gear'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统管理目录'
);
insert
into
sys_menu
values
(
'2'
,
'系统监控'
,
'0'
,
'2'
,
'#'
,
'M'
,
'0'
,
'
#
'
,
'fa fa-video-camera'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统监控目录'
);
insert
into
sys_menu
values
(
'3'
,
'系统工具'
,
'0'
,
'3'
,
'#'
,
'M'
,
'0'
,
'
#
'
,
'fa fa-bars'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统工具目录'
);
insert
into
sys_menu
values
(
'1'
,
'系统管理'
,
'0'
,
'1'
,
'#'
,
'M'
,
'0'
,
''
,
'fa fa-gear'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统管理目录'
);
insert
into
sys_menu
values
(
'2'
,
'系统监控'
,
'0'
,
'2'
,
'#'
,
'M'
,
'0'
,
''
,
'fa fa-video-camera'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统监控目录'
);
insert
into
sys_menu
values
(
'3'
,
'系统工具'
,
'0'
,
'3'
,
'#'
,
'M'
,
'0'
,
''
,
'fa fa-bars'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统工具目录'
);
-- 二级菜单
insert
into
sys_menu
values
(
'100'
,
'用户管理'
,
'1'
,
'1'
,
'/system/user'
,
'C'
,
'0'
,
'system:user:view'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'用户管理菜单'
);
insert
into
sys_menu
values
(
'101'
,
'角色管理'
,
'1'
,
'2'
,
'/system/role'
,
'C'
,
'0'
,
'system:role:view'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'角色管理菜单'
);
...
...
@@ -173,71 +173,62 @@ insert into sys_menu values('1000', '用户查询', '100', '1', '#', 'F', '0',
insert
into
sys_menu
values
(
'1001'
,
'用户新增'
,
'100'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:user:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1002'
,
'用户修改'
,
'100'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:user:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1003'
,
'用户删除'
,
'100'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:user:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1004'
,
'用户保存'
,
'100'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:user:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1005'
,
'重置密码'
,
'100'
,
'6'
,
'#'
,
'F'
,
'0'
,
'system:user:resetPwd'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1004'
,
'重置密码'
,
'100'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:user:resetPwd'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 角色管理按钮
insert
into
sys_menu
values
(
'1006'
,
'角色查询'
,
'101'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:role:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1007'
,
'角色新增'
,
'101'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:role:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1008'
,
'角色修改'
,
'101'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:role:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1009'
,
'角色删除'
,
'101'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:role:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1010'
,
'角色保存'
,
'101'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:role:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1005'
,
'角色查询'
,
'101'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:role:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1006'
,
'角色新增'
,
'101'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:role:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1007'
,
'角色修改'
,
'101'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:role:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1008'
,
'角色删除'
,
'101'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:role:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 菜单管理按钮
insert
into
sys_menu
values
(
'1011'
,
'菜单查询'
,
'102'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:menu:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1012'
,
'菜单新增'
,
'102'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:menu:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1013'
,
'菜单修改'
,
'102'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:menu:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1014'
,
'菜单删除'
,
'102'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:menu:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1015'
,
'菜单保存'
,
'102'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:menu:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1009'
,
'菜单查询'
,
'102'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:menu:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1010'
,
'菜单新增'
,
'102'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:menu:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1011'
,
'菜单修改'
,
'102'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:menu:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1012'
,
'菜单删除'
,
'102'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:menu:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 部门管理按钮
insert
into
sys_menu
values
(
'1016'
,
'部门查询'
,
'103'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:dept:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1017'
,
'部门新增'
,
'103'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:dept:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1018'
,
'部门修改'
,
'103'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:dept:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1019'
,
'部门删除'
,
'103'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:dept:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1020'
,
'部门保存'
,
'103'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:dept:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1013'
,
'部门查询'
,
'103'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:dept:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1014'
,
'部门新增'
,
'103'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:dept:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1015'
,
'部门修改'
,
'103'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:dept:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1016'
,
'部门删除'
,
'103'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:dept:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 岗位管理按钮
insert
into
sys_menu
values
(
'1021'
,
'岗位查询'
,
'104'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:post:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1022'
,
'岗位新增'
,
'104'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:post:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1023'
,
'岗位修改'
,
'104'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:post:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1024'
,
'岗位删除'
,
'104'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:post:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1025'
,
'岗位保存'
,
'104'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:post:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1017'
,
'岗位查询'
,
'104'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:post:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1018'
,
'岗位新增'
,
'104'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:post:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1019'
,
'岗位修改'
,
'104'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:post:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1020'
,
'岗位删除'
,
'104'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:post:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 字典管理按钮
insert
into
sys_menu
values
(
'1026'
,
'字典查询'
,
'105'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:dict:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1027'
,
'字典新增'
,
'105'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:dict:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1028'
,
'字典修改'
,
'105'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:dict:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1029'
,
'字典删除'
,
'105'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:dict:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1030'
,
'字典保存'
,
'105'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:dict:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1021'
,
'字典查询'
,
'105'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:dict:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1022'
,
'字典新增'
,
'105'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:dict:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1023'
,
'字典修改'
,
'105'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:dict:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1024'
,
'字典删除'
,
'105'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:dict:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 参数设置按钮
insert
into
sys_menu
values
(
'1031'
,
'参数查询'
,
'106'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:config:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1032'
,
'参数新增'
,
'106'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:config:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1033'
,
'参数修改'
,
'106'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:config:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1034'
,
'参数删除'
,
'106'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:config:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1035'
,
'参数保存'
,
'106'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:config:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1025'
,
'参数查询'
,
'106'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:config:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1026'
,
'参数新增'
,
'106'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:config:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1027'
,
'参数修改'
,
'106'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:config:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1028'
,
'参数删除'
,
'106'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:config:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 通知公告按钮
insert
into
sys_menu
values
(
'1036'
,
'公告查询'
,
'107'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:notice:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1037'
,
'公告新增'
,
'107'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:notice:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1038'
,
'公告修改'
,
'107'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:notice:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1039'
,
'公告删除'
,
'107'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:notice:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1040'
,
'公告保存'
,
'107'
,
'5'
,
'#'
,
'F'
,
'0'
,
'system:notice:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1029'
,
'公告查询'
,
'107'
,
'1'
,
'#'
,
'F'
,
'0'
,
'system:notice:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1030'
,
'公告新增'
,
'107'
,
'2'
,
'#'
,
'F'
,
'0'
,
'system:notice:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1031'
,
'公告修改'
,
'107'
,
'3'
,
'#'
,
'F'
,
'0'
,
'system:notice:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1032'
,
'公告删除'
,
'107'
,
'4'
,
'#'
,
'F'
,
'0'
,
'system:notice:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 操作日志按钮
insert
into
sys_menu
values
(
'10
41
'
,
'操作查询'
,
'500'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
42
'
,
'操作删除'
,
'500'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
43
'
,
'详细信息'
,
'500'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:detail'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
33
'
,
'操作查询'
,
'500'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
34
'
,
'操作删除'
,
'500'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
35
'
,
'详细信息'
,
'500'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:operlog:detail'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 登录日志按钮
insert
into
sys_menu
values
(
'10
44
'
,
'登录查询'
,
'501'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:logininfor:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
45
'
,
'登录删除'
,
'501'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:logininfor:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
36
'
,
'登录查询'
,
'501'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:logininfor:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
37
'
,
'登录删除'
,
'501'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:logininfor:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 在线用户按钮
insert
into
sys_menu
values
(
'10
46
'
,
'在线查询'
,
'109'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:online:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
47
'
,
'批量强退'
,
'109'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:online:batchForceLogout'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'104
8
'
,
'单条强退'
,
'109'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:online:forceLogout'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
38
'
,
'在线查询'
,
'109'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:online:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
39
'
,
'批量强退'
,
'109'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:online:batchForceLogout'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'104
0
'
,
'单条强退'
,
'109'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:online:forceLogout'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 定时任务按钮
insert
into
sys_menu
values
(
'1049'
,
'任务查询'
,
'110'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:job:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1050'
,
'任务新增'
,
'110'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:job:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1051'
,
'任务修改'
,
'110'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:job:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1052'
,
'任务删除'
,
'110'
,
'4'
,
'#'
,
'F'
,
'0'
,
'monitor:job:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1053'
,
'任务保存'
,
'110'
,
'5'
,
'#'
,
'F'
,
'0'
,
'monitor:job:save'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1054'
,
'状态修改'
,
'110'
,
'6'
,
'#'
,
'F'
,
'0'
,
'monitor:job:changeStatus'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1041'
,
'任务查询'
,
'110'
,
'1'
,
'#'
,
'F'
,
'0'
,
'monitor:job:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1042'
,
'任务新增'
,
'110'
,
'2'
,
'#'
,
'F'
,
'0'
,
'monitor:job:add'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1043'
,
'任务修改'
,
'110'
,
'3'
,
'#'
,
'F'
,
'0'
,
'monitor:job:edit'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1044'
,
'任务删除'
,
'110'
,
'4'
,
'#'
,
'F'
,
'0'
,
'monitor:job:remove'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'1045'
,
'状态修改'
,
'110'
,
'5'
,
'#'
,
'F'
,
'0'
,
'monitor:job:changeStatus'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- 代码生成按钮
insert
into
sys_menu
values
(
'10
55
'
,
'生成查询'
,
'113'
,
'1'
,
'#'
,
'F'
,
'0'
,
'tool:gen:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
56
'
,
'生成代码'
,
'113'
,
'2'
,
'#'
,
'F'
,
'0'
,
'tool:gen:code'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
46
'
,
'生成查询'
,
'113'
,
'1'
,
'#'
,
'F'
,
'0'
,
'tool:gen:list'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
insert
into
sys_menu
values
(
'10
47
'
,
'生成代码'
,
'113'
,
'2'
,
'#'
,
'F'
,
'0'
,
'tool:gen:code'
,
'#'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
''
);
-- ----------------------------
...
...
@@ -338,15 +329,6 @@ insert into sys_role_menu values ('1', '1044');
insert
into
sys_role_menu
values
(
'1'
,
'1045'
);
insert
into
sys_role_menu
values
(
'1'
,
'1046'
);
insert
into
sys_role_menu
values
(
'1'
,
'1047'
);
insert
into
sys_role_menu
values
(
'1'
,
'1048'
);
insert
into
sys_role_menu
values
(
'1'
,
'1049'
);
insert
into
sys_role_menu
values
(
'1'
,
'1050'
);
insert
into
sys_role_menu
values
(
'1'
,
'1051'
);
insert
into
sys_role_menu
values
(
'1'
,
'1052'
);
insert
into
sys_role_menu
values
(
'1'
,
'1053'
);
insert
into
sys_role_menu
values
(
'1'
,
'1054'
);
insert
into
sys_role_menu
values
(
'1'
,
'1055'
);
insert
into
sys_role_menu
values
(
'1'
,
'1056'
);
-- ----------------------------
-- 8、用户与岗位关联表 用户1-N岗位
...
...
@@ -430,6 +412,7 @@ create table sys_dict_data
dict_value
varchar
(
100
)
default
''
comment
'字典键值'
,
dict_type
varchar
(
100
)
default
''
comment
'字典类型'
,
css_class
varchar
(
500
)
default
''
comment
'样式属性'
,
list_class
varchar
(
500
)
default
''
comment
'回显样式'
,
is_default
char
(
1
)
default
'N'
comment
'是否默认(Y是 N否)'
,
status
char
(
1
)
default
'0'
comment
'状态(0正常 1停用)'
,
create_by
varchar
(
64
)
default
''
comment
'创建者'
,
...
...
@@ -441,33 +424,31 @@ create table sys_dict_data
)
engine
=
innodb
auto_increment
=
100
default
charset
=
utf8
comment
=
'字典数据表'
;
insert
into
sys_dict_data
values
(
1
,
1
,
'男'
,
'0'
,
'sys_user_sex'
,
''
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别男'
);
insert
into
sys_dict_data
values
(
2
,
2
,
'女'
,
'1'
,
'sys_user_sex'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别女'
);
insert
into
sys_dict_data
values
(
3
,
3
,
'未知'
,
'2'
,
'sys_user_sex'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别未知'
);
insert
into
sys_dict_data
values
(
4
,
1
,
'显示'
,
'0'
,
'sys_show_hide'
,
'radio radio-info radio-inline'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'显示菜单'
);
insert
into
sys_dict_data
values
(
5
,
2
,
'隐藏'
,
'1'
,
'sys_show_hide'
,
'radio radio-danger radio-inline'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'隐藏菜单'
);
insert
into
sys_dict_data
values
(
6
,
1
,
'正常'
,
'0'
,
'sys_normal_disable'
,
'radio radio-info radio-inline'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
7
,
2
,
'停用'
,
'1'
,
'sys_normal_disable'
,
'radio radio-danger radio-inline'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
insert
into
sys_dict_data
values
(
8
,
1
,
'正常'
,
'0'
,
'sys_job_status'
,
'radio radio-info radio-inline'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
9
,
2
,
'暂停'
,
'1'
,
'sys_job_status'
,
'radio radio-danger radio-inline'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
insert
into
sys_dict_data
values
(
10
,
1
,
'是'
,
'Y'
,
'sys_yes_no'
,
'radio radio-info radio-inline'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统默认是'
);
insert
into
sys_dict_data
values
(
11
,
2
,
'否'
,
'N'
,
'sys_yes_no'
,
'radio radio-danger radio-inline'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统默认否'
);
insert
into
sys_dict_data
values
(
12
,
1
,
'通知'
,
'1'
,
'sys_notice_type'
,
''
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'通知'
);
insert
into
sys_dict_data
values
(
13
,
2
,
'公告'
,
'2'
,
'sys_notice_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'公告'
);
insert
into
sys_dict_data
values
(
14
,
1
,
'正常'
,
'0'
,
'sys_notice_status'
,
'radio radio-info radio-inline'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
15
,
2
,
'关闭'
,
'1'
,
'sys_notice_status'
,
'radio radio-danger radio-inline'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'关闭状态'
);
insert
into
sys_dict_data
values
(
16
,
1
,
'新增'
,
'1'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
17
,
2
,
'修改'
,
'2'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
18
,
3
,
'保存'
,
'3'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
19
,
4
,
'删除'
,
'4'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
20
,
5
,
'授权'
,
'5'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
21
,
6
,
'导出'
,
'6'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
22
,
7
,
'导入'
,
'7'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
23
,
8
,
'强退'
,
'8'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
24
,
9
,
'禁止访问'
,
'9'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
25
,
10
,
'生成代码'
,
'10'
,
'sys_oper_type'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
26
,
1
,
'成功'
,
'0'
,
'sys_common_status'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
27
,
2
,
'失败'
,
'1'
,
'sys_common_status'
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
insert
into
sys_dict_data
values
(
1
,
1
,
'男'
,
'0'
,
'sys_user_sex'
,
''
,
''
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别男'
);
insert
into
sys_dict_data
values
(
2
,
2
,
'女'
,
'1'
,
'sys_user_sex'
,
''
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别女'
);
insert
into
sys_dict_data
values
(
3
,
3
,
'未知'
,
'2'
,
'sys_user_sex'
,
''
,
''
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'性别未知'
);
insert
into
sys_dict_data
values
(
4
,
1
,
'显示'
,
'0'
,
'sys_show_hide'
,
'radio radio-info radio-inline'
,
'primary'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'显示菜单'
);
insert
into
sys_dict_data
values
(
5
,
2
,
'隐藏'
,
'1'
,
'sys_show_hide'
,
'radio radio-danger radio-inline'
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'隐藏菜单'
);
insert
into
sys_dict_data
values
(
6
,
1
,
'正常'
,
'0'
,
'sys_normal_disable'
,
'radio radio-info radio-inline'
,
'primary'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
7
,
2
,
'停用'
,
'1'
,
'sys_normal_disable'
,
'radio radio-danger radio-inline'
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
insert
into
sys_dict_data
values
(
8
,
1
,
'正常'
,
'0'
,
'sys_job_status'
,
'radio radio-info radio-inline'
,
'primary'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
9
,
2
,
'暂停'
,
'1'
,
'sys_job_status'
,
'radio radio-danger radio-inline'
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
insert
into
sys_dict_data
values
(
10
,
1
,
'是'
,
'Y'
,
'sys_yes_no'
,
'radio radio-info radio-inline'
,
'primary'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统默认是'
);
insert
into
sys_dict_data
values
(
11
,
2
,
'否'
,
'N'
,
'sys_yes_no'
,
'radio radio-danger radio-inline'
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'系统默认否'
);
insert
into
sys_dict_data
values
(
12
,
1
,
'通知'
,
'1'
,
'sys_notice_type'
,
''
,
'warning'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'通知'
);
insert
into
sys_dict_data
values
(
13
,
2
,
'公告'
,
'2'
,
'sys_notice_type'
,
''
,
'success'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'公告'
);
insert
into
sys_dict_data
values
(
14
,
1
,
'正常'
,
'0'
,
'sys_notice_status'
,
'radio radio-info radio-inline'
,
'primary'
,
'Y'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
15
,
2
,
'关闭'
,
'1'
,
'sys_notice_status'
,
'radio radio-danger radio-inline'
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'关闭状态'
);
insert
into
sys_dict_data
values
(
16
,
1
,
'新增'
,
'1'
,
'sys_oper_type'
,
''
,
'info'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
17
,
2
,
'修改'
,
'2'
,
'sys_oper_type'
,
''
,
'info'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
18
,
3
,
'删除'
,
'3'
,
'sys_oper_type'
,
''
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
19
,
4
,
'授权'
,
'4'
,
'sys_oper_type'
,
''
,
'primary'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
20
,
5
,
'导出'
,
'5'
,
'sys_oper_type'
,
''
,
'warning'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
21
,
6
,
'导入'
,
'6'
,
'sys_oper_type'
,
''
,
'warning'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
22
,
7
,
'强退'
,
'7'
,
'sys_oper_type'
,
''
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
23
,
8
,
'生成代码'
,
'8'
,
'sys_oper_type'
,
''
,
'warning'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'新增操作'
);
insert
into
sys_dict_data
values
(
24
,
1
,
'成功'
,
'0'
,
'sys_common_status'
,
''
,
'primary'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'正常状态'
);
insert
into
sys_dict_data
values
(
25
,
2
,
'失败'
,
'1'
,
'sys_common_status'
,
''
,
'danger'
,
'N'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'停用状态'
);
-- ----------------------------
-- 12、参数配置表
...
...
src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java
View file @
cc9c67cd
...
...
@@ -14,20 +14,16 @@ public class BusinessType
public
static
final
String
INSERT
=
"1"
;
/** 修改 */
public
static
final
String
UPDATE
=
"2"
;
/** 保存 */
public
static
final
String
SAVE
=
"3"
;
/** 删除 */
public
static
final
String
DELETE
=
"
4
"
;
public
static
final
String
DELETE
=
"
3
"
;
/** 授权 */
public
static
final
String
GRANT
=
"
5
"
;
public
static
final
String
GRANT
=
"
4
"
;
/** 导出 */
public
static
final
String
EXPORT
=
"
6
"
;
public
static
final
String
EXPORT
=
"
5
"
;
/** 导入 */
public
static
final
String
IMPORT
=
"
7
"
;
public
static
final
String
IMPORT
=
"
6
"
;
/** 强退 */
public
static
final
String
FORCE
=
"8"
;
/** 禁止访问 */
public
static
final
String
FORBID
=
"9"
;
public
static
final
String
FORCE
=
"7"
;
/** 生成代码 */
public
static
final
String
GENCODE
=
"
10
"
;
public
static
final
String
GENCODE
=
"
8
"
;
}
src/main/java/com/ruoyi/framework/shiro/service/LoginService.java
View file @
cc9c67cd
...
...
@@ -122,7 +122,7 @@ public class LoginService
{
user
.
setLoginIp
(
ShiroUtils
.
getIp
());
user
.
setLoginDate
(
DateUtils
.
getNowDate
());
userService
.
updateUser
(
user
);
userService
.
updateUser
Info
(
user
);
}
}
src/main/java/com/ruoyi/framework/web/controller/BaseController.java
View file @
cc9c67cd
...
...
@@ -62,6 +62,17 @@ public class BaseController
}
/**
* 响应返回结果
*
* @param rows 影响行数
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
int
rows
)
{
return
rows
>
0
?
success
()
:
error
();
}
/**
* 返回成功
*/
public
AjaxResult
success
()
...
...
src/main/java/com/ruoyi/framework/web/service/ConfigService.java
View file @
cc9c67cd
package
com
.
ruoyi
.
framework
.
web
.
service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.
Component
;
import
org.springframework.stereotype.
Service
;
import
com.ruoyi.project.system.config.service.IConfigService
;
/**
...
...
@@ -9,7 +9,7 @@ import com.ruoyi.project.system.config.service.IConfigService;
*
* @author ruoyi
*/
@
Component
@
Service
(
"config"
)
public
class
ConfigService
{
@Autowired
...
...
@@ -21,7 +21,7 @@ public class ConfigService
* @param configName 参数名称
* @return 参数键值
*/
public
String
selectConfigBy
Key
(
String
configKey
)
public
String
get
Key
(
String
configKey
)
{
return
configService
.
selectConfigByKey
(
configKey
);
}
...
...
src/main/java/com/ruoyi/framework/web/service/DictService.java
View file @
cc9c67cd
...
...
@@ -2,7 +2,7 @@ package com.ruoyi.framework.web.service;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.
Component
;
import
org.springframework.stereotype.
Service
;
import
com.ruoyi.project.system.dict.domain.DictData
;
import
com.ruoyi.project.system.dict.service.IDictDataService
;
...
...
@@ -11,7 +11,7 @@ import com.ruoyi.project.system.dict.service.IDictDataService;
*
* @author ruoyi
*/
@
Component
@
Service
(
"dict"
)
public
class
DictService
{
@Autowired
...
...
@@ -23,8 +23,20 @@ public class DictService
* @param dictType 字典类型
* @return 参数键值
*/
public
List
<
DictData
>
selectDictData
(
String
dictType
)
public
List
<
DictData
>
getType
(
String
dictType
)
{
return
dictDataService
.
selectDictDataByType
(
dictType
);
}
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public
String
getLabel
(
String
dictType
,
String
dictValue
)
{
return
dictDataService
.
selectDictLabel
(
dictType
,
dictValue
);
}
}
src/main/java/com/ruoyi/framework/
shiro
/service/PermissionService.java
→
src/main/java/com/ruoyi/framework/
web
/service/PermissionService.java
View file @
cc9c67cd
package
com
.
ruoyi
.
framework
.
shiro
.
service
;
package
com
.
ruoyi
.
framework
.
web
.
service
;
import
org.apache.shiro.SecurityUtils
;
import
org.springframework.stereotype.
Component
;
import
org.springframework.stereotype.
Service
;
/**
* RuoYi首创 js调用 thymeleaf 实现按钮权限可见性
*
* @author ruoyi
*/
@
Component
@
Service
(
"permission"
)
public
class
PermissionService
{
public
String
hasPermi
(
String
permission
)
...
...
src/main/java/com/ruoyi/project/common/CommonController.java
View file @
cc9c67cd
...
...
@@ -2,12 +2,15 @@ package com.ruoyi.project.common;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -20,10 +23,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public
class
CommonController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
CommonController
.
class
);
@RequestMapping
(
"common/download"
)
public
void
fileDownload
(
String
fileName
,
Boolean
delete
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
String
realFileName
=
System
.
currentTimeMillis
()
+
fileName
.
substring
(
fileName
.
indexOf
(
"_"
)
+
1
);
InputStream
inputStream
=
null
;
OutputStream
os
=
null
;
try
{
String
filePath
=
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()
+
"static/file/"
+
fileName
;
...
...
@@ -32,16 +39,14 @@ public class CommonController
response
.
setContentType
(
"multipart/form-data"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;fileName="
+
setFileDownloadHeader
(
request
,
realFileName
));
File
file
=
new
File
(
filePath
);
InputStream
inputStream
=
new
FileInputStream
(
file
);
OutputStream
os
=
response
.
getOutputStream
();
inputStream
=
new
FileInputStream
(
file
);
os
=
response
.
getOutputStream
();
byte
[]
b
=
new
byte
[
1024
];
int
length
;
while
((
length
=
inputStream
.
read
(
b
))
>
0
)
{
os
.
write
(
b
,
0
,
length
);
}
os
.
close
();
inputStream
.
close
();
if
(
delete
&&
file
.
exists
())
{
file
.
delete
();
...
...
@@ -49,7 +54,19 @@ public class CommonController
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"下载文件失败"
,
e
);
}
finally
{
try
{
os
.
close
();
inputStream
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"close close fail "
,
e
);
}
}
}
...
...
src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -94,13 +94,9 @@ public class JobController extends BaseController
@ResponseBody
public
AjaxResult
changeStatus
(
Job
job
)
{
if
(
jobService
.
changeStatus
(
job
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
jobService
.
changeStatus
(
job
));
}
/**
* 任务调度立即执行一次
*/
...
...
@@ -110,50 +106,49 @@ public class JobController extends BaseController
@ResponseBody
public
AjaxResult
run
(
Job
job
)
{
if
(
jobService
.
run
(
job
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
jobService
.
run
(
job
));
}
/**
* 新增调度
*/
@Log
(
title
=
"定时任务"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"monitor:job:add"
)
@GetMapping
(
"/add"
)
public
String
add
(
Model
model
)
public
String
add
()
{
return
prefix
+
"/add"
;
}
/**
* 新增保存调度
*/
@Log
(
title
=
"定时任务"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"monitor:job:add"
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Job
job
)
{
return
toAjax
(
jobService
.
insertJobCron
(
job
));
}
/**
* 修改调度
*/
@Log
(
title
=
"定时任务"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"monitor:job:edit"
)
@GetMapping
(
"/edit/{jobId}"
)
public
String
edit
(
@PathVariable
(
"jobId"
)
Long
jobId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"jobId"
)
Long
jobId
,
Model
Map
mmap
)
{
Job
job
=
jobService
.
selectJobById
(
jobId
);
model
.
addAttribute
(
"job"
,
job
);
mmap
.
put
(
"job"
,
jobService
.
selectJobById
(
jobId
));
return
prefix
+
"/edit"
;
}
/**
* 保存调度
*
修改
保存调度
*/
@Log
(
title
=
"定时任务"
,
action
=
BusinessType
.
SAV
E
)
@RequiresPermissions
(
"monitor:job:
save
"
)
@PostMapping
(
"/
save
"
)
@Log
(
title
=
"定时任务"
,
action
=
BusinessType
.
UPDAT
E
)
@RequiresPermissions
(
"monitor:job:
edit
"
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Job
job
)
public
AjaxResult
editS
ave
(
Job
job
)
{
if
(
jobService
.
saveJobCron
(
job
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
jobService
.
updateJobCron
(
job
));
}
}
src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java
View file @
cc9c67cd
...
...
@@ -71,15 +71,6 @@ public class JobLogController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
try
{
jobLogService
.
deleteJobLogByIds
(
ids
);
return
success
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
e
.
getMessage
());
}
return
toAjax
(
jobLogService
.
deleteJobLogByIds
(
ids
));
}
}
src/main/java/com/ruoyi/project/monitor/job/service/IJobService.java
View file @
cc9c67cd
...
...
@@ -66,7 +66,7 @@ public interface IJobService
* @return 结果
*/
public
int
changeStatus
(
Job
job
);
/**
* 立即运行任务
*
...
...
@@ -81,7 +81,7 @@ public interface IJobService
* @param job 调度信息
* @return 结果
*/
public
int
add
JobCron
(
Job
job
);
public
int
insert
JobCron
(
Job
job
);
/**
* 更新任务的时间表达式
...
...
@@ -91,11 +91,4 @@ public interface IJobService
*/
public
int
updateJobCron
(
Job
job
);
/**
* 保存任务的时间表达式
*
* @param job 调度信息
* @return 结果
*/
public
int
saveJobCron
(
Job
job
);
}
src/main/java/com/ruoyi/project/monitor/job/service/JobLogServiceImpl.java
View file @
cc9c67cd
...
...
@@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.job.mapper.JobLogMapper;
*
* @author ruoyi
*/
@Service
(
"jobLogService"
)
@Service
public
class
JobLogServiceImpl
implements
IJobLogService
{
...
...
src/main/java/com/ruoyi/project/monitor/job/service/JobServiceImpl.java
View file @
cc9c67cd
package
com
.
ruoyi
.
project
.
monitor
.
job
.
service
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
org.quartz.CronTrigger
;
import
org.quartz.Scheduler
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.constant.ScheduleConstants
;
import
com.ruoyi.common.support.Convert
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
import
com.ruoyi.project.monitor.job.domain.Job
;
import
com.ruoyi.project.monitor.job.mapper.JobMapper
;
...
...
@@ -22,7 +18,7 @@ import com.ruoyi.project.monitor.job.util.ScheduleUtils;
*
* @author ruoyi
*/
@Service
(
"jobService"
)
@Service
public
class
JobServiceImpl
implements
IJobService
{
@Autowired
...
...
@@ -166,7 +162,7 @@ public class JobServiceImpl implements IJobService
}
return
rows
;
}
/**
* 立即运行任务
*
...
...
@@ -184,7 +180,7 @@ public class JobServiceImpl implements IJobService
* @param job 调度信息 调度信息
*/
@Override
public
int
add
JobCron
(
Job
job
)
public
int
insert
JobCron
(
Job
job
)
{
job
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
job
.
setStatus
(
ScheduleConstants
.
Status
.
PAUSE
.
getValue
());
...
...
@@ -204,6 +200,7 @@ public class JobServiceImpl implements IJobService
@Override
public
int
updateJobCron
(
Job
job
)
{
job
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
int
rows
=
jobMapper
.
updateJob
(
job
);
if
(
rows
>
0
)
{
...
...
@@ -212,25 +209,4 @@ public class JobServiceImpl implements IJobService
return
rows
;
}
/**
* 保存任务的时间表达式
*
* @param job 调度信息
*/
@Override
public
int
saveJobCron
(
Job
job
)
{
Long
jobId
=
job
.
getJobId
();
int
rows
=
0
;
if
(
StringUtils
.
isNotNull
(
jobId
))
{
rows
=
updateJobCron
(
job
);
}
else
{
rows
=
addJobCron
(
job
);
}
return
rows
;
}
}
src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java
View file @
cc9c67cd
...
...
@@ -71,11 +71,6 @@ public class LogininforController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
int
rows
=
logininforService
.
deleteLogininforByIds
(
ids
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
logininforService
.
deleteLogininforByIds
(
ids
));
}
}
src/main/java/com/ruoyi/project/monitor/logininfor/domain/Logininfor.java
View file @
cc9c67cd
...
...
@@ -14,7 +14,7 @@ public class Logininfor extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
/** ID */
@Excel
(
name
=
"序号"
)
private
Integer
infoId
;
private
Long
infoId
;
/** 用户账号 */
@Excel
(
name
=
"用户账号"
)
private
String
loginName
;
...
...
@@ -40,12 +40,12 @@ public class Logininfor extends BaseEntity
@Excel
(
name
=
"访问时间"
)
private
Date
loginTime
;
public
Integer
getInfoId
()
public
Long
getInfoId
()
{
return
infoId
;
}
public
void
setInfoId
(
Integer
infoId
)
public
void
setInfoId
(
Long
infoId
)
{
this
.
infoId
=
infoId
;
}
...
...
src/main/java/com/ruoyi/project/monitor/logininfor/service/LogininforServiceImpl.java
View file @
cc9c67cd
...
...
@@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.logininfor.mapper.LogininforMapper;
*
* @author ruoyi
*/
@Service
(
"logininforService"
)
@Service
public
class
LogininforServiceImpl
implements
ILogininforService
{
...
...
src/main/java/com/ruoyi/project/monitor/online/service/UserOnlineServiceImpl.java
View file @
cc9c67cd
...
...
@@ -15,7 +15,7 @@ import com.ruoyi.project.monitor.online.mapper.UserOnlineMapper;
*
* @author ruoyi
*/
@Service
(
"userOnlineService"
)
@Service
public
class
UserOnlineServiceImpl
implements
IUserOnlineService
{
@Autowired
...
...
src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -72,20 +72,14 @@ public class OperlogController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
int
rows
=
operLogService
.
deleteOperLogByIds
(
ids
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
operLogService
.
deleteOperLogByIds
(
ids
));
}
@RequiresPermissions
(
"monitor:operlog:detail"
)
@GetMapping
(
"/detail/{operId}"
)
public
String
detail
(
@PathVariable
(
"operId"
)
Long
deptId
,
Model
model
)
public
String
detail
(
@PathVariable
(
"operId"
)
Long
deptId
,
Model
Map
mmap
)
{
OperLog
operLog
=
operLogService
.
selectOperLogById
(
deptId
);
model
.
addAttribute
(
"operLog"
,
operLog
);
mmap
.
put
(
"operLog"
,
operLogService
.
selectOperLogById
(
deptId
));
return
prefix
+
"/detail"
;
}
}
src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java
View file @
cc9c67cd
...
...
@@ -16,7 +16,7 @@ public class OperLog extends BaseEntity
/** 日志主键 */
@Excel
(
name
=
"操作序号"
)
private
Integer
operId
;
private
Long
operId
;
/** 操作模块 */
@Excel
(
name
=
"操作模块"
)
...
...
@@ -70,12 +70,12 @@ public class OperLog extends BaseEntity
@Excel
(
name
=
"操作时间"
)
private
Date
operTime
;
public
Integer
getOperId
()
public
Long
getOperId
()
{
return
operId
;
}
public
void
setOperId
(
Integer
operId
)
public
void
setOperId
(
Long
operId
)
{
this
.
operId
=
operId
;
}
...
...
src/main/java/com/ruoyi/project/monitor/operlog/service/OperLogServiceImpl.java
View file @
cc9c67cd
...
...
@@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.operlog.mapper.OperLogMapper;
*
* @author ruoyi
*/
@Service
(
"operLogService"
)
@Service
public
class
OperLogServiceImpl
implements
IOperLogService
{
@Autowired
...
...
src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -35,7 +35,7 @@ public class ConfigController extends BaseController
@RequiresPermissions
(
"system:config:view"
)
@GetMapping
()
public
String
index
()
public
String
config
()
{
return
prefix
+
"/config"
;
}
...
...
@@ -52,7 +52,6 @@ public class ConfigController extends BaseController
List
<
Config
>
list
=
configService
.
selectConfigList
(
config
);
return
getDataTable
(
list
);
}
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
...
...
@@ -74,8 +73,6 @@ public class ConfigController extends BaseController
/**
* 新增参数配置
*/
@RequiresPermissions
(
"system:config:add"
)
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
INSERT
)
@GetMapping
(
"/add"
)
public
String
add
()
{
...
...
@@ -83,32 +80,37 @@ public class ConfigController extends BaseController
}
/**
* 新增保存参数配置
*/
@RequiresPermissions
(
"system:config:add"
)
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Config
config
)
{
return
toAjax
(
configService
.
insertConfig
(
config
));
}
/**
* 修改参数配置
*/
@RequiresPermissions
(
"system:config:edit"
)
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/edit/{configId}"
)
public
String
edit
(
@PathVariable
(
"configId"
)
Integer
configId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"configId"
)
Long
configId
,
ModelMap
mmap
)
{
Config
config
=
configService
.
selectConfigById
(
configId
);
model
.
addAttribute
(
"config"
,
config
);
mmap
.
addAttribute
(
"config"
,
configService
.
selectConfigById
(
configId
));
return
prefix
+
"/edit"
;
}
/**
* 保存参数配置
*
修改
保存参数配置
*/
@RequiresPermissions
(
"system:config:
save
"
)
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
SAV
E
)
@PostMapping
(
"/
save
"
)
@RequiresPermissions
(
"system:config:
edit
"
)
@Log
(
title
=
"参数管理"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Config
config
)
public
AjaxResult
editS
ave
(
Config
config
)
{
if
(
configService
.
saveConfig
(
config
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
configService
.
updateConfig
(
config
));
}
/**
...
...
@@ -120,11 +122,7 @@ public class ConfigController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
if
(
configService
.
deleteConfigByIds
(
ids
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
configService
.
deleteConfigByIds
(
ids
));
}
/**
...
...
src/main/java/com/ruoyi/project/system/config/domain/Config.java
View file @
cc9c67cd
...
...
@@ -14,7 +14,7 @@ public class Config extends BaseEntity
/** 参数主键 */
@Excel
(
name
=
"参数主键"
)
private
Integer
configId
;
private
Long
configId
;
/** 参数名称 */
@Excel
(
name
=
"参数名称"
)
...
...
@@ -32,12 +32,12 @@ public class Config extends BaseEntity
@Excel
(
name
=
"系统内置"
)
private
String
configType
;
public
Integer
getConfigId
()
public
Long
getConfigId
()
{
return
configId
;
}
public
void
setConfigId
(
Integer
configId
)
public
void
setConfigId
(
Long
configId
)
{
this
.
configId
=
configId
;
}
...
...
src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java
View file @
cc9c67cd
...
...
@@ -10,22 +10,13 @@ import java.util.List;
*/
public
interface
ConfigMapper
{
/**
* 查询参数配置信息
*
* @param configId 参数配置ID
* @return 参数配置信息
*/
public
Config
selectConfigById
(
Integer
configId
);
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @param configId 参数配置信息
* @return 参数配置信息
*/
public
Config
selectConfig
ByKey
(
String
configKey
);
public
Config
selectConfig
(
Config
config
);
/**
* 查询参数配置列表
...
...
@@ -36,6 +27,14 @@ public interface ConfigMapper
public
List
<
Config
>
selectConfigList
(
Config
config
);
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数配置信息
*/
public
Config
checkConfigKeyUnique
(
String
configKey
);
/**
* 新增参数配置
*
* @param config 参数配置信息
...
...
@@ -52,14 +51,6 @@ public interface ConfigMapper
public
int
updateConfig
(
Config
config
);
/**
* 删除参数配置
*
* @param configId 参数配置ID
* @return 结果
*/
public
int
deleteConfigById
(
Integer
configId
);
/**
* 批量删除参数配置
*
* @param configIds 需要删除的数据ID
...
...
src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java
View file @
cc9c67cd
...
...
@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.support.Convert
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
import
com.ruoyi.project.system.config.domain.Config
;
import
com.ruoyi.project.system.config.mapper.ConfigMapper
;
...
...
@@ -27,9 +28,11 @@ public class ConfigServiceImpl implements IConfigService
* @return 参数配置信息
*/
@Override
public
Config
selectConfigById
(
Integer
configId
)
public
Config
selectConfigById
(
Long
configId
)
{
return
configMapper
.
selectConfigById
(
configId
);
Config
config
=
new
Config
();
config
.
setConfigId
(
configId
);
return
configMapper
.
selectConfig
(
config
);
}
/**
...
...
@@ -41,8 +44,10 @@ public class ConfigServiceImpl implements IConfigService
@Override
public
String
selectConfigByKey
(
String
configKey
)
{
Config
config
=
configMapper
.
selectConfigByKey
(
configKey
);
return
StringUtils
.
isNotNull
(
config
)
?
config
.
getConfigValue
()
:
""
;
Config
config
=
new
Config
();
config
.
setConfigKey
(
configKey
);
Config
retConfig
=
configMapper
.
selectConfig
(
config
);
return
StringUtils
.
isNotNull
(
retConfig
)
?
retConfig
.
getConfigValue
()
:
""
;
}
/**
...
...
@@ -66,6 +71,7 @@ public class ConfigServiceImpl implements IConfigService
@Override
public
int
insertConfig
(
Config
config
)
{
config
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
configMapper
.
insertConfig
(
config
);
}
...
...
@@ -78,44 +84,11 @@ public class ConfigServiceImpl implements IConfigService
@Override
public
int
updateConfig
(
Config
config
)
{
config
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
configMapper
.
updateConfig
(
config
);
}
/**
* 保存参数配置
*
* @param config 参数配置信息
* @return 结果
*/
@Override
public
int
saveConfig
(
Config
config
)
{
Integer
configId
=
config
.
getConfigId
();
int
rows
=
0
;
if
(
StringUtils
.
isNotNull
(
configId
))
{
rows
=
configMapper
.
updateConfig
(
config
);
}
else
{
rows
=
configMapper
.
insertConfig
(
config
);
}
return
rows
;
}
/**
* 删除参数配置信息
*
* @param configId 参数配置ID
* @return 结果
*/
@Override
public
int
deleteConfigById
(
Integer
configId
)
{
return
configMapper
.
deleteConfigById
(
configId
);
}
/**
* 批量删除参数配置对象
*
* @param configIds 需要删除的数据ID
...
...
@@ -136,14 +109,9 @@ public class ConfigServiceImpl implements IConfigService
@Override
public
String
checkConfigKeyUnique
(
Config
config
)
{
if
(
config
.
getConfigId
()
==
null
)
{
config
.
setConfigId
(-
1
);
}
Integer
configId
=
config
.
getConfigId
();
Config
info
=
configMapper
.
selectConfigByKey
(
config
.
getConfigKey
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getConfigId
())
&&
info
.
getConfigId
().
intValue
()
!=
configId
.
intValue
())
Long
configId
=
StringUtils
.
isNull
(
config
.
getConfigId
())
?
-
1L
:
config
.
getConfigId
();
Config
info
=
configMapper
.
checkConfigKeyUnique
(
config
.
getConfigKey
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getConfigId
().
longValue
()
!=
configId
.
longValue
())
{
return
UserConstants
.
CONFIG_KEY_NOT_UNIQUE
;
}
...
...
src/main/java/com/ruoyi/project/system/config/service/IConfigService.java
View file @
cc9c67cd
...
...
@@ -17,7 +17,7 @@ public interface IConfigService
* @param configId 参数配置ID
* @return 参数配置信息
*/
public
Config
selectConfigById
(
Integer
configId
);
public
Config
selectConfigById
(
Long
configId
);
/**
* 根据键名查询参数配置信息
...
...
@@ -52,22 +52,6 @@ public interface IConfigService
public
int
updateConfig
(
Config
config
);
/**
* 保存参数配置
*
* @param config 参数配置信息
* @return 结果
*/
public
int
saveConfig
(
Config
config
);
/**
* 删除参数配置信息
*
* @param configId 参数配置ID
* @return 结果
*/
public
int
deleteConfigById
(
Integer
configId
);
/**
* 批量删除参数配置信息
*
* @param ids 需要删除的数据ID
...
...
src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@ import java.util.Map;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -49,45 +49,47 @@ public class DeptController extends BaseController
}
/**
*
修改
*
新增部门
*/
@Log
(
title
=
"部门管理"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:dept:edit"
)
@GetMapping
(
"/edit/{deptId}"
)
public
String
edit
(
@PathVariable
(
"deptId"
)
Long
deptId
,
Model
model
)
@GetMapping
(
"/add/{parentId}"
)
public
String
add
(
@PathVariable
(
"parentId"
)
Long
parentId
,
ModelMap
mmap
)
{
Dept
dept
=
deptService
.
selectDeptById
(
deptId
);
model
.
addAttribute
(
"dept"
,
dept
);
return
prefix
+
"/edit"
;
mmap
.
put
(
"dept"
,
deptService
.
selectDeptById
(
parentId
));
return
prefix
+
"/add"
;
}
/**
* 新增
* 新增
保存部门
*/
@Log
(
title
=
"部门管理"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:dept:add"
)
@GetMapping
(
"/add/{parentId}"
)
public
String
add
(
@PathVariable
(
"parentId"
)
Long
parentId
,
Model
model
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Dept
dept
)
{
Dept
dept
=
deptService
.
selectDeptById
(
parentId
);
model
.
addAttribute
(
"dept"
,
dept
);
return
prefix
+
"/add"
;
return
toAjax
(
deptService
.
insertDept
(
dept
));
}
/**
* 修改
*/
@GetMapping
(
"/edit/{deptId}"
)
public
String
edit
(
@PathVariable
(
"deptId"
)
Long
deptId
,
ModelMap
mmap
)
{
mmap
.
put
(
"dept"
,
deptService
.
selectDeptById
(
deptId
));
return
prefix
+
"/edit"
;
}
/**
* 保存
*/
@Log
(
title
=
"部门管理"
,
action
=
BusinessType
.
SAV
E
)
@RequiresPermissions
(
"system:dept:
save
"
)
@PostMapping
(
"/
save
"
)
@Log
(
title
=
"部门管理"
,
action
=
BusinessType
.
UPDAT
E
)
@RequiresPermissions
(
"system:dept:
edit
"
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Dept
dept
)
public
AjaxResult
editS
ave
(
Dept
dept
)
{
if
(
deptService
.
saveDept
(
dept
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
deptService
.
updateDept
(
dept
));
}
/**
...
...
@@ -107,11 +109,7 @@ public class DeptController extends BaseController
{
return
error
(
1
,
"部门存在用户,不允许删除"
);
}
if
(
deptService
.
deleteDeptById
(
deptId
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
deptService
.
deleteDeptById
(
deptId
));
}
/**
...
...
@@ -133,9 +131,9 @@ public class DeptController extends BaseController
* 选择部门树
*/
@GetMapping
(
"/selectDeptTree/{deptId}"
)
public
String
selectDeptTree
(
@PathVariable
(
"deptId"
)
Long
deptId
,
Model
model
)
public
String
selectDeptTree
(
@PathVariable
(
"deptId"
)
Long
deptId
,
Model
Map
mmap
)
{
m
odel
.
addAttribute
(
"treeName"
,
deptService
.
selectDeptById
(
deptId
).
getDeptName
());
m
map
.
put
(
"treeName"
,
deptService
.
selectDeptById
(
deptId
).
getDeptName
());
return
prefix
+
"/tree"
;
}
...
...
src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.
Repository
;
import
org.springframework.stereotype.
Service
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
...
...
@@ -17,7 +17,7 @@ import com.ruoyi.project.system.dept.mapper.DeptMapper;
*
* @author ruoyi
*/
@
Repository
(
"deptService"
)
@
Service
public
class
DeptServiceImpl
implements
IDeptService
{
@Autowired
...
...
@@ -111,24 +111,29 @@ public class DeptServiceImpl implements IDeptService
}
/**
* 保存部门信息
*
新增
保存部门信息
*
* @param dept 部门信息
* @return 结果
*/
@Override
public
int
save
Dept
(
Dept
dept
)
public
int
insert
Dept
(
Dept
dept
)
{
if
(
StringUtils
.
isNotNull
(
dept
.
getDeptId
()))
{
dept
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
deptMapper
.
updateDept
(
dept
);
}
else
{
dept
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
deptMapper
.
insertDept
(
dept
);
}
dept
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
deptMapper
.
insertDept
(
dept
);
}
/**
* 修改保存部门信息
*
* @param dept 部门信息
* @return 结果
*/
@Override
public
int
updateDept
(
Dept
dept
)
{
dept
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
deptMapper
.
updateDept
(
dept
);
}
/**
...
...
@@ -152,14 +157,9 @@ public class DeptServiceImpl implements IDeptService
@Override
public
String
checkDeptNameUnique
(
Dept
dept
)
{
if
(
dept
.
getDeptId
()
==
null
)
{
dept
.
setDeptId
(-
1L
);
}
Long
deptId
=
dept
.
getDeptId
();
Long
deptId
=
StringUtils
.
isNull
(
dept
.
getDeptId
())
?
-
1L
:
dept
.
getDeptId
();
Dept
info
=
deptMapper
.
checkDeptNameUnique
(
dept
.
getDeptName
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getDeptId
())
&&
info
.
getDeptId
().
longValue
()
!=
deptId
.
longValue
())
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getDeptId
().
longValue
()
!=
deptId
.
longValue
())
{
return
UserConstants
.
DEPT_NAME_NOT_UNIQUE
;
}
...
...
src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java
View file @
cc9c67cd
...
...
@@ -58,12 +58,20 @@ public interface IDeptService
public
int
deleteDeptById
(
Long
deptId
);
/**
* 保存部门信息
*
新增
保存部门信息
*
* @param dept 部门信息
* @return 结果
*/
public
int
saveDept
(
Dept
dept
);
public
int
insertDept
(
Dept
dept
);
/**
* 修改保存部门信息
*
* @param dept 部门信息
* @return 结果
*/
public
int
updateDept
(
Dept
dept
);
/**
* 根据部门ID查询信息
...
...
src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -68,44 +68,47 @@ public class DictDataController extends BaseController
}
/**
*
修改
字典类型
*
新增
字典类型
*/
@Log
(
title
=
"字典数据"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:dict:edit"
)
@GetMapping
(
"/edit/{dictCode}"
)
public
String
edit
(
@PathVariable
(
"dictCode"
)
Long
dictCode
,
Model
model
)
@GetMapping
(
"/add/{dictType}"
)
public
String
add
(
@PathVariable
(
"dictType"
)
String
dictType
,
ModelMap
mmap
)
{
DictData
dict
=
dictDataService
.
selectDictDataById
(
dictCode
);
model
.
addAttribute
(
"dict"
,
dict
);
return
prefix
+
"/edit"
;
mmap
.
put
(
"dictType"
,
dictType
);
return
prefix
+
"/add"
;
}
/**
* 新增字典类型
* 新增
保存
字典类型
*/
@Log
(
title
=
"字典数据"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:dict:add"
)
@GetMapping
(
"/add/{dictType}"
)
public
String
add
(
@PathVariable
(
"dictType"
)
String
dictType
,
Model
model
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
DictData
dict
)
{
model
.
addAttribute
(
"dictType"
,
dictType
);
return
prefix
+
"/add"
;
return
toAjax
(
dictDataService
.
insertDictData
(
dict
));
}
/**
* 修改字典类型
*/
@GetMapping
(
"/edit/{dictCode}"
)
public
String
edit
(
@PathVariable
(
"dictCode"
)
Long
dictCode
,
ModelMap
mmap
)
{
mmap
.
put
(
"dict"
,
dictDataService
.
selectDictDataById
(
dictCode
));
return
prefix
+
"/edit"
;
}
/**
* 保存字典类型
*
修改
保存字典类型
*/
@Log
(
title
=
"字典数据"
,
action
=
BusinessType
.
SAV
E
)
@RequiresPermissions
(
"system:dict:
save
"
)
@PostMapping
(
"/
save
"
)
@Log
(
title
=
"字典数据"
,
action
=
BusinessType
.
UPDAT
E
)
@RequiresPermissions
(
"system:dict:
edit
"
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
DictData
dict
)
public
AjaxResult
editS
ave
(
DictData
dict
)
{
if
(
dictDataService
.
saveDictData
(
dict
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
dictDataService
.
updateDictData
(
dict
));
}
@Log
(
title
=
"字典数据"
,
action
=
BusinessType
.
DELETE
)
...
...
@@ -114,11 +117,6 @@ public class DictDataController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
int
rows
=
dictDataService
.
deleteDictDataByIds
(
ids
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
dictDataService
.
deleteDictDataByIds
(
ids
));
}
}
src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -68,43 +68,46 @@ public class DictTypeController extends BaseController
}
/**
*
修改
字典类型
*
新增
字典类型
*/
@Log
(
title
=
"字典类型"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:dict:edit"
)
@GetMapping
(
"/edit/{dictId}"
)
public
String
edit
(
@PathVariable
(
"dictId"
)
Long
dictId
,
Model
model
)
@GetMapping
(
"/add"
)
public
String
add
()
{
DictType
dict
=
dictTypeService
.
selectDictTypeById
(
dictId
);
model
.
addAttribute
(
"dict"
,
dict
);
return
prefix
+
"/edit"
;
return
prefix
+
"/add"
;
}
/**
* 新增字典类型
* 新增
保存
字典类型
*/
@Log
(
title
=
"字典类型"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:dict:add"
)
@GetMapping
(
"/add"
)
public
String
add
()
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
DictType
dict
)
{
return
prefix
+
"/add"
;
return
toAjax
(
dictTypeService
.
insertDictType
(
dict
))
;
}
/**
*
保存
字典类型
*
修改
字典类型
*/
@Log
(
title
=
"字典类型"
,
action
=
BusinessType
.
SAVE
)
@RequiresPermissions
(
"system:dict:save"
)
@PostMapping
(
"/save"
)
@GetMapping
(
"/edit/{dictId}"
)
public
String
edit
(
@PathVariable
(
"dictId"
)
Long
dictId
,
ModelMap
mmap
)
{
mmap
.
put
(
"dict"
,
dictTypeService
.
selectDictTypeById
(
dictId
));
return
prefix
+
"/edit"
;
}
/**
* 修改保存字典类型
*/
@Log
(
title
=
"字典类型"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:dict:edit"
)
@PostMapping
(
"/edit"
)
@ResponseBody
public
AjaxResult
s
ave
(
DictType
dict
)
public
AjaxResult
editS
ave
(
DictType
dict
)
{
if
(
dictTypeService
.
saveDictType
(
dict
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
dictTypeService
.
updateDictType
(
dict
));
}
@Log
(
title
=
"字典类型"
,
action
=
BusinessType
.
DELETE
)
...
...
@@ -115,8 +118,7 @@ public class DictTypeController extends BaseController
{
try
{
dictTypeService
.
deleteDictTypeByIds
(
ids
);
return
success
();
return
toAjax
(
dictTypeService
.
deleteDictTypeByIds
(
ids
));
}
catch
(
Exception
e
)
{
...
...
@@ -129,12 +131,10 @@ public class DictTypeController extends BaseController
*/
@RequiresPermissions
(
"system:dict:list"
)
@GetMapping
(
"/detail/{dictId}"
)
public
String
detail
(
@PathVariable
(
"dictId"
)
Long
dictId
,
Model
model
)
public
String
detail
(
@PathVariable
(
"dictId"
)
Long
dictId
,
Model
Map
mmap
)
{
DictType
dict
=
dictTypeService
.
selectDictTypeById
(
dictId
);
List
<
DictType
>
dictTypeList
=
dictTypeService
.
selectDictTypeAll
();
model
.
addAttribute
(
"dict"
,
dict
);
model
.
addAttribute
(
"dictList"
,
dictTypeList
);
mmap
.
put
(
"dict"
,
dictTypeService
.
selectDictTypeById
(
dictId
));
mmap
.
put
(
"dictList"
,
dictTypeService
.
selectDictTypeAll
());
return
"system/dict/data/data"
;
}
...
...
src/main/java/com/ruoyi/project/system/dict/domain/DictData.java
View file @
cc9c67cd
...
...
@@ -36,6 +36,9 @@ public class DictData extends BaseEntity
@Excel
(
name
=
"字典样式"
)
private
String
cssClass
;
/** 表格字典样式 */
private
String
listClass
;
/** 是否默认(Y是 N否) */
@Excel
(
name
=
"是否默认"
)
private
String
isDefault
;
...
...
@@ -104,6 +107,16 @@ public class DictData extends BaseEntity
this
.
cssClass
=
cssClass
;
}
public
String
getListClass
()
{
return
listClass
;
}
public
void
setListClass
(
String
listClass
)
{
this
.
listClass
=
listClass
;
}
public
String
getIsDefault
()
{
return
isDefault
;
...
...
src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
View file @
cc9c67cd
package
com
.
ruoyi
.
project
.
system
.
dict
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.ruoyi.project.system.dict.domain.DictData
;
/**
...
...
@@ -18,7 +21,7 @@ public interface DictDataMapper
* @return 字典数据集合信息
*/
public
List
<
DictData
>
selectDictDataList
(
DictData
dictData
);
/**
* 根据字典类型查询字典数据
*
...
...
@@ -28,13 +31,22 @@ public interface DictDataMapper
public
List
<
DictData
>
selectDictDataByType
(
String
dictType
);
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public
String
selectDictLabel
(
@Param
(
"dictType"
)
String
dictType
,
@Param
(
"dictValue"
)
String
dictValue
);
/**
* 根据字典数据ID查询信息
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
public
DictData
selectDictDataById
(
Long
dictCode
);
/**
* 查询字典数据
*
...
...
@@ -42,7 +54,7 @@ public interface DictDataMapper
* @return 字典数据
*/
public
int
countDictDataByType
(
String
dictType
);
/**
* 通过字典ID删除字典数据信息
*
...
...
@@ -50,7 +62,7 @@ public interface DictDataMapper
* @return 结果
*/
public
int
deleteDictDataById
(
Long
dictCode
);
/**
* 批量删除字典数据
*
...
...
src/main/java/com/ruoyi/project/system/dict/service/DictDataServiceImpl.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,6 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.support.Convert
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
import
com.ruoyi.project.system.dict.domain.DictData
;
import
com.ruoyi.project.system.dict.mapper.DictDataMapper
;
...
...
@@ -14,7 +13,7 @@ import com.ruoyi.project.system.dict.mapper.DictDataMapper;
*
* @author ruoyi
*/
@Service
(
"dictDataService"
)
@Service
public
class
DictDataServiceImpl
implements
IDictDataService
{
@Autowired
...
...
@@ -45,6 +44,18 @@ public class DictDataServiceImpl implements IDictDataService
}
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public
String
selectDictLabel
(
String
dictType
,
String
dictValue
)
{
return
dictDataMapper
.
selectDictLabel
(
dictType
,
dictValue
);
}
/**
* 根据字典数据ID查询信息
*
* @param dictCode 字典数据ID
...
...
@@ -81,25 +92,29 @@ public class DictDataServiceImpl implements IDictDataService
}
/**
* 保存字典数据信息
* 新增保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
@Override
public
int
insertDictData
(
DictData
dictData
)
{
dictData
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
dictDataMapper
.
insertDictData
(
dictData
);
}
/**
* 修改保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
@Override
public
int
sav
eDictData
(
DictData
dictData
)
public
int
updat
eDictData
(
DictData
dictData
)
{
Long
dictCode
=
dictData
.
getDictCode
();
if
(
StringUtils
.
isNotNull
(
dictCode
))
{
dictData
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
dictDataMapper
.
updateDictData
(
dictData
);
}
else
{
dictData
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
dictDataMapper
.
insertDictData
(
dictData
);
}
dictData
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
dictDataMapper
.
updateDictData
(
dictData
);
}
}
src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java
View file @
cc9c67cd
...
...
@@ -16,7 +16,7 @@ import com.ruoyi.project.system.dict.mapper.DictTypeMapper;
*
* @author ruoyi
*/
@Service
(
"dictTypeService"
)
@Service
public
class
DictTypeServiceImpl
implements
IDictTypeService
{
@Autowired
...
...
@@ -95,25 +95,29 @@ public class DictTypeServiceImpl implements IDictTypeService
}
/**
* 保存字典类型信息
*
新增
保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
@Override
public
int
save
DictType
(
DictType
dictType
)
public
int
insert
DictType
(
DictType
dictType
)
{
Long
dictId
=
dictType
.
getDictId
();
if
(
StringUtils
.
isNotNull
(
dictId
))
{
dictType
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
dictTypeMapper
.
updateDictType
(
dictType
);
}
else
{
dictType
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
dictTypeMapper
.
insertDictType
(
dictType
);
}
dictType
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
dictTypeMapper
.
insertDictType
(
dictType
);
}
/**
* 修改保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
@Override
public
int
updateDictType
(
DictType
dictType
)
{
dictType
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
dictTypeMapper
.
updateDictType
(
dictType
);
}
/**
...
...
@@ -125,11 +129,7 @@ public class DictTypeServiceImpl implements IDictTypeService
@Override
public
String
checkDictTypeUnique
(
DictType
dict
)
{
if
(
dict
.
getDictId
()
==
null
)
{
dict
.
setDictId
(-
1L
);
}
Long
dictId
=
dict
.
getDictId
();
Long
dictId
=
StringUtils
.
isNull
(
dict
.
getDictId
())
?
-
1L
:
dict
.
getDictId
();
DictType
dictType
=
dictTypeMapper
.
checkDictTypeUnique
(
dict
.
getDictType
());
if
(
StringUtils
.
isNotNull
(
dictType
)
&&
dictType
.
getDictId
()
!=
dictId
)
{
...
...
src/main/java/com/ruoyi/project/system/dict/service/IDictDataService.java
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@ public interface IDictDataService
* @return 字典数据集合信息
*/
public
List
<
DictData
>
selectDictDataList
(
DictData
dictData
);
/**
* 根据字典类型查询字典数据
*
...
...
@@ -26,7 +26,16 @@ public interface IDictDataService
* @return 字典数据集合信息
*/
public
List
<
DictData
>
selectDictDataByType
(
String
dictType
);
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public
String
selectDictLabel
(
String
dictType
,
String
dictValue
);
/**
* 根据字典数据ID查询信息
*
...
...
@@ -34,7 +43,7 @@ public interface IDictDataService
* @return 字典数据
*/
public
DictData
selectDictDataById
(
Long
dictCode
);
/**
* 通过字典ID删除字典数据信息
*
...
...
@@ -52,11 +61,19 @@ public interface IDictDataService
public
int
deleteDictDataByIds
(
String
ids
);
/**
* 保存字典数据信息
* 新增保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public
int
insertDictData
(
DictData
dictData
);
/**
* 修改保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public
int
sav
eDictData
(
DictData
dictData
);
public
int
updat
eDictData
(
DictData
dictData
);
}
src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java
View file @
cc9c67cd
...
...
@@ -17,7 +17,7 @@ public interface IDictTypeService
* @return 字典类型集合信息
*/
public
List
<
DictType
>
selectDictTypeList
(
DictType
dictType
);
/**
* 根据所有字典类型
*
...
...
@@ -32,7 +32,7 @@ public interface IDictTypeService
* @return 字典类型
*/
public
DictType
selectDictTypeById
(
Long
dictId
);
/**
* 通过字典ID删除字典信息
*
...
...
@@ -41,22 +41,29 @@ public interface IDictTypeService
*/
public
int
deleteDictTypeById
(
Long
dictId
);
/**
* 批量删除字典类型
*
* @param ids 需要删除的数据
* @return 结果
*/
public
int
deleteDictTypeByIds
(
String
ids
)
throws
Exception
;
public
int
deleteDictTypeByIds
(
String
ids
)
throws
Exception
;
/**
* 新增保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public
int
insertDictType
(
DictType
dictType
);
/**
* 保存字典类型信息
*
修改
保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public
int
sav
eDictType
(
DictType
dictType
);
public
int
updat
eDictType
(
DictType
dictType
);
/**
* 校验字典类型称是否唯一
...
...
src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@ import java.util.Map;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -67,33 +67,14 @@ public class MenuController extends BaseController
{
return
error
(
1
,
"菜单已分配,不允许删除"
);
}
if
(
menuService
.
deleteMenuById
(
menuId
)
>
0
)
{
return
success
();
}
return
error
();
}
/**
* 修改菜单
*/
@Log
(
title
=
"菜单管理"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:menu:edit"
)
@GetMapping
(
"/edit/{menuId}"
)
public
String
edit
(
@PathVariable
(
"menuId"
)
Long
menuId
,
Model
model
)
{
Menu
menu
=
menuService
.
selectMenuById
(
menuId
);
model
.
addAttribute
(
"menu"
,
menu
);
return
prefix
+
"/edit"
;
return
toAjax
(
menuService
.
deleteMenuById
(
menuId
));
}
/**
* 新增
*/
@Log
(
title
=
"菜单管理"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:menu:add"
)
@GetMapping
(
"/add/{parentId}"
)
public
String
add
(
@PathVariable
(
"parentId"
)
Long
parentId
,
Model
model
)
public
String
add
(
@PathVariable
(
"parentId"
)
Long
parentId
,
Model
Map
mmap
)
{
Menu
menu
=
null
;
if
(
0L
!=
parentId
)
...
...
@@ -106,24 +87,42 @@ public class MenuController extends BaseController
menu
.
setMenuId
(
0L
);
menu
.
setMenuName
(
"主目录"
);
}
m
odel
.
addAttribute
(
"menu"
,
menu
);
m
map
.
put
(
"menu"
,
menu
);
return
prefix
+
"/add"
;
}
/**
* 保存菜单
*
新增
保存菜单
*/
@Log
(
title
=
"菜单管理"
,
action
=
BusinessType
.
SAVE
)
@RequiresPermissions
(
"system:menu:
save
"
)
@PostMapping
(
"/
save
"
)
@Log
(
title
=
"菜单管理"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:menu:
add
"
)
@PostMapping
(
"/
add
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Menu
menu
)
public
AjaxResult
addS
ave
(
Menu
menu
)
{
if
(
menuService
.
saveMenu
(
menu
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
menuService
.
insertMenu
(
menu
));
}
/**
* 修改菜单
*/
@GetMapping
(
"/edit/{menuId}"
)
public
String
edit
(
@PathVariable
(
"menuId"
)
Long
menuId
,
ModelMap
mmap
)
{
mmap
.
put
(
"menu"
,
menuService
.
selectMenuById
(
menuId
));
return
prefix
+
"/edit"
;
}
/**
* 修改保存菜单
*/
@Log
(
title
=
"菜单管理"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:menu:edit"
)
@PostMapping
(
"/edit"
)
@ResponseBody
public
AjaxResult
editSave
(
Menu
menu
)
{
return
toAjax
(
menuService
.
updateMenu
(
menu
));
}
/**
...
...
@@ -176,9 +175,9 @@ public class MenuController extends BaseController
* 选择菜单树
*/
@GetMapping
(
"/selectMenuTree/{menuId}"
)
public
String
selectMenuTree
(
@PathVariable
(
"menuId"
)
Long
menuId
,
Model
model
)
public
String
selectMenuTree
(
@PathVariable
(
"menuId"
)
Long
menuId
,
Model
Map
mmap
)
{
m
odel
.
addAttribute
(
"treeName"
,
menuService
.
selectMenuById
(
menuId
).
getMenuName
());
m
map
.
put
(
"treeName"
,
menuService
.
selectMenuById
(
menuId
).
getMenuName
());
return
prefix
+
"/tree"
;
}
}
\ No newline at end of file
src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java
View file @
cc9c67cd
...
...
@@ -100,12 +100,20 @@ public interface IMenuService
public
int
selectCountRoleMenuByMenuId
(
Long
menuId
);
/**
* 保存菜单信息
*
新增
保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
public
int
saveMenu
(
Menu
menu
);
public
int
insertMenu
(
Menu
menu
);
/**
* 修改保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
public
int
updateMenu
(
Menu
menu
);
/**
* 校验菜单名称是否唯一
...
...
src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java
View file @
cc9c67cd
...
...
@@ -25,7 +25,7 @@ import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
*
* @author ruoyi
*/
@Service
(
"menuService"
)
@Service
public
class
MenuServiceImpl
implements
IMenuService
{
public
static
final
String
PREMISSION_STRING
=
"perms[\"{0}\"]"
;
...
...
@@ -245,27 +245,31 @@ public class MenuServiceImpl implements IMenuService
}
/**
* 保存菜单信息
*
新增
保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
@Override
public
int
save
Menu
(
Menu
menu
)
public
int
insert
Menu
(
Menu
menu
)
{
Long
menuId
=
menu
.
getMenuId
();
if
(
StringUtils
.
isNotNull
(
menuId
))
{
menu
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
menuMapper
.
updateMenu
(
menu
);
}
else
{
menu
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
menuMapper
.
insertMenu
(
menu
);
}
menu
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
menuMapper
.
insertMenu
(
menu
);
}
/**
* 修改保存菜单信息
*
* @param menu 菜单信息
* @return 结果
*/
@Override
public
int
updateMenu
(
Menu
menu
)
{
menu
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
menuMapper
.
updateMenu
(
menu
);
}
/**
...
...
@@ -277,14 +281,9 @@ public class MenuServiceImpl implements IMenuService
@Override
public
String
checkMenuNameUnique
(
Menu
menu
)
{
if
(
menu
.
getMenuId
()
==
null
)
{
menu
.
setMenuId
(-
1L
);
}
Long
menuId
=
menu
.
getMenuId
();
Long
menuId
=
StringUtils
.
isNull
(
menu
.
getMenuId
())
?
-
1L
:
menu
.
getMenuId
();
Menu
info
=
menuMapper
.
checkMenuNameUnique
(
menu
.
getMenuName
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getMenuId
())
&&
info
.
getMenuId
().
longValue
()
!=
menuId
.
longValue
())
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getMenuId
().
longValue
()
!=
menuId
.
longValue
())
{
return
UserConstants
.
MENU_NAME_NOT_UNIQUE
;
}
...
...
src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java
View file @
cc9c67cd
...
...
@@ -4,19 +4,19 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ruoyi.project.system.notice.domain.Notice
;
import
com.ruoyi.project.system.notice.service.INoticeService
;
import
com.ruoyi.framework.aspectj.lang.annotation.Log
;
import
com.ruoyi.framework.aspectj.lang.constant.BusinessType
;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.project.system.notice.domain.Notice
;
import
com.ruoyi.project.system.notice.service.INoticeService
;
/**
* 公告 信息操作处理
...
...
@@ -55,8 +55,6 @@ public class NoticeController extends BaseController
/**
* 新增公告
*/
@RequiresPermissions
(
"system:notice:add"
)
@Log
(
title
=
"通知公告"
,
action
=
BusinessType
.
INSERT
)
@GetMapping
(
"/add"
)
public
String
add
()
{
...
...
@@ -64,32 +62,37 @@ public class NoticeController extends BaseController
}
/**
* 新增保存公告
*/
@RequiresPermissions
(
"system:notice:add"
)
@Log
(
title
=
"通知公告"
,
action
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Notice
notice
)
{
return
toAjax
(
noticeService
.
insertNotice
(
notice
));
}
/**
* 修改公告
*/
@RequiresPermissions
(
"system:notice:edit"
)
@Log
(
title
=
"通知公告"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/edit/{noticeId}"
)
public
String
edit
(
@PathVariable
(
"noticeId"
)
Integer
noticeId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"noticeId"
)
Long
noticeId
,
ModelMap
mmap
)
{
Notice
notice
=
noticeService
.
selectNoticeById
(
noticeId
);
model
.
addAttribute
(
"notice"
,
notice
);
mmap
.
put
(
"notice"
,
noticeService
.
selectNoticeById
(
noticeId
));
return
prefix
+
"/edit"
;
}
/**
* 保存公告
*
修改
保存公告
*/
@RequiresPermissions
(
"system:notice:
save
"
)
@Log
(
title
=
"通知公告"
,
action
=
BusinessType
.
SAV
E
)
@PostMapping
(
"/
save
"
)
@RequiresPermissions
(
"system:notice:
edit
"
)
@Log
(
title
=
"通知公告"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Notice
notice
)
public
AjaxResult
editS
ave
(
Notice
notice
)
{
if
(
noticeService
.
saveNotice
(
notice
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
noticeService
.
updateNotice
(
notice
));
}
/**
...
...
@@ -101,12 +104,7 @@ public class NoticeController extends BaseController
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
int
rows
=
noticeService
.
deleteNoticeByIds
(
ids
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
noticeService
.
deleteNoticeByIds
(
ids
));
}
}
src/main/java/com/ruoyi/project/system/notice/domain/Notice.java
View file @
cc9c67cd
...
...
@@ -12,7 +12,7 @@ public class Notice extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
/** 公告ID */
private
Integer
noticeId
;
private
Long
noticeId
;
/** 公告标题 */
private
String
noticeTitle
;
/** 公告类型(1通知 2公告) */
...
...
@@ -22,14 +22,14 @@ public class Notice extends BaseEntity
/** 公告状态(0正常 1关闭) */
private
String
status
;
public
void
setNoticeId
(
Integer
noticeId
)
public
Long
getNoticeId
(
)
{
this
.
noticeId
=
noticeId
;
return
noticeId
;
}
public
Integer
getNoticeId
(
)
public
void
setNoticeId
(
Long
noticeId
)
{
return
noticeId
;
this
.
noticeId
=
noticeId
;
}
public
void
setNoticeTitle
(
String
noticeTitle
)
...
...
src/main/java/com/ruoyi/project/system/notice/mapper/NoticeMapper.java
View file @
cc9c67cd
...
...
@@ -16,7 +16,7 @@ public interface NoticeMapper
* @param noticeId 公告ID
* @return 公告信息
*/
public
Notice
selectNoticeById
(
Integer
noticeId
);
public
Notice
selectNoticeById
(
Long
noticeId
);
/**
* 查询公告列表
...
...
src/main/java/com/ruoyi/project/system/notice/service/INoticeService.java
View file @
cc9c67cd
...
...
@@ -16,7 +16,7 @@ public interface INoticeService
* @param noticeId 公告ID
* @return 公告信息
*/
public
Notice
selectNoticeById
(
Integer
noticeId
);
public
Notice
selectNoticeById
(
Long
noticeId
);
/**
* 查询公告列表
...
...
@@ -43,14 +43,6 @@ public interface INoticeService
public
int
updateNotice
(
Notice
notice
);
/**
* 保存公告
*
* @param notice 公告信息
* @return 结果
*/
public
int
saveNotice
(
Notice
notice
);
/**
* 删除公告信息
*
* @param ids 需要删除的数据ID
...
...
src/main/java/com/ruoyi/project/system/notice/service/NoticeServiceImpl.java
View file @
cc9c67cd
...
...
@@ -3,7 +3,6 @@ package com.ruoyi.project.system.notice.service;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
import
com.ruoyi.project.system.notice.mapper.NoticeMapper
;
import
com.ruoyi.project.system.notice.domain.Notice
;
...
...
@@ -29,7 +28,7 @@ public class NoticeServiceImpl implements INoticeService
* @return 公告信息
*/
@Override
public
Notice
selectNoticeById
(
Integer
noticeId
)
public
Notice
selectNoticeById
(
Long
noticeId
)
{
return
noticeMapper
.
selectNoticeById
(
noticeId
);
}
...
...
@@ -55,6 +54,7 @@ public class NoticeServiceImpl implements INoticeService
@Override
public
int
insertNotice
(
Notice
notice
)
{
notice
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
return
noticeMapper
.
insertNotice
(
notice
);
}
...
...
@@ -67,36 +67,11 @@ public class NoticeServiceImpl implements INoticeService
@Override
public
int
updateNotice
(
Notice
notice
)
{
notice
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
noticeMapper
.
updateNotice
(
notice
);
}
/**
* 保存公告
*
* @param notice 公告信息
* @return 结果
*/
@Override
public
int
saveNotice
(
Notice
notice
)
{
Integer
noticeId
=
notice
.
getNoticeId
();
int
rows
=
0
;
if
(
StringUtils
.
isNotNull
(
noticeId
))
{
notice
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 修改公告
rows
=
noticeMapper
.
updateNotice
(
notice
);
}
else
{
notice
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增公告
rows
=
noticeMapper
.
insertNotice
(
notice
);
}
return
rows
;
}
/**
* 删除公告对象
*
* @param ids 需要删除的数据ID
...
...
src/main/java/com/ruoyi/project/system/post/controller/PostController.java
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -75,8 +75,7 @@ public class PostController extends BaseController
{
try
{
postService
.
deletePostByIds
(
ids
);
return
success
();
return
toAjax
(
postService
.
deletePostByIds
(
ids
));
}
catch
(
Exception
e
)
{
...
...
@@ -87,41 +86,44 @@ public class PostController extends BaseController
/**
* 新增岗位
*/
@Log
(
title
=
"岗位管理"
,
action
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"system:post:add"
)
@GetMapping
(
"/add"
)
public
String
add
(
Model
model
)
public
String
add
()
{
return
prefix
+
"/add"
;
}
/**
* 新增保存岗位
*/
@RequiresPermissions
(
"system:post:add"
)
@Log
(
title
=
"岗位管理"
,
action
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Post
post
)
{
return
toAjax
(
postService
.
insertPost
(
post
));
}
/**
* 修改岗位
*/
@Log
(
title
=
"岗位管理"
,
action
=
BusinessType
.
UPDATE
)
@RequiresPermissions
(
"system:post:edit"
)
@GetMapping
(
"/edit/{postId}"
)
public
String
edit
(
@PathVariable
(
"postId"
)
Long
postId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"postId"
)
Long
postId
,
Model
Map
mmap
)
{
Post
post
=
postService
.
selectPostById
(
postId
);
model
.
addAttribute
(
"post"
,
post
);
mmap
.
put
(
"post"
,
postService
.
selectPostById
(
postId
));
return
prefix
+
"/edit"
;
}
/**
* 保存岗位
*
修改
保存岗位
*/
@
Log
(
title
=
"岗位管理"
,
action
=
BusinessType
.
SAVE
)
@
RequiresPermissions
(
"system:post:save"
)
@PostMapping
(
"/
save
"
)
@
RequiresPermissions
(
"system:post:edit"
)
@
Log
(
title
=
"岗位管理"
,
action
=
BusinessType
.
UPDATE
)
@PostMapping
(
"/
edit
"
)
@ResponseBody
public
AjaxResult
s
ave
(
Post
post
)
public
AjaxResult
editS
ave
(
Post
post
)
{
if
(
postService
.
savePost
(
post
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
postService
.
updatePost
(
post
));
}
}
src/main/java/com/ruoyi/project/system/post/mapper/PostMapper.java
View file @
cc9c67cd
...
...
@@ -43,14 +43,6 @@ public interface PostMapper
public
Post
selectPostById
(
Long
postId
);
/**
* 通过岗位ID删除岗位信息
*
* @param postId 岗位ID
* @return 结果
*/
public
int
deletePostById
(
Long
postId
);
/**
* 批量删除岗位信息
*
* @param ids 需要删除的数据ID
...
...
src/main/java/com/ruoyi/project/system/post/service/IPostService.java
View file @
cc9c67cd
...
...
@@ -42,28 +42,28 @@ public interface IPostService
public
Post
selectPostById
(
Long
postId
);
/**
*
通过岗位ID
删除岗位信息
*
批量
删除岗位信息
*
* @param postId 岗位ID
* @return 结果
* @param ids 需要删除的数据ID
*/
public
boolean
deletePostById
(
Long
postId
)
;
public
int
deletePostByIds
(
String
ids
)
throws
Exception
;
/**
*
批量删除
岗位信息
*
新增保存
岗位信息
*
* @param ids 需要删除的数据ID
* @param post 岗位信息
* @return 结果
*/
public
void
deletePostByIds
(
String
ids
)
throws
Exception
;
public
int
insertPost
(
Post
post
)
;
/**
* 保存岗位信息
*
修改
保存岗位信息
*
* @param post 岗位信息
* @return 结果
*/
public
int
sav
ePost
(
Post
post
);
public
int
updat
ePost
(
Post
post
);
/**
* 通过岗位ID查询岗位使用数量
*
...
...
src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java
View file @
cc9c67cd
...
...
@@ -3,9 +3,7 @@ package com.ruoyi.project.system.post.service;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.support.Convert
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.security.ShiroUtils
;
import
com.ruoyi.project.system.post.domain.Post
;
import
com.ruoyi.project.system.post.mapper.PostMapper
;
...
...
@@ -16,7 +14,7 @@ import com.ruoyi.project.system.user.mapper.UserPostMapper;
*
* @author ruoyi
*/
@Service
(
"postService"
)
@Service
public
class
PostServiceImpl
implements
IPostService
{
@Autowired
...
...
@@ -86,25 +84,13 @@ public class PostServiceImpl implements IPostService
}
/**
* 通过岗位ID删除岗位信息
*
* @param postId 岗位ID
* @return 结果
*/
@Override
public
boolean
deletePostById
(
Long
postId
)
{
return
postMapper
.
deletePostById
(
postId
)
>
0
?
true
:
false
;
}
/**
* 批量删除岗位信息
*
* @param ids 需要删除的数据ID
* @throws Exception
*/
@Override
public
void
deletePostByIds
(
String
ids
)
throws
Exception
public
int
deletePostByIds
(
String
ids
)
throws
Exception
{
Long
[]
postIds
=
Convert
.
toLongArray
(
ids
);
for
(
Long
postId
:
postIds
)
...
...
@@ -115,33 +101,33 @@ public class PostServiceImpl implements IPostService
throw
new
Exception
(
String
.
format
(
"%1$s已分配,不能删除"
,
post
.
getPostName
()));
}
}
postMapper
.
deletePostByIds
(
postIds
);
return
postMapper
.
deletePostByIds
(
postIds
);
}
/**
* 保存岗位信息
*
新增
保存岗位信息
*
* @param post 岗位信息
* @return 结果
*/
@Override
public
int
save
Post
(
Post
post
)
public
int
insert
Post
(
Post
post
)
{
Long
postId
=
post
.
getPostId
(
);
int
count
=
0
;
if
(
StringUtils
.
isNotNull
(
postId
))
{
post
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 修改
岗位信息
count
=
postMapper
.
updatePost
(
post
);
}
else
{
post
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增岗位信息
count
=
postMapper
.
insertPost
(
post
);
}
return
count
;
post
.
setCreateBy
(
ShiroUtils
.
getLoginName
()
);
return
postMapper
.
insertPost
(
post
)
;
}
/**
* 修改保存
岗位信息
*
* @param post 岗位信息
* @return 结果
*/
@Override
public
int
updatePost
(
Post
post
)
{
post
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
return
postMapper
.
updatePost
(
post
)
;
}
/**
...
...
src/main/java/com/ruoyi/project/system/role/controller/RoleController.java
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -72,42 +72,47 @@ public class RoleController extends BaseController
/**
* 新增角色
*/
@RequiresPermissions
(
"system:role:add"
)
@Log
(
title
=
"角色管理"
,
action
=
BusinessType
.
INSERT
)
@GetMapping
(
"/add"
)
public
String
add
(
Model
model
)
public
String
add
()
{
return
prefix
+
"/add"
;
}
/**
* 新增保存角色
*/
@RequiresPermissions
(
"system:role:add"
)
@Log
(
title
=
"角色管理"
,
action
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ResponseBody
public
AjaxResult
addSave
(
Role
role
)
{
return
toAjax
(
roleService
.
insertRole
(
role
));
}
/**
* 修改角色
*/
@RequiresPermissions
(
"system:role:edit"
)
@Log
(
title
=
"角色管理"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/edit/{roleId}"
)
public
String
edit
(
@PathVariable
(
"roleId"
)
Long
roleId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"roleId"
)
Long
roleId
,
Model
Map
mmap
)
{
Role
role
=
roleService
.
selectRoleById
(
roleId
);
model
.
addAttribute
(
"role"
,
role
);
mmap
.
put
(
"role"
,
roleService
.
selectRoleById
(
roleId
));
return
prefix
+
"/edit"
;
}
/**
* 保存角色
*
修改
保存角色
*/
@RequiresPermissions
(
"system:role:
save
"
)
@Log
(
title
=
"角色管理"
,
action
=
BusinessType
.
SAV
E
)
@PostMapping
(
"/
save
"
)
@RequiresPermissions
(
"system:role:
edit
"
)
@Log
(
title
=
"角色管理"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/
edit
"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ResponseBody
public
AjaxResult
s
ave
(
Role
role
)
public
AjaxResult
editS
ave
(
Role
role
)
{
if
(
roleService
.
saveRole
(
role
)
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
roleService
.
updateRole
(
role
));
}
@RequiresPermissions
(
"system:role:remove"
)
...
...
@@ -118,8 +123,7 @@ public class RoleController extends BaseController
{
try
{
roleService
.
deleteRoleByIds
(
ids
);
return
success
();
return
toAjax
(
roleService
.
deleteRoleByIds
(
ids
));
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/ruoyi/project/system/role/service/IRoleService.java
View file @
cc9c67cd
...
...
@@ -64,16 +64,24 @@ public interface IRoleService
*
* @param ids 需要删除的数据ID
*/
public
void
deleteRoleByIds
(
String
ids
)
throws
Exception
;
public
int
deleteRoleByIds
(
String
ids
)
throws
Exception
;
/**
* 保存角色信息
*
新增
保存角色信息
*
* @param role 角色信息
* @return 结果
*/
public
int
saveRole
(
Role
role
);
public
int
insertRole
(
Role
role
);
/**
* 修改保存角色信息
*
* @param role 角色信息
* @return 结果
*/
public
int
updateRole
(
Role
role
);
/**
* 校验角色名称是否唯一
*
...
...
@@ -81,7 +89,7 @@ public interface IRoleService
* @return 结果
*/
public
String
checkRoleNameUnique
(
Role
role
);
/**
* 通过角色ID查询角色使用数量
*
...
...
src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java
View file @
cc9c67cd
...
...
@@ -22,7 +22,7 @@ import com.ruoyi.project.system.user.mapper.UserRoleMapper;
*
* @author ruoyi
*/
@Service
(
"roleService"
)
@Service
public
class
RoleServiceImpl
implements
IRoleService
{
...
...
@@ -135,7 +135,7 @@ public class RoleServiceImpl implements IRoleService
* @throws Exception
*/
@Override
public
void
deleteRoleByIds
(
String
ids
)
throws
Exception
public
int
deleteRoleByIds
(
String
ids
)
throws
Exception
{
Long
[]
roleIds
=
Convert
.
toLongArray
(
ids
);
for
(
Long
roleId
:
roleIds
)
...
...
@@ -146,33 +146,39 @@ public class RoleServiceImpl implements IRoleService
throw
new
Exception
(
String
.
format
(
"%1$s已分配,不能删除"
,
role
.
getRoleName
()));
}
}
roleMapper
.
deleteRoleByIds
(
roleIds
);
r
eturn
r
oleMapper
.
deleteRoleByIds
(
roleIds
);
}
/**
* 保存角色信息
*
新增
保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
public
int
save
Role
(
Role
role
)
public
int
insert
Role
(
Role
role
)
{
Long
roleId
=
role
.
getRoleId
();
if
(
StringUtils
.
isNotNull
(
roleId
))
{
role
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 修改角色信息
roleMapper
.
updateRole
(
role
);
// 删除角色与菜单关联
roleMenuMapper
.
deleteRoleMenuByRoleId
(
roleId
);
}
else
{
role
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增角色信息
roleMapper
.
insertRole
(
role
);
}
role
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增角色信息
roleMapper
.
insertRole
(
role
);
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
insertRoleMenu
(
role
);
}
/**
* 修改保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
public
int
updateRole
(
Role
role
)
{
role
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 修改角色信息
roleMapper
.
updateRole
(
role
);
// 删除角色与菜单关联
roleMenuMapper
.
deleteRoleMenuByRoleId
(
role
.
getRoleId
());
ShiroUtils
.
clearCachedAuthorizationInfo
();
return
insertRoleMenu
(
role
);
}
...
...
@@ -210,13 +216,9 @@ public class RoleServiceImpl implements IRoleService
@Override
public
String
checkRoleNameUnique
(
Role
role
)
{
if
(
role
.
getRoleId
()
==
null
)
{
role
.
setRoleId
(-
1L
);
}
Long
roleId
=
role
.
getRoleId
();
Long
roleId
=
StringUtils
.
isNull
(
role
.
getRoleId
())
?
-
1L
:
role
.
getRoleId
();
Role
info
=
roleMapper
.
checkRoleNameUnique
(
role
.
getRoleName
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getRoleId
())
&&
info
.
getRoleId
()
!=
roleId
)
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getRoleId
().
longValue
()
!=
roleId
.
longValue
()
)
{
return
UserConstants
.
ROLE_NAME_NOT_UNIQUE
;
}
...
...
src/main/java/com/ruoyi/project/system/user/controller/IndexController.java
View file @
cc9c67cd
...
...
@@ -3,7 +3,7 @@ package com.ruoyi.project.system.user.controller;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
com.ruoyi.framework.config.RuoYiConfig
;
import
com.ruoyi.framework.web.controller.BaseController
;
...
...
@@ -27,23 +27,23 @@ public class IndexController extends BaseController
// 系统首页
@GetMapping
(
"/index"
)
public
String
index
(
Model
model
)
public
String
index
(
Model
Map
mmap
)
{
// 取身份信息
User
user
=
getUser
();
// 根据用户id取出菜单
List
<
Menu
>
menus
=
menuService
.
selectMenusByUserId
(
user
.
getUserId
());
m
odel
.
addAttribute
(
"menus"
,
menus
);
m
odel
.
addAttribute
(
"user"
,
user
);
m
odel
.
addAttribute
(
"copyrightYear"
,
ruoYiConfig
.
getCopyrightYear
());
m
map
.
put
(
"menus"
,
menus
);
m
map
.
put
(
"user"
,
user
);
m
map
.
put
(
"copyrightYear"
,
ruoYiConfig
.
getCopyrightYear
());
return
"index"
;
}
// 系统介绍
@GetMapping
(
"/system/main"
)
public
String
main
(
Model
model
)
public
String
main
(
Model
Map
mmap
)
{
m
odel
.
addAttribute
(
"version"
,
ruoYiConfig
.
getVersion
());
m
map
.
put
(
"version"
,
ruoYiConfig
.
getVersion
());
return
"main"
;
}
...
...
src/main/java/com/ruoyi/project/system/user/controller/LoginController.java
View file @
cc9c67cd
...
...
@@ -7,7 +7,6 @@ import org.apache.shiro.authc.AuthenticationException;
import
org.apache.shiro.authc.UsernamePasswordToken
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -26,7 +25,7 @@ public class LoginController extends BaseController
{
@GetMapping
(
"/login"
)
public
String
login
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
public
String
login
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
// 如果是Ajax请求,返回Json字符串。
if
(
ServletUtils
.
isAjaxRequest
((
HttpServletRequest
)
request
))
...
...
src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java
View file @
cc9c67cd
...
...
@@ -5,7 +5,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
Map
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -18,6 +18,7 @@ import com.ruoyi.framework.aspectj.lang.annotation.Log;
import
com.ruoyi.framework.aspectj.lang.constant.BusinessType
;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
import
com.ruoyi.framework.web.service.DictService
;
import
com.ruoyi.project.system.user.domain.User
;
import
com.ruoyi.project.system.user.service.IUserService
;
...
...
@@ -37,27 +38,20 @@ public class ProfileController extends BaseController
@Autowired
private
IUserService
userService
;
@Autowired
private
DictService
dict
;
/**
* 个人信息
*/
@GetMapping
()
public
String
profile
(
Model
model
)
public
String
profile
(
Model
Map
mmap
)
{
User
user
=
getUser
();
String
sex
=
user
.
getSex
();
if
(
"0"
.
equals
(
sex
))
{
user
.
setSex
(
"性别:男"
);
}
else
if
(
"1"
.
equals
(
sex
))
{
user
.
setSex
(
"性别:女"
);
}
String
roleGroup
=
userService
.
selectUserRoleGroup
(
user
.
getUserId
());
String
postGroup
=
userService
.
selectUserPostGroup
(
user
.
getUserId
());
model
.
addAttribute
(
"user"
,
user
);
model
.
addAttribute
(
"roleGroup"
,
roleGroup
);
model
.
addAttribute
(
"postGroup"
,
postGroup
);
user
.
setSex
(
dict
.
getLabel
(
"sys_user_sex"
,
user
.
getSex
()));
mmap
.
put
(
"user"
,
user
);
mmap
.
put
(
"roleGroup"
,
userService
.
selectUserRoleGroup
(
user
.
getUserId
()));
mmap
.
put
(
"postGroup"
,
userService
.
selectUserPostGroup
(
user
.
getUserId
()));
return
prefix
+
"/profile"
;
}
...
...
@@ -75,10 +69,9 @@ public class ProfileController extends BaseController
}
@GetMapping
(
"/resetPwd/{userId}"
)
public
String
resetPwd
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
model
)
public
String
resetPwd
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
Map
mmap
)
{
User
user
=
userService
.
selectUserById
(
userId
);
model
.
addAttribute
(
"user"
,
user
);
mmap
.
put
(
"user"
,
userService
.
selectUserById
(
userId
));
return
prefix
+
"/resetPwd"
;
}
...
...
@@ -99,36 +92,32 @@ public class ProfileController extends BaseController
/**
* 修改用户
*/
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/edit/{userId}"
)
public
String
edit
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
Map
mmap
)
{
User
user
=
userService
.
selectUserById
(
userId
);
model
.
addAttribute
(
"user"
,
user
);
mmap
.
put
(
"user"
,
userService
.
selectUserById
(
userId
));
return
prefix
+
"/edit"
;
}
/**
* 修改头像
*/
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/avatar/{userId}"
)
public
String
avatar
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
model
)
public
String
avatar
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
Map
mmap
)
{
User
user
=
userService
.
selectUserById
(
userId
);
model
.
addAttribute
(
"user"
,
user
);
mmap
.
put
(
"user"
,
userService
.
selectUserById
(
userId
));
return
prefix
+
"/avatar"
;
}
/**
* 修改用户
*/
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
SAV
E
)
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/update"
)
@ResponseBody
public
AjaxResult
update
(
User
user
)
{
if
(
userService
.
updateUser
(
user
)
>
0
)
if
(
userService
.
updateUser
Info
(
user
)
>
0
)
{
setUser
(
userService
.
selectUserById
(
user
.
getUserId
()));
return
success
();
...
...
@@ -139,7 +128,7 @@ public class ProfileController extends BaseController
/**
* 保存头像
*/
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
SAV
E
)
@Log
(
title
=
"个人信息"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/updateAvatar"
)
@ResponseBody
public
AjaxResult
updateAvatar
(
User
user
,
@RequestParam
(
"avatarfile"
)
MultipartFile
file
)
...
...
@@ -150,7 +139,7 @@ public class ProfileController extends BaseController
{
String
avatar
=
FileUploadUtils
.
upload
(
file
);
user
.
setAvatar
(
avatar
);
if
(
userService
.
updateUser
(
user
)
>
0
)
if
(
userService
.
updateUser
Info
(
user
)
>
0
)
{
setUser
(
userService
.
selectUserById
(
user
.
getUserId
()));
return
success
();
...
...
src/main/java/com/ruoyi/project/system/user/controller/UserController.java
View file @
cc9c67cd
package
com
.
ruoyi
.
project
.
system
.
user
.
controller
;
import
java.util.List
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.framework.aspectj.lang.annotation.Log
;
...
...
@@ -7,19 +18,10 @@ import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.project.system.post.domain.Post
;
import
com.ruoyi.project.system.post.service.IPostService
;
import
com.ruoyi.project.system.role.domain.Role
;
import
com.ruoyi.project.system.role.service.IRoleService
;
import
com.ruoyi.project.system.user.domain.User
;
import
com.ruoyi.project.system.user.service.IUserService
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 用户信息
...
...
@@ -76,59 +78,78 @@ public class UserController extends BaseController
}
/**
* 新增用户
*/
@GetMapping
(
"/add"
)
public
String
add
(
ModelMap
mmap
)
{
mmap
.
put
(
"roles"
,
roleService
.
selectRoleAll
());
mmap
.
put
(
"posts"
,
postService
.
selectPostAll
());
return
prefix
+
"/add"
;
}
/**
* 新增保存用户
*/
@RequiresPermissions
(
"system:user:add"
)
@Log
(
title
=
"用户管理"
,
action
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ResponseBody
public
AjaxResult
addSave
(
User
user
)
{
if
(
StringUtils
.
isNotNull
(
user
.
getUserId
())
&&
User
.
isAdmin
(
user
.
getUserId
()))
{
return
error
(
"不允许修改超级管理员用户"
);
}
return
toAjax
(
userService
.
insertUser
(
user
));
}
/**
* 修改用户
*/
@RequiresPermissions
(
"system:user:edit"
)
@Log
(
title
=
"用户管理"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/edit/{userId}"
)
public
String
edit
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
model
)
public
String
edit
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
Map
mmap
)
{
User
user
=
userService
.
selectUserById
(
userId
);
List
<
Role
>
roles
=
roleService
.
selectRolesByUserId
(
userId
);
List
<
Post
>
posts
=
postService
.
selectPostsByUserId
(
userId
);
model
.
addAttribute
(
"roles"
,
roles
);
model
.
addAttribute
(
"posts"
,
posts
);
model
.
addAttribute
(
"user"
,
user
);
mmap
.
put
(
"user"
,
userService
.
selectUserById
(
userId
));
mmap
.
put
(
"roles"
,
roleService
.
selectRolesByUserId
(
userId
));
mmap
.
put
(
"posts"
,
postService
.
selectPostsByUserId
(
userId
));
return
prefix
+
"/edit"
;
}
/**
*
新增
用户
*
修改保存
用户
*/
@RequiresPermissions
(
"system:user:add"
)
@Log
(
title
=
"用户管理"
,
action
=
BusinessType
.
INSERT
)
@GetMapping
(
"/add"
)
public
String
add
(
Model
model
)
@RequiresPermissions
(
"system:user:edit"
)
@Log
(
title
=
"用户管理"
,
action
=
BusinessType
.
UPDATE
)
@PostMapping
(
"/edit"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ResponseBody
public
AjaxResult
editSave
(
User
user
)
{
List
<
Role
>
roles
=
roleService
.
selectRoleAll
();
List
<
Post
>
posts
=
postService
.
selectPostAll
();
model
.
addAttribute
(
"roles"
,
roles
);
model
.
addAttribute
(
"posts"
,
posts
);
return
prefix
+
"/add"
;
if
(
StringUtils
.
isNotNull
(
user
.
getUserId
())
&&
User
.
isAdmin
(
user
.
getUserId
()))
{
return
error
(
"不允许修改超级管理员用户"
);
}
return
toAjax
(
userService
.
updateUser
(
user
))
;
}
@RequiresPermissions
(
"system:user:resetPwd"
)
@Log
(
title
=
"重置密码"
,
action
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/resetPwd/{userId}"
)
public
String
resetPwd
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
model
)
public
String
resetPwd
(
@PathVariable
(
"userId"
)
Long
userId
,
Model
Map
mmap
)
{
User
user
=
userService
.
selectUserById
(
userId
);
model
.
addAttribute
(
"user"
,
user
);
mmap
.
put
(
"user"
,
userService
.
selectUserById
(
userId
));
return
prefix
+
"/resetPwd"
;
}
@RequiresPermissions
(
"system:user:resetPwd"
)
@Log
(
title
=
"重置密码"
,
action
=
BusinessType
.
SAV
E
)
@Log
(
title
=
"重置密码"
,
action
=
BusinessType
.
UPDAT
E
)
@PostMapping
(
"/resetPwd"
)
@ResponseBody
public
AjaxResult
resetPwd
(
User
user
)
{
int
rows
=
userService
.
resetUserPwd
(
user
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
return
toAjax
(
userService
.
resetUserPwd
(
user
));
}
@RequiresPermissions
(
"system:user:remove"
)
...
...
@@ -139,8 +160,7 @@ public class UserController extends BaseController
{
try
{
userService
.
deleteUserByIds
(
ids
);
return
success
();
return
toAjax
(
userService
.
deleteUserByIds
(
ids
));
}
catch
(
Exception
e
)
{
...
...
@@ -149,23 +169,6 @@ public class UserController extends BaseController
}
/**
* 保存用户
*/
@RequiresPermissions
(
"system:user:save"
)
@Log
(
title
=
"用户管理"
,
action
=
BusinessType
.
SAVE
)
@PostMapping
(
"/save"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ResponseBody
public
AjaxResult
save
(
User
user
)
{
if
(
StringUtils
.
isNotNull
(
user
.
getUserId
())
&&
User
.
isAdmin
(
user
.
getUserId
()))
{
return
error
(
"不允许修改超级管理员用户"
);
}
return
userService
.
saveUser
(
user
)
>
0
?
success
()
:
error
();
}
/**
* 校验用户名
*/
@PostMapping
(
"/checkLoginNameUnique"
)
...
...
src/main/java/com/ruoyi/project/system/user/service/IUserService.java
View file @
cc9c67cd
...
...
@@ -64,7 +64,7 @@ public interface IUserService
*
* @param ids 需要删除的数据ID
*/
public
void
deleteUserByIds
(
String
ids
)
throws
Exception
;
public
int
deleteUserByIds
(
String
ids
)
throws
Exception
;
/**
* 保存用户信息
...
...
@@ -72,10 +72,10 @@ public interface IUserService
* @param user 用户信息
* @return 结果
*/
public
int
save
User
(
User
user
);
public
int
insert
User
(
User
user
);
/**
*
修改
用户信息
*
保存
用户信息
*
* @param user 用户信息
* @return 结果
...
...
@@ -83,6 +83,14 @@ public interface IUserService
public
int
updateUser
(
User
user
);
/**
* 修改用户详细信息
*
* @param user 用户信息
* @return 结果
*/
public
int
updateUserInfo
(
User
user
);
/**
* 修改用户密码信息
*
* @param user 用户信息
...
...
src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java
View file @
cc9c67cd
...
...
@@ -25,7 +25,7 @@ import com.ruoyi.project.system.user.mapper.UserRoleMapper;
*
* @author ruoyi
*/
@Service
(
"userService"
)
@Service
public
class
UserServiceImpl
implements
IUserService
{
@Autowired
...
...
@@ -130,7 +130,7 @@ public class UserServiceImpl implements IUserService
* @return 结果
*/
@Override
public
void
deleteUserByIds
(
String
ids
)
throws
Exception
public
int
deleteUserByIds
(
String
ids
)
throws
Exception
{
Long
[]
userIds
=
Convert
.
toLongArray
(
ids
);
for
(
Long
userId
:
userIds
)
...
...
@@ -140,52 +140,32 @@ public class UserServiceImpl implements IUserService
throw
new
Exception
(
"不允许删除超级管理员用户"
);
}
}
userMapper
.
deleteUserByIds
(
userIds
);
return
userMapper
.
deleteUserByIds
(
userIds
);
}
/**
* 保存用户信息
*
新增
保存用户信息
*
* @param user 用户信息
* @return 结果
*/
@Override
public
int
save
User
(
User
user
)
public
int
insert
User
(
User
user
)
{
int
count
=
0
;
Long
userId
=
user
.
getUserId
();
if
(
StringUtils
.
isNotNull
(
userId
))
{
user
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 修改用户信息
count
=
updateUser
(
user
);
// 删除用户与角色关联
userRoleMapper
.
deleteUserRoleByUserId
(
userId
);
// 新增用户与角色管理
insertUserRole
(
user
);
// 删除用户与岗位关联
userPostMapper
.
deleteUserPostByUserId
(
userId
);
// 新增用户与岗位管理
insertUserPost
(
user
);
}
else
{
user
.
randomSalt
();
user
.
setPassword
(
passwordService
.
encryptPassword
(
user
.
getLoginName
(),
user
.
getPassword
(),
user
.
getSalt
()));
user
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增用户信息
count
=
userMapper
.
insertUser
(
user
);
// 新增用户岗位关联
insertUserPost
(
user
);
// 新增用户与角色管理
insertUserRole
(
user
);
}
return
count
;
user
.
randomSalt
();
user
.
setPassword
(
passwordService
.
encryptPassword
(
user
.
getLoginName
(),
user
.
getPassword
(),
user
.
getSalt
()));
user
.
setCreateBy
(
ShiroUtils
.
getLoginName
());
// 新增用户信息
int
rows
=
userMapper
.
insertUser
(
user
);
// 新增用户岗位关联
insertUserPost
(
user
);
// 新增用户与角色管理
insertUserRole
(
user
);
return
rows
;
}
/**
* 修改用户信息
* 修改
保存
用户信息
*
* @param user 用户信息
* @return 结果
...
...
@@ -193,6 +173,28 @@ public class UserServiceImpl implements IUserService
@Override
public
int
updateUser
(
User
user
)
{
Long
userId
=
user
.
getUserId
();
user
.
setUpdateBy
(
ShiroUtils
.
getLoginName
());
// 删除用户与角色关联
userRoleMapper
.
deleteUserRoleByUserId
(
userId
);
// 新增用户与角色管理
insertUserRole
(
user
);
// 删除用户与岗位关联
userPostMapper
.
deleteUserPostByUserId
(
userId
);
// 新增用户与岗位管理
insertUserPost
(
user
);
return
userMapper
.
updateUser
(
user
);
}
/**
* 修改用户个人详细信息
*
* @param user 用户信息
* @return 结果
*/
@Override
public
int
updateUserInfo
(
User
user
)
{
return
userMapper
.
updateUser
(
user
);
}
...
...
@@ -280,14 +282,9 @@ public class UserServiceImpl implements IUserService
@Override
public
String
checkPhoneUnique
(
User
user
)
{
if
(
user
.
getUserId
()
==
null
)
{
user
.
setUserId
(-
1L
);
}
Long
userId
=
user
.
getUserId
();
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
User
info
=
userMapper
.
checkPhoneUnique
(
user
.
getPhonenumber
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getUserId
())
&&
info
.
getUserId
().
longValue
()
!=
userId
.
longValue
())
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getUserId
().
longValue
()
!=
userId
.
longValue
())
{
return
UserConstants
.
USER_PHONE_NOT_UNIQUE
;
}
...
...
@@ -303,14 +300,9 @@ public class UserServiceImpl implements IUserService
@Override
public
String
checkEmailUnique
(
User
user
)
{
if
(
user
.
getUserId
()
==
null
)
{
user
.
setUserId
(-
1L
);
}
Long
userId
=
user
.
getUserId
();
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
User
info
=
userMapper
.
checkEmailUnique
(
user
.
getEmail
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
StringUtils
.
isNotNull
(
info
.
getUserId
())
&&
info
.
getUserId
().
longValue
()
!=
userId
.
longValue
())
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getUserId
().
longValue
()
!=
userId
.
longValue
())
{
return
UserConstants
.
USER_EMAIL_NOT_UNIQUE
;
}
...
...
src/main/java/com/ruoyi/project/tool/gen/service/GenServiceImpl.java
View file @
cc9c67cd
...
...
@@ -28,7 +28,7 @@ import com.ruoyi.project.tool.gen.util.VelocityInitializer;
*
* @author ruoyi
*/
@Service
(
"genService"
)
@Service
public
class
GenServiceImpl
implements
IGenService
{
@Autowired
...
...
src/main/resources/application.yml
View file @
cc9c67cd
# 项目名称、版本、版权年份
ruoyi
:
name
:
RuoYi
version
:
2.
1
.0
version
:
2.
2
.0
copyrightYear
:
2018
profile
:
D:/profile/
...
...
src/main/resources/mybatis/system/ConfigMapper.xml
View file @
cc9c67cd
...
...
@@ -20,14 +20,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
</sql>
<select
id=
"selectConfigById"
parameterType=
"Integer"
resultMap=
"ConfigResult"
>
<include
refid=
"selectConfigVo"
/>
where config_id = #{configId}
</select>
<!-- 查询条件 -->
<sql
id=
"sqlwhereSearch"
>
<where>
<if
test=
"configId !=null"
>
and config_id = #{configId}
</if>
<if
test=
"configKey !=null and configKey != ''"
>
and config_key = #{configKey}
</if>
</where>
</sql>
<select
id=
"selectConfig
ByKey"
parameterType=
"Strin
g"
resultMap=
"ConfigResult"
>
<select
id=
"selectConfig
"
parameterType=
"Confi
g"
resultMap=
"ConfigResult"
>
<include
refid=
"selectConfigVo"
/>
where config_key = #{configKey}
<include
refid=
"sqlwhereSearch"
/>
</select>
<select
id=
"selectConfigList"
parameterType=
"Config"
resultMap=
"ConfigResult"
>
...
...
@@ -51,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select
id=
"checkConfigKeyUnique"
parameterType=
"String"
resultMap=
"ConfigResult"
>
<include
refid=
"selectConfigVo"
/>
where config_key = #{configKey}
</select>
<insert
id=
"insertConfig"
parameterType=
"Config"
>
insert into sys_config (
<if
test=
"configName != null and configName != '' "
>
config_name,
</if>
...
...
@@ -85,10 +97,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where config_id = #{configId}
</update>
<delete
id=
"deleteConfigById"
parameterType=
"Integer"
>
delete from sys_config where config_id = #{value}
</delete>
<delete
id=
"deleteConfigByIds"
parameterType=
"String"
>
delete from sys_config where config_id in
<foreach
item=
"configId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
...
...
src/main/resources/mybatis/system/DictDataMapper.xml
View file @
cc9c67cd
...
...
@@ -11,7 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"dictValue"
column=
"dict_value"
/>
<result
property=
"dictType"
column=
"dict_type"
/>
<result
property=
"cssClass"
column=
"css_class"
/>
<result
property=
"isDefault"
column=
"is_default"
/>
<result
property=
"listClass"
column=
"list_class"
/>
<result
property=
"isDefault"
column=
"is_default"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
...
...
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectDictDataVo"
>
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, is_default, status, create_by, create_time, remark from sys_dict_data
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class,
list_class,
is_default, status, create_by, create_time, remark from sys_dict_data
</sql>
<select
id=
"selectDictDataList"
parameterType=
"DictData"
resultMap=
"DictDataResult"
>
...
...
@@ -43,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dict_type = #{dictType} order by dict_sort asc
</select>
<select
id=
"selectDictLabel"
resultType=
"String"
>
select dict_label from sys_dict_data
where dict_type = #{dictType} and dict_value = #{dictValue}
</select>
<select
id=
"selectDictDataById"
parameterType=
"Long"
resultMap=
"DictDataResult"
>
<include
refid=
"selectDictDataVo"
/>
where dict_code = #{dictCode}
...
...
@@ -71,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dictValue != null and dictValue != ''"
>
dict_value = #{dictValue},
</if>
<if
test=
"dictType != null and dictType != ''"
>
dict_type = #{dictType},
</if>
<if
test=
"cssClass != null and cssClass != ''"
>
css_class = #{cssClass},
</if>
<if
test=
"listClass != null and listClass != ''"
>
list_class = #{listClass},
</if>
<if
test=
"isDefault != null and isDefault != ''"
>
is_default = #{isDefault},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"remark != null and remark != ''"
>
remark = #{remark},
</if>
...
...
@@ -88,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dictValue != null and dictValue != ''"
>
dict_value,
</if>
<if
test=
"dictType != null and dictType != ''"
>
dict_type,
</if>
<if
test=
"cssClass != null and cssClass != ''"
>
css_class,
</if>
<if
test=
"listClass != null and listClass != ''"
>
list_class,
</if>
<if
test=
"isDefault != null and isDefault != ''"
>
is_default,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
...
...
@@ -99,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dictValue != null and dictValue != ''"
>
#{dictValue},
</if>
<if
test=
"dictType != null and dictType != ''"
>
#{dictType},
</if>
<if
test=
"cssClass != null and cssClass != ''"
>
#{cssClass},
</if>
<if
test=
"listClass != null and listClass != ''"
>
#{listClass},
</if>
<if
test=
"isDefault != null and isDefault != ''"
>
#{isDefault},
</if>
<if
test=
"status != null"
>
#{status},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
...
...
src/main/resources/mybatis/system/NoticeMapper.xml
View file @
cc9c67cd
...
...
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice
</sql>
<select
id=
"selectNoticeById"
parameterType=
"
Integer
"
resultMap=
"NoticeResult"
>
<select
id=
"selectNoticeById"
parameterType=
"
Long
"
resultMap=
"NoticeResult"
>
<include
refid=
"selectNoticeVo"
/>
where notice_id = #{noticeId}
</select>
...
...
src/main/resources/mybatis/system/PostMapper.xml
View file @
cc9c67cd
...
...
@@ -53,10 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where post_id = #{postId}
</select>
<delete
id=
"deletePostById"
parameterType=
"Long"
>
delete from sys_post where post_id = #{postId}
</delete>
<delete
id=
"deletePostByIds"
parameterType=
"Long"
>
delete from sys_post where post_id in
<foreach
collection=
"array"
item=
"postId"
open=
"("
separator=
","
close=
")"
>
...
...
src/main/resources/static/ruoyi/index.js
View file @
cc9c67cd
...
...
@@ -187,7 +187,6 @@ $(function() {
});
function
menuItem
()
{
$
.
modal
.
loading
(
"数据加载中,请稍后..."
);
// 获取标识数据
var
dataUrl
=
$
(
this
).
attr
(
'href'
),
dataIndex
=
$
(
this
).
data
(
'index'
),
...
...
@@ -221,12 +220,17 @@ $(function() {
// 添加选项卡对应的iframe
var
str1
=
'<iframe class="RuoYi_iframe" name="iframe'
+
dataIndex
+
'" width="100%" height="100%" src="'
+
dataUrl
+
'" frameborder="0" data-id="'
+
dataUrl
+
'" seamless></iframe>'
;
$
(
'.mainContent'
).
find
(
'iframe.RuoYi_iframe'
).
hide
().
parents
(
'.mainContent'
).
append
(
str1
);
$
.
modal
.
loading
(
"数据加载中,请稍后..."
);
$
(
'.mainContent iframe:visible'
).
load
(
function
()
{
$
.
modal
.
closeLoading
();
});
// 添加选项卡
$
(
'.menuTabs .page-tabs-content'
).
append
(
str
);
scrollToTab
(
$
(
'.menuTab.active'
));
}
$
.
modal
.
closeLoading
();
return
false
;
}
...
...
src/main/resources/static/ruoyi/js/ry-ui.js
View file @
cc9c67cd
...
...
@@ -95,6 +95,17 @@
return
$
.
map
(
$
(
'#bootstrap-table'
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
[
$
.
table
.
_option
.
columns
[
1
].
field
];
});
},
// 回显数据字典
selectDictLabel
:
function
(
_datas
,
_value
)
{
var
actions
=
[];
$
.
each
(
_datas
,
function
(
index
,
dict
)
{
if
(
dict
.
dictValue
==
_value
)
{
actions
.
push
(
"<span class='badge badge-"
+
dict
.
listClass
+
"'>"
+
dict
.
dictLabel
+
"</span>"
);
return
false
;
}
});
return
actions
.
join
(
''
);
}
},
// 表格树封装处理
...
...
src/main/resources/static/ruoyi/js/ry-ui.min.js
View file @
cc9c67cd
/*
!
*
ruoyi.js
*
Author: R
uoyi
/*
*
*
通用方法封装处理
*
Copyright (c) 2018 r
uoyi
*/
(
function
(
$
){
$
.
extend
({
table
:{
_option
:{},
_params
:{},
init
:
function
(
options
){
$
.
table
.
_option
=
options
;
$
.
table
.
_params
=
$
.
common
.
isEmpty
(
options
.
queryParams
)?
$
.
table
.
queryParams
:
options
.
queryParams
;
_sortOrder
=
$
.
common
.
isEmpty
(
options
.
sortOrder
)?
"asc"
:
options
.
sortOrder
;
_sortName
=
$
.
common
.
isEmpty
(
options
.
sortName
)?
""
:
options
.
sortName
;
$
(
"#bootstrap-table"
).
bootstrapTable
({
url
:
options
.
url
,
contentType
:
"application/x-www-form-urlencoded"
,
method
:
"post"
,
cache
:
false
,
sortable
:
true
,
sortStable
:
true
,
sortName
:
_sortName
,
sortOrder
:
_sortOrder
,
pagination
:
true
,
pageNumber
:
1
,
pageSize
:
10
,
pageList
:[
10
,
25
,
50
],
iconSize
:
"outline"
,
toolbar
:
"#toolbar"
,
sidePagination
:
"server"
,
search
:
$
.
common
.
visible
(
options
.
search
),
showRefresh
:
$
.
common
.
visible
(
options
.
showRefresh
),
showColumns
:
$
.
common
.
visible
(
options
.
showColumns
),
showToggle
:
$
.
common
.
visible
(
options
.
showToggle
),
showExport
:
$
.
common
.
visible
(
options
.
showExport
),
queryParams
:
$
.
table
.
_params
,
columns
:
options
.
columns
})},
queryParams
:
function
(
params
){
return
{
pageSize
:
params
.
limit
,
pageNum
:
params
.
offset
/
params
.
limit
+
1
,
searchValue
:
params
.
search
,
orderByColumn
:
params
.
sort
,
isAsc
:
params
.
order
}},
search
:
function
(
form
){
var
params
=
$
(
"#bootstrap-table"
).
bootstrapTable
(
"getOptions"
);
params
.
queryParams
=
function
(
params
){
var
search
=
{};
$
.
each
(
$
(
"#"
+
form
).
serializeArray
(),
function
(
i
,
field
){
search
[
field
.
name
]
=
field
.
value
});
search
.
pageSize
=
params
.
limit
;
search
.
pageNum
=
params
.
offset
/
params
.
limit
+
1
;
search
.
searchValue
=
params
.
search
;
search
.
orderByColumn
=
params
.
sort
;
search
.
isAsc
=
params
.
order
;
return
search
};
$
(
"#bootstrap-table"
).
bootstrapTable
(
"refresh"
,
params
)},
exportExcel
:
function
(
form
){
$
.
post
(
$
.
table
.
_option
.
exportUrl
,
$
(
"#"
+
form
).
serializeArray
(),
function
(
result
){
if
(
result
.
code
==
web_status
.
SUCCESS
){
window
.
location
.
href
=
ctx
+
"common/download?fileName="
+
result
.
msg
+
"&delete="
+
true
}
else
{
$
.
modal
.
alertError
(
result
.
msg
)}})},
refresh
:
function
(){
$
(
"#bootstrap-table"
).
bootstrapTable
(
"refresh"
,{
url
:
$
.
table
.
_option
.
url
,
silent
:
true
})},
selectColumns
:
function
(
column
){
return
$
.
map
(
$
(
"#bootstrap-table"
).
bootstrapTable
(
"getSelections"
),
function
(
row
){
return
row
[
column
]})},
selectFirstColumns
:
function
(){
return
$
.
map
(
$
(
"#bootstrap-table"
).
bootstrapTable
(
"getSelections"
),
function
(
row
){
return
row
[
$
.
table
.
_option
.
columns
[
1
].
field
]})}},
treeTable
:{
_option
:{},
_treeTable
:{},
init
:
function
(
options
){
$
.
table
.
_option
=
options
;
var
treeTable
=
$
(
"#bootstrap-table"
).
bootstrapTreeTable
({
code
:
options
.
id
,
parentCode
:
options
.
parentId
,
type
:
"get"
,
url
:
options
.
url
,
ajaxParams
:{},
expandColumn
:
"0"
,
striped
:
false
,
bordered
:
true
,
expandAll
:
$
.
common
.
visible
(
options
.
expandAll
),
columns
:
options
.
columns
});
$
.
treeTable
.
_treeTable
=
treeTable
},
search
:
function
(
form
){
var
params
=
{};
$
.
each
(
$
(
"#"
+
form
).
serializeArray
(),
function
(
i
,
field
){
params
[
field
.
name
]
=
field
.
value
});
$
.
treeTable
.
_treeTable
.
bootstrapTreeTable
(
"refresh"
,
params
)},
refresh
:
function
(){
$
.
treeTable
.
_treeTable
.
bootstrapTreeTable
(
"refresh"
)},},
form
:{
selectCheckeds
:
function
(
name
){
var
checkeds
=
""
;
$
(
'input:checkbox[name="'
+
name
+
'"]:checked'
).
each
(
function
(
i
){
if
(
0
==
i
){
checkeds
=
$
(
this
).
val
()}
else
{
checkeds
+=
(
","
+
$
(
this
).
val
())}});
return
checkeds
},
selectSelects
:
function
(
name
){
var
selects
=
""
;
$
(
"#"
+
name
+
" option:selected"
).
each
(
function
(
i
){
if
(
0
==
i
){
selects
=
$
(
this
).
val
()}
else
{
selects
+=
(
","
+
$
(
this
).
val
())}});
return
selects
}},
modal
:{
icon
:
function
(
type
){
var
icon
=
""
;
if
(
type
==
modal_status
.
WARNING
){
icon
=
0
}
else
{
if
(
type
==
modal_status
.
SUCCESS
){
icon
=
1
}
else
{
if
(
type
==
modal_status
.
FAIL
){
icon
=
2
}
else
{
icon
=
3
}}}
return
icon
},
msg
:
function
(
content
,
type
){
if
(
type
!=
undefined
){
layer
.
msg
(
content
,{
icon
:
$
.
modal
.
icon
(
type
),
time
:
1000
,
shift
:
5
})}
else
{
layer
.
msg
(
content
)}},
msgError
:
function
(
content
){
$
.
modal
.
msg
(
content
,
modal_status
.
FAIL
)},
msgSuccess
:
function
(
content
){
$
.
modal
.
msg
(
content
,
modal_status
.
SUCCESS
)},
msgWarning
:
function
(
content
){
$
.
modal
.
msg
(
content
,
modal_status
.
WARNING
)},
alert
:
function
(
content
,
type
){
layer
.
alert
(
content
,{
icon
:
$
.
modal
.
icon
(
type
),
title
:
"系统提示"
,
btn
:[
"确认"
],
btnclass
:[
"btn btn-primary"
],})},
msgReload
:
function
(
msg
,
type
){
layer
.
msg
(
msg
,{
icon
:
$
.
modal
.
icon
(
type
),
time
:
500
,
shade
:[
0.1
,
"#8F8F8F"
]},
function
(){
$
.
modal
.
reload
()})},
alertError
:
function
(
content
){
$
.
modal
.
alert
(
content
,
modal_status
.
FAIL
)},
alertSuccess
:
function
(
content
){
$
.
modal
.
alert
(
content
,
modal_status
.
SUCCESS
)},
alertWarning
:
function
(
content
){
$
.
modal
.
alert
(
content
,
modal_status
.
WARNING
)},
close
:
function
(){
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
parent
.
layer
.
close
(
index
)},
confirm
:
function
(
content
,
callBack
){
layer
.
confirm
(
content
,{
icon
:
3
,
title
:
"系统提示"
,
btn
:[
"确认"
,
"取消"
],
btnclass
:[
"btn btn-primary"
,
"btn btn-danger"
],},
function
(
index
){
layer
.
close
(
index
);
callBack
(
true
)})},
open
:
function
(
title
,
url
,
width
,
height
){
if
(
$
.
common
.
isEmpty
(
title
)){
title
=
false
}
if
(
$
.
common
.
isEmpty
(
url
)){
url
=
"404.html"
}
if
(
$
.
common
.
isEmpty
(
width
)){
width
=
800
}
if
(
$
.
common
.
isEmpty
(
height
)){
height
=
(
$
(
window
).
height
()
-
50
)}
layer
.
open
({
type
:
2
,
area
:[
width
+
"px"
,
height
+
"px"
],
fix
:
false
,
maxmin
:
true
,
shade
:
0.3
,
title
:
title
,
content
:
url
})},
openFull
:
function
(
title
,
url
,
width
,
height
){
if
(
$
.
common
.
isEmpty
(
title
)){
title
=
false
}
if
(
$
.
common
.
isEmpty
(
url
)){
url
=
"404.html"
}
if
(
$
.
common
.
isEmpty
(
width
)){
width
=
800
}
if
(
$
.
common
.
isEmpty
(
height
)){
height
=
(
$
(
window
).
height
()
-
50
)}
var
index
=
layer
.
open
({
type
:
2
,
area
:[
width
+
"px"
,
height
+
"px"
],
fix
:
false
,
maxmin
:
true
,
shade
:
0.3
,
title
:
title
,
content
:
url
});
layer
.
full
(
index
)},
loading
:
function
(
message
){
$
.
blockUI
({
message
:
'<div class="loaderbox"><div class="loading-activity"></div> '
+
message
+
"</div>"
})},
closeLoading
:
function
(){
setTimeout
(
function
(){
$
.
unblockUI
()},
50
)},
reload
:
function
(){
parent
.
location
.
reload
()}},
operate
:{
submit
:
function
(
url
,
type
,
dataType
,
data
){
$
.
modal
.
loading
(
"正在处理中,请稍后..."
);
var
config
=
{
url
:
url
,
type
:
type
,
dataType
:
dataType
,
data
:
data
,
success
:
function
(
result
){
$
.
operate
.
ajaxSuccess
(
result
)}};
$
.
ajax
(
config
)},
post
:
function
(
url
,
data
){
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
)},
remove
:
function
(
id
){
$
.
modal
.
confirm
(
"确定删除该条"
+
$
.
table
.
_option
.
modalName
+
"信息吗?"
,
function
(){
var
url
=
$
.
common
.
isEmpty
(
id
)?
$
.
table
.
_option
.
removeUrl
:
$
.
table
.
_option
.
removeUrl
.
replace
(
"{id}"
,
id
);
var
data
=
{
"ids"
:
id
};
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
)})},
batRemove
:
function
(){
var
rows
=
$
.
common
.
isEmpty
(
$
.
table
.
_option
.
id
)?
$
.
table
.
selectFirstColumns
():
$
.
table
.
selectColumns
(
$
.
table
.
_option
.
id
);
if
(
rows
.
length
==
0
){
$
.
modal
.
alertWarning
(
"请至少选择一条记录"
);
return
}
$
.
modal
.
confirm
(
"确认要删除选中的"
+
rows
.
length
+
"条数据吗?"
,
function
(){
var
url
=
$
.
table
.
_option
.
removeUrl
;
var
data
=
{
"ids"
:
rows
.
join
()};
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
)})},
add
:
function
(
id
){
var
url
=
$
.
common
.
isEmpty
(
id
)?
$
.
table
.
_option
.
createUrl
:
$
.
table
.
_option
.
createUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
open
(
"添加"
+
$
.
table
.
_option
.
modalName
,
url
)},
edit
:
function
(
id
){
var
url
=
$
.
table
.
_option
.
updateUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
open
(
"修改"
+
$
.
table
.
_option
.
modalName
,
url
)},
addFull
:
function
(
id
){
var
url
=
$
.
common
.
isEmpty
(
id
)?
$
.
table
.
_option
.
createUrl
:
$
.
table
.
_option
.
createUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
openFull
(
"添加"
+
$
.
table
.
_option
.
modalName
,
url
)},
editFull
:
function
(
id
){
var
url
=
$
.
table
.
_option
.
updateUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
openFull
(
"修改"
+
$
.
table
.
_option
.
modalName
,
url
)},
save
:
function
(
url
,
data
){
$
.
modal
.
loading
(
"正在处理中,请稍后..."
);
var
config
=
{
url
:
url
,
type
:
"post"
,
dataType
:
"json"
,
data
:
data
,
success
:
function
(
result
){
$
.
operate
.
saveSuccess
(
result
)}};
$
.
ajax
(
config
)},
ajaxSuccess
:
function
(
result
){
if
(
result
.
code
==
web_status
.
SUCCESS
){
$
.
modal
.
msgSuccess
(
result
.
msg
);
$
.
table
.
refresh
()}
else
{
$
.
modal
.
alertError
(
result
.
msg
)}
$
.
modal
.
closeLoading
()},
saveSuccess
:
function
(
result
){
if
(
result
.
code
==
web_status
.
SUCCESS
){
$
.
modal
.
msgReload
(
"保存成功,正在刷新数据请稍后……"
,
modal_status
.
SUCCESS
)}
else
{
$
.
modal
.
alertError
(
result
.
msg
)}
$
.
modal
.
closeLoading
()}},
common
:{
isEmpty
:
function
(
value
){
if
(
value
==
null
||
this
.
trim
(
value
)
==
""
){
return
true
}
return
false
},
visible
:
function
(
value
){
if
(
$
.
common
.
isEmpty
(
value
)
||
value
==
true
){
return
true
}
return
false
},
trim
:
function
(
value
){
if
(
value
==
null
){
return
""
}
return
value
.
toString
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
|
\r
|
\n
/g
,
""
)},
random
:
function
(
min
,
max
){
return
Math
.
floor
((
Math
.
random
()
*
max
)
+
min
)}}})})(
jQuery
);
web_status
=
{
SUCCESS
:
0
,
FAIL
:
500
};
modal_status
=
{
SUCCESS
:
"success"
,
FAIL
:
"error"
,
WARNING
:
"warning"
};
\ No newline at end of file
(
function
(
$
)
{
$
.
extend
({
// 表格封装处理
table
:
{
_option
:
{},
_params
:
{},
// 初始化表格
init
:
function
(
options
)
{
$
.
table
.
_option
=
options
;
$
.
table
.
_params
=
$
.
common
.
isEmpty
(
options
.
queryParams
)
?
$
.
table
.
queryParams
:
options
.
queryParams
;
_sortOrder
=
$
.
common
.
isEmpty
(
options
.
sortOrder
)
?
"asc"
:
options
.
sortOrder
;
_sortName
=
$
.
common
.
isEmpty
(
options
.
sortName
)
?
""
:
options
.
sortName
;
$
(
'#bootstrap-table'
).
bootstrapTable
({
url
:
options
.
url
,
// 请求后台的URL(*)
contentType
:
"application/x-www-form-urlencoded"
,
// 编码类型
method
:
'post'
,
// 请求方式(*)
cache
:
false
,
// 是否使用缓存
sortable
:
true
,
// 是否启用排序
sortStable
:
true
,
// 设置为 true 将获得稳定的排序
sortName
:
_sortName
,
// 排序列名称
sortOrder
:
_sortOrder
,
// 排序方式 asc 或者 desc
pagination
:
true
,
// 是否显示分页(*)
pageNumber
:
1
,
// 初始化加载第一页,默认第一页
pageSize
:
10
,
// 每页的记录行数(*)
pageList
:
[
10
,
25
,
50
],
// 可供选择的每页的行数(*)
iconSize
:
'outline'
,
// 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮
toolbar
:
'#toolbar'
,
// 指定工作栏
sidePagination
:
"server"
,
// 启用服务端分页
search
:
$
.
common
.
visible
(
options
.
search
),
// 是否显示搜索框功能
showRefresh
:
$
.
common
.
visible
(
options
.
showRefresh
),
// 是否显示刷新按钮
showColumns
:
$
.
common
.
visible
(
options
.
showColumns
),
// 是否显示隐藏某列下拉框
showToggle
:
$
.
common
.
visible
(
options
.
showToggle
),
// 是否显示详细视图和列表视图的切换按钮
showExport
:
$
.
common
.
visible
(
options
.
showExport
),
// 是否支持导出文件
queryParams
:
$
.
table
.
_params
,
// 传递参数(*)
columns
:
options
.
columns
// 显示列信息(*)
});
},
// 查询条件
queryParams
:
function
(
params
)
{
return
{
// 传递参数查询参数
pageSize
:
params
.
limit
,
pageNum
:
params
.
offset
/
params
.
limit
+
1
,
searchValue
:
params
.
search
,
orderByColumn
:
params
.
sort
,
isAsc
:
params
.
order
};
},
// 搜索
search
:
function
(
form
)
{
var
params
=
$
(
"#bootstrap-table"
).
bootstrapTable
(
'getOptions'
);
params
.
queryParams
=
function
(
params
)
{
var
search
=
{};
$
.
each
(
$
(
"#"
+
form
).
serializeArray
(),
function
(
i
,
field
)
{
search
[
field
.
name
]
=
field
.
value
;
});
search
.
pageSize
=
params
.
limit
;
search
.
pageNum
=
params
.
offset
/
params
.
limit
+
1
;
search
.
searchValue
=
params
.
search
;
search
.
orderByColumn
=
params
.
sort
;
search
.
isAsc
=
params
.
order
;
return
search
;
}
$
(
"#bootstrap-table"
).
bootstrapTable
(
'refresh'
,
params
);
},
// 下载
exportExcel
:
function
(
form
)
{
$
.
post
(
$
.
table
.
_option
.
exportUrl
,
$
(
"#"
+
form
).
serializeArray
(),
function
(
result
)
{
if
(
result
.
code
==
web_status
.
SUCCESS
)
{
window
.
location
.
href
=
ctx
+
"common/download?fileName="
+
result
.
msg
+
"&delete="
+
true
;
}
else
{
$
.
modal
.
alertError
(
result
.
msg
);
}
});
},
// 刷新
refresh
:
function
()
{
$
(
"#bootstrap-table"
).
bootstrapTable
(
'refresh'
,
{
url
:
$
.
table
.
_option
.
url
,
silent
:
true
});
},
// 查询选中列值
selectColumns
:
function
(
column
)
{
return
$
.
map
(
$
(
'#bootstrap-table'
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
[
column
];
});
},
// 查询选中首列值
selectFirstColumns
:
function
()
{
return
$
.
map
(
$
(
'#bootstrap-table'
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
[
$
.
table
.
_option
.
columns
[
1
].
field
];
});
},
// 回显数据字典
selectDictLabel
:
function
(
_dicts
,
_value
)
{
var
actions
=
[];
$
.
each
(
_dicts
,
function
(
index
,
dict
)
{
if
(
dict
.
dictValue
==
_value
)
{
actions
.
push
(
"<span class='badge badge-"
+
dict
.
listClass
+
"'>"
+
dict
.
dictLabel
+
"</span>"
);
return
false
;
}
});
return
actions
.
join
(
''
);
}
},
// 表格树封装处理
treeTable
:
{
_option
:
{},
_treeTable
:
{},
// 初始化表格
init
:
function
(
options
)
{
$
.
table
.
_option
=
options
;
var
treeTable
=
$
(
'#bootstrap-table'
).
bootstrapTreeTable
({
code
:
options
.
id
,
// 用于设置父子关系
parentCode
:
options
.
parentId
,
// 用于设置父子关系
type
:
'get'
,
// 请求方式(*)
url
:
options
.
url
,
// 请求后台的URL(*)
ajaxParams
:
{},
// 请求数据的ajax的data属性
expandColumn
:
'0'
,
// 在哪一列上面显示展开按钮
striped
:
false
,
// 是否各行渐变色
bordered
:
true
,
// 是否显示边框
expandAll
:
$
.
common
.
visible
(
options
.
expandAll
),
// 是否全部展开
columns
:
options
.
columns
});
$
.
treeTable
.
_treeTable
=
treeTable
;
},
// 条件查询
search
:
function
(
form
)
{
var
params
=
{};
$
.
each
(
$
(
"#"
+
form
).
serializeArray
(),
function
(
i
,
field
)
{
params
[
field
.
name
]
=
field
.
value
;
});
$
.
treeTable
.
_treeTable
.
bootstrapTreeTable
(
'refresh'
,
params
);
},
// 刷新
refresh
:
function
()
{
$
.
treeTable
.
_treeTable
.
bootstrapTreeTable
(
'refresh'
);
},
},
// 表单封装处理
form
:
{
// 获取选中复选框项
selectCheckeds
:
function
(
name
)
{
var
checkeds
=
""
;
$
(
'input:checkbox[name="'
+
name
+
'"]:checked'
).
each
(
function
(
i
)
{
if
(
0
==
i
)
{
checkeds
=
$
(
this
).
val
();
}
else
{
checkeds
+=
(
","
+
$
(
this
).
val
());
}
});
return
checkeds
;
},
// 获取选中下拉框项
selectSelects
:
function
(
name
)
{
var
selects
=
""
;
$
(
'#'
+
name
+
' option:selected'
).
each
(
function
(
i
)
{
if
(
0
==
i
)
{
selects
=
$
(
this
).
val
();
}
else
{
selects
+=
(
","
+
$
(
this
).
val
());
}
});
return
selects
;
}
},
// 弹出层封装处理
modal
:
{
// 显示图标
icon
:
function
(
type
)
{
var
icon
=
""
;
if
(
type
==
modal_status
.
WARNING
)
{
icon
=
0
;
}
else
if
(
type
==
modal_status
.
SUCCESS
)
{
icon
=
1
;
}
else
if
(
type
==
modal_status
.
FAIL
)
{
icon
=
2
;
}
else
{
icon
=
3
;
}
return
icon
;
},
// 消息提示
msg
:
function
(
content
,
type
)
{
if
(
type
!=
undefined
)
{
layer
.
msg
(
content
,
{
icon
:
$
.
modal
.
icon
(
type
),
time
:
1000
,
shift
:
5
});
}
else
{
layer
.
msg
(
content
);
}
},
// 错误消息
msgError
:
function
(
content
)
{
$
.
modal
.
msg
(
content
,
modal_status
.
FAIL
);
},
// 成功消息
msgSuccess
:
function
(
content
)
{
$
.
modal
.
msg
(
content
,
modal_status
.
SUCCESS
);
},
// 警告消息
msgWarning
:
function
(
content
)
{
$
.
modal
.
msg
(
content
,
modal_status
.
WARNING
);
},
// 弹出提示
alert
:
function
(
content
,
type
)
{
layer
.
alert
(
content
,
{
icon
:
$
.
modal
.
icon
(
type
),
title
:
"系统提示"
,
btn
:
[
'确认'
],
btnclass
:
[
'btn btn-primary'
],
});
},
// 消息提示并刷新父窗体
msgReload
:
function
(
msg
,
type
)
{
layer
.
msg
(
msg
,
{
icon
:
$
.
modal
.
icon
(
type
),
time
:
500
,
shade
:
[
0.1
,
'#8F8F8F'
]
},
function
()
{
$
.
modal
.
reload
();
});
},
// 错误提示
alertError
:
function
(
content
)
{
$
.
modal
.
alert
(
content
,
modal_status
.
FAIL
);
},
// 成功提示
alertSuccess
:
function
(
content
)
{
$
.
modal
.
alert
(
content
,
modal_status
.
SUCCESS
);
},
// 警告提示
alertWarning
:
function
(
content
)
{
$
.
modal
.
alert
(
content
,
modal_status
.
WARNING
);
},
// 关闭窗体
close
:
function
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
parent
.
layer
.
close
(
index
);
},
// 确认窗体
confirm
:
function
(
content
,
callBack
)
{
layer
.
confirm
(
content
,
{
icon
:
3
,
title
:
"系统提示"
,
btn
:
[
'确认'
,
'取消'
],
btnclass
:
[
'btn btn-primary'
,
'btn btn-danger'
],
},
function
(
index
)
{
layer
.
close
(
index
);
callBack
(
true
);
});
},
// 弹出层指定宽度
open
:
function
(
title
,
url
,
width
,
height
)
{
if
(
$
.
common
.
isEmpty
(
title
))
{
title
=
false
;
};
if
(
$
.
common
.
isEmpty
(
url
))
{
url
=
"404.html"
;
};
if
(
$
.
common
.
isEmpty
(
width
))
{
width
=
800
;
};
if
(
$
.
common
.
isEmpty
(
height
))
{
height
=
(
$
(
window
).
height
()
-
50
);
};
layer
.
open
({
type
:
2
,
area
:
[
width
+
'px'
,
height
+
'px'
],
fix
:
false
,
//不固定
maxmin
:
true
,
shade
:
0.3
,
title
:
title
,
content
:
url
});
},
// 弹出层全屏
openFull
:
function
(
title
,
url
,
width
,
height
)
{
if
(
$
.
common
.
isEmpty
(
title
))
{
title
=
false
;
};
if
(
$
.
common
.
isEmpty
(
url
))
{
url
=
"404.html"
;
};
if
(
$
.
common
.
isEmpty
(
width
))
{
width
=
800
;
};
if
(
$
.
common
.
isEmpty
(
height
))
{
height
=
(
$
(
window
).
height
()
-
50
);
};
var
index
=
layer
.
open
({
type
:
2
,
area
:
[
width
+
'px'
,
height
+
'px'
],
fix
:
false
,
//不固定
maxmin
:
true
,
shade
:
0.3
,
title
:
title
,
content
:
url
});
layer
.
full
(
index
);
},
// 打开遮罩层
loading
:
function
(
message
)
{
$
.
blockUI
({
message
:
'<div class="loaderbox"><div class="loading-activity"></div> '
+
message
+
'</div>'
});
},
// 关闭遮罩层
closeLoading
:
function
()
{
setTimeout
(
function
(){
$
.
unblockUI
();
},
50
);
},
// 重新加载
reload
:
function
()
{
parent
.
location
.
reload
();
}
},
// 操作封装处理
operate
:
{
// 提交数据
submit
:
function
(
url
,
type
,
dataType
,
data
)
{
$
.
modal
.
loading
(
"正在处理中,请稍后..."
);
var
config
=
{
url
:
url
,
type
:
type
,
dataType
:
dataType
,
data
:
data
,
success
:
function
(
result
)
{
$
.
operate
.
ajaxSuccess
(
result
);
}
};
$
.
ajax
(
config
)
},
// post请求传输
post
:
function
(
url
,
data
)
{
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
);
},
// 删除信息
remove
:
function
(
id
)
{
$
.
modal
.
confirm
(
"确定删除该条"
+
$
.
table
.
_option
.
modalName
+
"信息吗?"
,
function
()
{
var
url
=
$
.
common
.
isEmpty
(
id
)
?
$
.
table
.
_option
.
removeUrl
:
$
.
table
.
_option
.
removeUrl
.
replace
(
"{id}"
,
id
);
var
data
=
{
"ids"
:
id
};
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
);
});
},
// 批量删除信息
batRemove
:
function
()
{
var
rows
=
$
.
common
.
isEmpty
(
$
.
table
.
_option
.
id
)
?
$
.
table
.
selectFirstColumns
()
:
$
.
table
.
selectColumns
(
$
.
table
.
_option
.
id
);
if
(
rows
.
length
==
0
)
{
$
.
modal
.
alertWarning
(
"请至少选择一条记录"
);
return
;
}
$
.
modal
.
confirm
(
"确认要删除选中的"
+
rows
.
length
+
"条数据吗?"
,
function
()
{
var
url
=
$
.
table
.
_option
.
removeUrl
;
var
data
=
{
"ids"
:
rows
.
join
()
};
$
.
operate
.
submit
(
url
,
"post"
,
"json"
,
data
);
});
},
// 添加信息
add
:
function
(
id
)
{
var
url
=
$
.
common
.
isEmpty
(
id
)
?
$
.
table
.
_option
.
createUrl
:
$
.
table
.
_option
.
createUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
open
(
"添加"
+
$
.
table
.
_option
.
modalName
,
url
);
},
// 修改信息
edit
:
function
(
id
)
{
var
url
=
$
.
table
.
_option
.
updateUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
open
(
"修改"
+
$
.
table
.
_option
.
modalName
,
url
);
},
// 添加信息 全屏
addFull
:
function
(
id
)
{
var
url
=
$
.
common
.
isEmpty
(
id
)
?
$
.
table
.
_option
.
createUrl
:
$
.
table
.
_option
.
createUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
openFull
(
"添加"
+
$
.
table
.
_option
.
modalName
,
url
);
},
// 修改信息 全屏
editFull
:
function
(
id
)
{
var
url
=
$
.
table
.
_option
.
updateUrl
.
replace
(
"{id}"
,
id
);
$
.
modal
.
openFull
(
"修改"
+
$
.
table
.
_option
.
modalName
,
url
);
},
// 保存信息
save
:
function
(
url
,
data
)
{
$
.
modal
.
loading
(
"正在处理中,请稍后..."
);
var
config
=
{
url
:
url
,
type
:
"post"
,
dataType
:
"json"
,
data
:
data
,
success
:
function
(
result
)
{
$
.
operate
.
saveSuccess
(
result
);
}
};
$
.
ajax
(
config
)
},
// 保存结果弹出msg刷新table表格
ajaxSuccess
:
function
(
result
)
{
if
(
result
.
code
==
web_status
.
SUCCESS
)
{
$
.
modal
.
msgSuccess
(
result
.
msg
);
$
.
table
.
refresh
();
}
else
{
$
.
modal
.
alertError
(
result
.
msg
);
}
$
.
modal
.
closeLoading
();
},
// 保存结果提示msg
saveSuccess
:
function
(
result
)
{
if
(
result
.
code
==
web_status
.
SUCCESS
)
{
$
.
modal
.
msgReload
(
"保存成功,正在刷新数据请稍后……"
,
modal_status
.
SUCCESS
);
}
else
{
$
.
modal
.
alertError
(
result
.
msg
);
}
$
.
modal
.
closeLoading
();
}
},
// 通用方法封装处理
common
:
{
// 判断字符串是否为空
isEmpty
:
function
(
value
)
{
if
(
value
==
null
||
this
.
trim
(
value
)
==
""
)
{
return
true
;
}
return
false
;
},
// 是否显示数据 为空默认为显示
visible
:
function
(
value
)
{
if
(
$
.
common
.
isEmpty
(
value
)
||
value
==
true
)
{
return
true
;
}
return
false
;
},
// 空格截取
trim
:
function
(
value
)
{
if
(
value
==
null
)
{
return
""
;
}
return
value
.
toString
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
|
\r
|
\n
/g
,
""
);
},
// 指定随机数返回
random
:
function
(
min
,
max
)
{
return
Math
.
floor
((
Math
.
random
()
*
max
)
+
min
);
}
}
});
})(
jQuery
);
/** 消息状态码 */
web_status
=
{
SUCCESS
:
0
,
FAIL
:
500
};
/** 弹窗状态码 */
modal_status
=
{
SUCCESS
:
"success"
,
FAIL
:
"error"
,
WARNING
:
"warning"
};
\ No newline at end of file
src/main/resources/templates/include.html
View file @
cc9c67cd
...
...
@@ -40,8 +40,8 @@
<script
th:src=
"@{/ajax/libs/blockUI/jquery.blockUI.js}"
></script>
<script
th:src=
"@{/ajax/libs/layer/layer.min.js}"
></script>
<script
th:src=
"@{/ajax/libs/layui/layui.js}"
></script>
<script
th:src=
"@{/ruoyi/js/common.js?v=2.
1
.0}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
1
.0}"
></script>
<script
th:src=
"@{/ruoyi/js/common.js?v=2.
2
.0}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
2
.0}"
></script>
<script
src=
"http://tajs.qq.com/stats?sId=62048022"
></script>
<script
th:inline=
"javascript"
>
var
ctx
=
[[@{
/
}]];
</script>
</div>
src/main/resources/templates/index.html
View file @
cc9c67cd
...
...
@@ -15,12 +15,12 @@
<link
th:href=
"@{/css/font-awesome.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/css/animate.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/ruoyi/css/ry-ui.min.css?v=2.
1
.0}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/ruoyi/css/ry-ui.min.css?v=2.
2
.0}"
rel=
"stylesheet"
/>
<style
type=
"text/css"
>
.nav
>
li
:hover
.dropdown-menu
{
display
:
block
;}
</style>
</head>
<body
class=
"fixed-sidebar full-height-layout gray-bg"
style=
"overflow: hidden"
th:classappend=
"${@config
Service.selectConfigBy
Key('sys.index.skinName')}"
>
<body
class=
"fixed-sidebar full-height-layout gray-bg"
style=
"overflow: hidden"
th:classappend=
"${@config
.get
Key('sys.index.skinName')}"
>
<div
id=
"wrapper"
>
<!--左侧导航开始-->
...
...
@@ -136,7 +136,7 @@
<script
th:src=
"@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"
></script>
<script
th:src=
"@{/ajax/libs/blockUI/jquery.blockUI.js}"
></script>
<script
src=
"http://tajs.qq.com/stats?sId=62048022"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
1
.0}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
2
.0}"
></script>
<script
th:src=
"@{/ruoyi/index.js}"
></script>
<script
th:src=
"@{/ajax/libs/fullscreen/jquery.fullscreen.js}"
></script>
</body>
...
...
src/main/resources/templates/login.html
View file @
cc9c67cd
...
...
@@ -12,7 +12,7 @@
<link
href=
"../static/css/style.css"
th:href=
"@{css/style.css}"
rel=
"stylesheet"
/>
<link
href=
"../static/css/login.min.css"
th:href=
"@{css/login.min.css}"
rel=
"stylesheet"
/>
<link
href=
"../static/ajax/libs/iCheck/custom.css"
th:href=
"@{/ajax/libs/iCheck/custom.css}"
rel=
"stylesheet"
/>
<link
href=
"../static/ruoyi/css/ry-ui.min.css"
th:href=
"@{/ruoyi/css/ry-ui.min.css?v=2.
1
.0}"
rel=
"stylesheet"
/>
<link
href=
"../static/ruoyi/css/ry-ui.min.css"
th:href=
"@{/ruoyi/css/ry-ui.min.css?v=2.
2
.0}"
rel=
"stylesheet"
/>
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<![endif]-->
...
...
@@ -81,7 +81,7 @@
<script
src=
"../static/ajax/libs/iCheck/icheck.min.js"
th:src=
"@{/ajax/libs/iCheck/icheck.min.js}"
></script>
<script
src=
"../static/ajax/libs/blockUI/jquery.blockUI.js"
th:src=
"@{/ajax/libs/blockUI/jquery.blockUI.js}"
></script>
<script
src=
"http://tajs.qq.com/stats?sId=62048022"
></script>
<script
src=
"../static/ruoyi/js/ry-ui.min.js"
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
1
.0}"
></script>
<script
src=
"../static/ruoyi/js/ry-ui.min.js"
th:src=
"@{/ruoyi/js/ry-ui.min.js?v=2.
2
.0}"
></script>
<script
src=
"../static/ruoyi/login.js"
th:src=
"@{/ruoyi/login.js}"
></script>
</body>
</html>
src/main/resources/templates/main.html
View file @
cc9c67cd
...
...
@@ -97,10 +97,34 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h5
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#version"
href=
"#v2
0"
>
v2.1.0
</a><code
class=
"pull-right"
>
2018.07.10
</code>
<a
data-toggle=
"collapse"
data-parent=
"#version"
href=
"#v2
2"
>
v2.2.0
</a><code
class=
"pull-right"
>
2018.07.23
</code>
</h5>
</div>
<div
id=
"v20"
class=
"panel-collapse collapse in"
>
<div
id=
"v22"
class=
"panel-collapse collapse in"
>
<div
class=
"panel-body"
>
<ol>
<li>
修复批量生成代码异常问题
</li>
<li>
修复定时器保存失败问题
</li>
<li>
修复热部署转换问题
</li>
<li>
支持查询
&
统一样式(菜单管理,部门管理)
</li>
<li>
大多数功能支持时间查询
</li>
<li>
去掉自定义导出注解column列变更为自动匹配
</li>
<li>
新增任务执行策略
</li>
<li>
操作详细动态显示类型
</li>
<li>
支持动态回显字典数据
</li>
<li>
后台代码优化调整
</li>
<li>
其他细节优化
</li>
</ol>
</div>
</div>
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h5
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#version"
href=
"#v21"
>
v2.1.0
</a><code
class=
"pull-right"
>
2018.07.10
</code>
</h5>
</div>
<div
id=
"v21"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
>
<ol>
<li>
新增登陆超时提醒
</li>
...
...
src/main/resources/templates/monitor/job/add.html
View file @
cc9c67cd
...
...
@@ -46,7 +46,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_job_status')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_job_status')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -85,7 +85,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-job-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-job-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/monitor/job/edit.html
View file @
cc9c67cd
...
...
@@ -47,7 +47,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_job_status')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_job_status')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -86,7 +86,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-job-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-job-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/monitor/job/job.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
方法名称:
<input
type=
"text"
name=
"methodName"
/>
</li>
<li>
任务状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_job_status')}"
>
任务状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_job_status')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -51,9 +51,10 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'monitor:job:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'monitor:job:remove'
)}]];
var
statusFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'monitor:job:changeStatus'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:job:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:job:remove'
)}]];
var
statusFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:job:changeStatus'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_job_status'
)}]];
var
prefix
=
ctx
+
"monitor/job"
$
(
function
()
{
...
...
@@ -102,11 +103,7 @@
title
:
'任务状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">暂停</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/monitor/job/jobLog.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
<label>
方法名称:
</label><input
type=
"text"
name=
"methodName"
/>
</li>
<li>
<label>
执行状态:
</label><select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_common_status')}"
>
<label>
执行状态:
</label><select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_common_status')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -51,7 +51,8 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'monitor:job:remove'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:job:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_job_status'
)}]];
var
prefix
=
ctx
+
"monitor/jobLog"
$
(
function
()
{
...
...
@@ -98,11 +99,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">失败</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/monitor/logininfor/logininfor.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
<label>
登录名称:
</label><input
type=
"text"
name=
"loginName"
/>
</li>
<li>
<label>
登录状态:
</label><select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_common_status')}"
>
<label>
登录状态:
</label><select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_common_status')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -51,7 +51,8 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
>
<script
th:inline=
"javascript"
>
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_common_status'
)}]];
var
prefix
=
ctx
+
"monitor/logininfor"
$
(
function
()
{
...
...
@@ -96,11 +97,7 @@
title
:
'登录状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">成功</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">失败</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/monitor/online/online.html
View file @
cc9c67cd
...
...
@@ -38,7 +38,7 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
forceFlag
=
[[
$
{@
permission
Service
.
hasPermi
(
'monitor:online:forceLogout'
)}]];
var
forceFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:online:forceLogout'
)}]];
var
prefix
=
ctx
+
"monitor/online"
$
(
function
()
{
...
...
src/main/resources/templates/monitor/operlog/detail.html
View file @
cc9c67cd
...
...
@@ -8,7 +8,7 @@
<form
class=
"form-horizontal m-t"
id=
"signupForm"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
操作模块:
</label>
<div
class=
"form-control-static"
th:text=
"${operLog.title} + ' / ' + ${
operLog.action
}"
>
<div
class=
"form-control-static"
th:text=
"${operLog.title} + ' / ' + ${
@dict.getLabel('sys_oper_type',operLog.action)
}"
>
</div>
</div>
<div
class=
"form-group"
>
...
...
src/main/resources/templates/monitor/operlog/operlog.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
<label>
操作人员:
</label><input
type=
"text"
name=
"operName"
/>
</li>
<li>
<label>
操作类型:
</label><select
name=
"action"
th:with=
"type=${@dict
Service.selectDictData
('sys_oper_type')}"
>
<label>
操作类型:
</label><select
name=
"action"
th:with=
"type=${@dict
.getType
('sys_oper_type')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -52,7 +52,8 @@
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
detailFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'monitor:operlog:detail'
)}]];
var
detailFlag
=
[[
$
{@
permission
.
hasPermi
(
'monitor:operlog:detail'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_oper_type'
)}]];
var
prefix
=
ctx
+
"monitor/operlog"
$
(
function
()
{
...
...
@@ -80,27 +81,7 @@
title
:
'操作类型'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
1
)
{
return
'<span class="badge badge-primary">新增</span>'
;
}
else
if
(
value
==
2
)
{
return
'<span class="badge badge-primary">修改</span>'
;
}
else
if
(
value
==
3
)
{
return
'<span class="badge badge-warning">保存</span>'
;
}
else
if
(
value
==
4
)
{
return
'<span class="badge badge-danger">删除</span>'
;
}
else
if
(
value
==
5
)
{
return
'<span class="badge badge-primary">授权</span>'
;
}
else
if
(
value
==
6
)
{
return
'<span class="badge badge-warning">导出</span>'
;
}
else
if
(
value
==
7
)
{
return
'<span class="badge badge-warning">导入</span>'
;
}
else
if
(
value
==
8
)
{
return
'<span class="badge badge-danger">强退</span>'
;
}
else
if
(
value
==
9
)
{
return
'<span class="badge badge-danger">禁止访问</span>'
;
}
else
if
(
value
==
10
)
{
return
'<span class="badge badge-warning">生成代码</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/config/add.html
View file @
cc9c67cd
...
...
@@ -25,7 +25,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
系统内置:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_yes_no')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_yes_no')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"configType"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -82,7 +82,7 @@
}
},
submitHandler
:
function
(
form
)
{
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-config-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-config-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/config/config.html
View file @
cc9c67cd
...
...
@@ -17,7 +17,7 @@
参数键名:
<input
type=
"text"
name=
"configKey"
/>
</li>
<li>
系统内置:
<select
name=
"configType"
th:with=
"type=${@dict
Service.selectDictData
('sys_yes_no')}"
>
系统内置:
<select
name=
"configType"
th:with=
"type=${@dict
.getType
('sys_yes_no')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -52,8 +52,9 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:config:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:config:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:config:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:config:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_yes_no'
)}]];
var
prefix
=
ctx
+
"system/config"
$
(
function
()
{
...
...
@@ -92,11 +93,7 @@
title
:
'系统内置'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
'Y'
)
{
return
'<span class="badge badge-primary">是</span>'
;
}
else
if
(
value
==
'N'
)
{
return
'<span class="badge badge-danger">否</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/config/edit.html
View file @
cc9c67cd
...
...
@@ -26,7 +26,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
系统内置:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_yes_no')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_yes_no')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"configType"
th:value=
"${dict['dictValue']}"
th:field=
"*{configType}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -86,7 +86,7 @@
}
},
submitHandler
:
function
(
form
)
{
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-config-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-config-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/dept/add.html
View file @
cc9c67cd
...
...
@@ -44,7 +44,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
部门状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -94,7 +94,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dept-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-dept-add'
).
serialize
());
}
});
...
...
src/main/resources/templates/system/dept/dept.html
View file @
cc9c67cd
...
...
@@ -14,7 +14,7 @@
部门名称:
<input
type=
"text"
name=
"deptName"
/>
</li>
<li>
部门状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
部门状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -39,9 +39,10 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
addFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dept:add'
)}]];
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dept:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dept:remove'
)}]];
var
addFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dept:add'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dept:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dept:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/dept"
window
.
onload
=
function
()
{
...
...
@@ -71,11 +72,7 @@
title
:
'状态'
,
align
:
"center"
,
formatter
:
function
(
item
,
index
)
{
if
(
item
.
status
==
'0'
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
item
.
status
==
'1'
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
item
.
status
);
}
},
{
...
...
src/main/resources/templates/system/dept/edit.html
View file @
cc9c67cd
...
...
@@ -45,7 +45,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
部门状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -97,7 +97,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dept-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-dept-edit'
).
serialize
());
}
});
...
...
src/main/resources/templates/system/dict/data/add.html
View file @
cc9c67cd
...
...
@@ -30,8 +30,14 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
回显样式:
</label>
<div
class=
"col-sm-8"
>
<input
class=
"form-control"
type=
"text"
id=
"listClass"
name=
"listClass"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
系统默认:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_yes_no')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_yes_no')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"isDefault"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -46,7 +52,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -86,7 +92,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dict-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-dict-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/dict/data/data.html
View file @
cc9c67cd
...
...
@@ -20,7 +20,7 @@
字典标签:
<input
type=
"text"
name=
"dictLabel"
/>
</li>
<li>
数据状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
数据状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -51,8 +51,9 @@
<div
th:include=
"include :: footer"
></div>
<script
th:src=
"@{/ajax/libs/select/select2.js}"
></script>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dict:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dict:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dict:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dict:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/dict/data"
$
(
function
()
{
...
...
@@ -92,11 +93,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/dict/data/edit.html
View file @
cc9c67cd
...
...
@@ -31,8 +31,14 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
回显样式:
</label>
<div
class=
"col-sm-8"
>
<input
class=
"form-control"
type=
"text"
id=
"listClass"
name=
"listClass"
th:field=
"*{listClass}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
系统默认:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_yes_no')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_yes_no')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"isDefault"
th:value=
"${dict['dictValue']}"
th:field=
"*{isDefault}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -47,7 +53,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -87,7 +93,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dict-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-dict-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/dict/type/add.html
View file @
cc9c67cd
...
...
@@ -19,7 +19,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -75,7 +75,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dict-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-dict-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/dict/type/edit.html
View file @
cc9c67cd
...
...
@@ -20,7 +20,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -79,7 +79,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-dict-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-dict-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/dict/type/type.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
字典类型:
<input
type=
"text"
name=
"dictType"
/>
</li>
<li>
字典状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
字典状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -54,9 +54,10 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dict:edit'
)}]];
var
listFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dict:list'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:dict:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dict:edit'
)}]];
var
listFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dict:list'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:dict:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/dict"
$
(
function
()
{
...
...
@@ -96,11 +97,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/menu/add.html
View file @
cc9c67cd
...
...
@@ -58,7 +58,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
菜单状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_show_hide')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_show_hide')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"visible"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -107,7 +107,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-menu-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-menu-add'
).
serialize
());
}
});
...
...
src/main/resources/templates/system/menu/edit.html
View file @
cc9c67cd
...
...
@@ -59,7 +59,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
菜单状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_show_hide')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_show_hide')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"visible"
th:value=
"${dict['dictValue']}"
th:field=
"*{visible}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -117,7 +117,7 @@
}
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-menu-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-menu-edit'
).
serialize
());
}
});
...
...
src/main/resources/templates/system/menu/menu.html
View file @
cc9c67cd
...
...
@@ -14,7 +14,7 @@
菜单名称:
<input
type=
"text"
name=
"menuName"
/>
</li>
<li>
菜单状态:
<select
name=
"visible"
th:with=
"type=${@dict
Service.selectDictData
('sys_show_hide')}"
>
菜单状态:
<select
name=
"visible"
th:with=
"type=${@dict
.getType
('sys_show_hide')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -40,9 +40,10 @@
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
addFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:menu:add'
)}]];
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:menu:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:menu:remove'
)}]];
var
addFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:menu:add'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:menu:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:menu:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_show_hide'
)}]];
var
prefix
=
ctx
+
"system/menu"
window
.
onload
=
function
()
{
...
...
@@ -106,11 +107,7 @@
width
:
'10%'
,
align
:
"center"
,
formatter
:
function
(
row
,
index
)
{
if
(
row
.
visible
==
0
)
{
return
'<span class="badge badge-primary">显示</span>'
;
}
else
if
(
row
.
visible
==
1
)
{
return
'<span class="badge badge-danger">隐藏</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
row
.
visible
);
}
},
{
...
...
src/main/resources/templates/system/notice/add.html
View file @
cc9c67cd
...
...
@@ -16,7 +16,7 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
公告类型:
</label>
<div
class=
"col-sm-8"
>
<select
name=
"noticeType"
class=
"form-control m-b"
th:with=
"type=${@dict
Service.selectDictData
('sys_notice_type')}"
>
<select
name=
"noticeType"
class=
"form-control m-b"
th:with=
"type=${@dict
.getType
('sys_notice_type')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict['dictLabel']}"
th:value=
"${dict['dictValue']}"
></option>
</select>
</div>
...
...
@@ -30,7 +30,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
公告状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_notice_status')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_notice_status')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -65,7 +65,7 @@
submitHandler
:
function
(
form
)
{
var
sHTML
=
$
(
'.summernote'
).
code
();
$
(
"#noticeContent"
).
val
(
sHTML
);
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-notice-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-notice-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/notice/edit.html
View file @
cc9c67cd
...
...
@@ -17,7 +17,7 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
公告类型:
</label>
<div
class=
"col-sm-8"
>
<select
name=
"noticeType"
class=
"form-control m-b"
th:with=
"type=${@dict
Service.selectDictData
('sys_notice_type')}"
>
<select
name=
"noticeType"
class=
"form-control m-b"
th:with=
"type=${@dict
.getType
('sys_notice_type')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict['dictLabel']}"
th:value=
"${dict['dictValue']}"
th:field=
"*{noticeType}"
></option>
</select>
</div>
...
...
@@ -31,7 +31,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
公告状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_notice_status')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_notice_status')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -69,7 +69,7 @@
submitHandler
:
function
(
form
)
{
var
sHTML
=
$
(
'.summernote'
).
code
();
$
(
"#noticeContent"
).
val
(
sHTML
);
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-notice-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-notice-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/notice/notice.html
View file @
cc9c67cd
...
...
@@ -17,7 +17,7 @@
操作人员:
<input
type=
"text"
name=
"createBy"
/>
</li>
<li>
公告类型:
<select
name=
"noticeType"
th:with=
"type=${@dict
Service.selectDictData
('sys_notice_type')}"
>
公告类型:
<select
name=
"noticeType"
th:with=
"type=${@dict
.getType
('sys_notice_type')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -46,8 +46,10 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:notice:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:notice:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:notice:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:notice:remove'
)}]];
var
types
=
[[
$
{@
dict
.
getType
(
'sys_notice_type'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_notice_status'
)}]];
var
prefix
=
ctx
+
"system/notice"
$
(
function
()
{
...
...
@@ -74,11 +76,7 @@
title
:
'公告类型'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
'1'
)
{
return
'<span class="label label-warning">通知</span>'
;
}
else
if
(
value
==
'2'
)
{
return
'<span class="badge badge-success">公告</span>'
;
}
return
$
.
table
.
selectDictLabel
(
types
,
value
);
}
},
{
...
...
@@ -86,11 +84,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
'0'
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
'1'
)
{
return
'<span class="badge badge-danger">关闭</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/post/add.html
View file @
cc9c67cd
...
...
@@ -25,7 +25,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
岗位状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:checked=
"${dict['isDefault'] == 'Y' ? true : false}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -64,7 +64,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-post-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-post-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/post/edit.html
View file @
cc9c67cd
...
...
@@ -26,7 +26,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
岗位状态:
</label>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
<div
class=
"col-sm-8"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<div
th:each=
"dict : ${type}"
th:class=
"${dict['cssClass']}"
>
<input
type=
"radio"
th:id=
"${dict['dictCode']}"
name=
"status"
th:value=
"${dict['dictValue']}"
th:field=
"*{status}"
>
<label
th:for=
"${dict['dictCode']}"
th:text=
"${dict['dictLabel']}"
></label>
...
...
@@ -65,7 +65,7 @@
},
},
submitHandler
:
function
(
form
){
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-post-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-post-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/system/post/post.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
岗位名称:
<input
type=
"text"
name=
"postName"
/>
</li>
<li>
岗位状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
岗位状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -48,8 +48,9 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:post:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:post:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:post:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:post:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/post"
$
(
function
()
{
...
...
@@ -90,11 +91,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/role/add.html
View file @
cc9c67cd
...
...
@@ -137,7 +137,7 @@
$
.
ajax
({
cache
:
true
,
type
:
"POST"
,
url
:
ctx
+
"system/role/
save
"
,
url
:
ctx
+
"system/role/
add
"
,
data
:
{
"roleName"
:
roleName
,
"roleKey"
:
roleKey
,
...
...
src/main/resources/templates/system/role/edit.html
View file @
cc9c67cd
...
...
@@ -142,7 +142,7 @@
$
.
ajax
({
cache
:
true
,
type
:
"POST"
,
url
:
ctx
+
"system/role/
save
"
,
url
:
ctx
+
"system/role/
edit
"
,
data
:
{
"roleId"
:
roleId
,
"roleName"
:
roleName
,
...
...
src/main/resources/templates/system/role/role.html
View file @
cc9c67cd
...
...
@@ -18,7 +18,7 @@
权限字符:
<input
type=
"text"
name=
"roleKey"
/>
</li>
<li>
角色状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
角色状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -54,9 +54,11 @@
</div>
<div
th:include=
"include :: footer"
></div>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:role:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:role:remove'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:role:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:role:remove'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/role"
$
(
function
()
{
var
options
=
{
...
...
@@ -96,11 +98,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
0
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
1
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/system/user/add.html
View file @
cc9c67cd
...
...
@@ -28,7 +28,7 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
密码:
</label>
<div
class=
"col-sm-8"
>
<input
class=
"form-control"
type=
"password"
name=
"password"
id=
"password"
th:value=
"${@config
Service.selectConfigBy
Key('sys.user.initPassword')}"
>
<input
class=
"form-control"
type=
"password"
name=
"password"
id=
"password"
th:value=
"${@config
.get
Key('sys.user.initPassword')}"
>
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -46,7 +46,7 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
性别:
</label>
<div
class=
"col-sm-8"
>
<select
id=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict
Service.selectDictData
('sys_user_sex')}"
>
<select
id=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict
.getType
('sys_user_sex')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict['dictLabel']}"
th:value=
"${dict['dictValue']}"
></option>
</select>
</div>
...
...
@@ -193,7 +193,7 @@
$
.
ajax
({
cache
:
true
,
type
:
"POST"
,
url
:
ctx
+
"system/user/
save
"
,
url
:
ctx
+
"system/user/
add
"
,
data
:
{
"userId"
:
userId
,
"deptId"
:
deptId
,
...
...
src/main/resources/templates/system/user/edit.html
View file @
cc9c67cd
...
...
@@ -41,7 +41,7 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
性别:
</label>
<div
class=
"col-sm-8"
>
<select
id=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict
Service.selectDictData
('sys_user_sex')}"
>
<select
id=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict
.getType
('sys_user_sex')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict['dictLabel']}"
th:value=
"${dict['dictValue']}"
th:field=
"*{sex}"
></option>
</select>
</div>
...
...
@@ -165,7 +165,7 @@
$
.
ajax
({
cache
:
true
,
type
:
"POST"
,
url
:
ctx
+
"system/user/
save
"
,
url
:
ctx
+
"system/user/
edit
"
,
data
:
{
"userId"
:
userId
,
"deptId"
:
deptId
,
...
...
src/main/resources/templates/system/user/profile/profile.html
View file @
cc9c67cd
...
...
@@ -44,7 +44,7 @@
<p><i
class=
"fa fa-user"
></i>
[[${user.userName}]] / [[${#strings.defaultString(roleGroup,'无角色')}]]
<p><i
class=
"fa fa-phone"
></i>
[[${user.phonenumber}]]
</p>
<p><i
class=
"fa fa-group"
></i>
[[${user.dept.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]
</p>
<p><i
class=
"fa fa-transgender"
></i>
[[${user.sex}]]
</p>
<p><i
class=
"fa fa-transgender"
></i>
性别:
[[${user.sex}]]
</p>
<p><i
class=
"fa fa-envelope-o"
></i>
[[${user.email}]]
</p>
<p><i
class=
"fa fa-calendar"
></i>
[[${#dates.format(user.createTime, 'yyyy-MM-dd HH:mm:ss')}]]
</p>
</div>
...
...
src/main/resources/templates/system/user/user.html
View file @
cc9c67cd
...
...
@@ -43,7 +43,7 @@
手机号码:
<input
type=
"text"
name=
"phonenumber"
/>
</li>
<li>
用户状态:
<select
name=
"status"
th:with=
"type=${@dict
Service.selectDictData
('sys_normal_disable')}"
>
用户状态:
<select
name=
"status"
th:with=
"type=${@dict
.getType
('sys_normal_disable')}"
>
<option
value=
""
>
所有
</option>
<option
th:each=
"e : ${type}"
th:text=
"${e['dictLabel']}"
th:value=
"${e['dictValue']}"
></option>
</select>
...
...
@@ -81,9 +81,10 @@
<script
th:src=
"@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"
></script>
<script
th:src=
"@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"
></script>
<script
th:inline=
"javascript"
>
var
editFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:user:edit'
)}]];
var
removeFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:user:remove'
)}]];
var
resetPwdFlag
=
[[
$
{@
permissionService
.
hasPermi
(
'system:user:resetPwd'
)}]];
var
editFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:user:edit'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:user:remove'
)}]];
var
resetPwdFlag
=
[[
$
{@
permission
.
hasPermi
(
'system:user:resetPwd'
)}]];
var
datas
=
[[
$
{@
dict
.
getType
(
'sys_normal_disable'
)}]];
var
prefix
=
ctx
+
"system/user"
$
(
document
).
ready
(
function
(){
...
...
@@ -138,11 +139,7 @@
title
:
'状态'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
'0'
)
{
return
'<span class="badge badge-primary">正常</span>'
;
}
else
if
(
value
==
'1'
)
{
return
'<span class="badge badge-danger">停用</span>'
;
}
return
$
.
table
.
selectDictLabel
(
datas
,
value
);
}
},
{
...
...
src/main/resources/templates/vm/html/add.html.vm
View file @
cc9c67cd
...
...
@@ -33,7 +33,7 @@
},
},
submitHandler
:
function
(
form
)
{
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-${classname}-add'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
add
"
,
$
(
'#form-${classname}-add'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/vm/html/edit.html.vm
View file @
cc9c67cd
...
...
@@ -34,7 +34,7 @@
},
},
submitHandler
:
function
(
form
)
{
$
.
operate
.
save
(
prefix
+
"/
save
"
,
$
(
'#form-${classname}-edit'
).
serialize
());
$
.
operate
.
save
(
prefix
+
"/
edit
"
,
$
(
'#form-${classname}-edit'
).
serialize
());
}
});
</script>
...
...
src/main/resources/templates/vm/java/Controller.java.vm
View file @
cc9c67cd
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
org
.
apache
.
shiro
.
authz
.
annotation
.
RequiresPermissions
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
stereotype
.
Controller
;
import
org
.
springframework
.
ui
.
Model
;
import
org
.
springframework
.
ui
.
Model
Map
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
GetMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PathVariable
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PostMapping
;
...
...
@@ -56,41 +56,45 @@ public class ${className}Controller extends BaseController
/**
*
新增
${
tableComment
}
*/
@
RequiresPermissions
(
"${moduleName}:${classname}:add"
)
@
Log
(
title
=
"${tableComment}"
,
action
=
BusinessType
.
INSERT
)
@
GetMapping
(
"/add"
)
public
String
add
()
{
return
prefix
+
"/add"
;
}
/**
*
新增保存
${
tableComment
}
*/
@
RequiresPermissions
(
"${moduleName}:${classname}:add"
)
@
Log
(
title
=
"${tableComment}"
,
action
=
BusinessType
.
INSERT
)
@
PostMapping
(
"/add"
)
@
ResponseBody
public
AjaxResult
addSave
(${
className
}
${
classname
})
{
return
toAjax
(${
classname
}
Service
.
insert
${
className
}(${
classname
}));
}
/**
*
修改
${
tableComment
}
*/
@
RequiresPermissions
(
"${moduleName}:${classname}:edit"
)
@
Log
(
title
=
"${tableComment}"
,
action
=
BusinessType
.
UPDATE
)
@
GetMapping
(
"/edit/{${primaryKey.attrname}}"
)
public
String
edit
(@
PathVariable
(
"${primaryKey.attrname}"
)
${
primaryKey
.
attrType
}
${
primaryKey
.
attrname
},
Model
model
)
public
String
edit
(@
PathVariable
(
"${primaryKey.attrname}"
)
${
primaryKey
.
attrType
}
${
primaryKey
.
attrname
},
Model
Map
mmap
)
{
${
className
}
${
classname
}
=
${
classname
}
Service
.
select
${
className
}
ById
(${
primaryKey
.
attrname
});
m
odel
.
addAttribute
(
"${classname}"
,
${
classname
});
m
map
.
put
(
"${classname}"
,
${
classname
});
return
prefix
+
"/edit"
;
}
/**
*
保存
${
tableComment
}
*
修改
保存
${
tableComment
}
*/
@
RequiresPermissions
(
"${moduleName}:${classname}:
save
"
)
@
Log
(
title
=
"${tableComment}"
,
action
=
BusinessType
.
SAV
E
)
@
PostMapping
(
"/
save
"
)
@
RequiresPermissions
(
"${moduleName}:${classname}:
edit
"
)
@
Log
(
title
=
"${tableComment}"
,
action
=
BusinessType
.
UPDAT
E
)
@
PostMapping
(
"/
edit
"
)
@
ResponseBody
public
AjaxResult
save
(${
className
}
${
classname
})
{
if
(${
classname
}
Service
.
save
${
className
}(${
classname
})
>
0
)
{
return
success
();
}
return
error
();
public
AjaxResult
editSave
(${
className
}
${
classname
})
{
return
toAjax
(${
classname
}
Service
.
update
${
className
}(${
classname
}));
}
/**
...
...
@@ -101,13 +105,8 @@ public class ${className}Controller extends BaseController
@
PostMapping
(
"/remove"
)
@
ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
int
rows
=
${
classname
}
Service
.
delete
${
className
}
ByIds
(
ids
);
if
(
rows
>
0
)
{
return
success
();
}
return
error
();
{
return
toAjax
(${
classname
}
Service
.
delete
${
className
}
ByIds
(
ids
));
}
}
src/main/resources/templates/vm/java/Service.java.vm
View file @
cc9c67cd
...
...
@@ -42,16 +42,7 @@ public interface I${className}Service
*
@
return
结果
*/
public
int
update
${
className
}(${
className
}
${
classname
});
/**
*
保存
${
tableComment
}
*
*
@
param
${
classname
}
${
tableComment
}
信息
*
@
return
结果
*/
public
int
save
${
className
}(${
className
}
${
classname
});
/**
*
删除
${
tableComment
}
信息
*
...
...
src/main/resources/templates/vm/java/ServiceImpl.java.vm
View file @
cc9c67cd
...
...
@@ -3,7 +3,6 @@ package ${package}.service;
import
java
.
util
.
List
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
stereotype
.
Service
;
import
com
.
ruoyi
.
common
.
utils
.
StringUtils
;
import
${
package
}.
mapper
.${
className
}
Mapper
;
import
${
package
}.
domain
.${
className
};
import
${
package
}.
service
.
I
${
className
}
Service
;
...
...
@@ -68,29 +67,7 @@ public class ${className}ServiceImpl implements I${className}Service
{
return
${
classname
}
Mapper
.
update
${
className
}(${
classname
});
}
/**
*
保存
${
tableComment
}
*
*
@
param
${
classname
}
${
tableComment
}
信息
*
@
return
结果
*/
@
Override
public
int
save
${
className
}(${
className
}
${
classname
})
{
${
primaryKey
.
attrType
}
${
primaryKey
.
attrname
}
=
${
classname
}.
get
${
primaryKey
.
attrName
}();
int
rows
=
0
;
if
(
StringUtils
.
isNotNull
(${
primaryKey
.
attrname
}))
{
rows
=
${
classname
}
Mapper
.
update
${
className
}(${
classname
});
}
else
{
rows
=
${
classname
}
Mapper
.
insert
${
className
}(${
classname
});
}
return
rows
;
}
/**
*
删除
${
tableComment
}
对象
*
...
...
src/main/resources/templates/vm/sql/sql.vm
View file @
cc9c67cd
...
...
@@ -17,6 +17,3 @@ values('${tableComment}修改', @parentId, '3', '#', 'F', '0', '${moduleName}:
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('${tableComment}删除', @parentId, '4', '#', 'F', '0', '${moduleName}:${classname}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('${tableComment}保存', @parentId, '5', '#', 'F', '0', '${moduleName}:${classname}:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
src/test/java/com/ruoyi/common/utils/AddressUtilsTest.java
View file @
cc9c67cd
...
...
@@ -12,14 +12,17 @@ import org.junit.Test;
* @since 07/22/2018
*/
public
class
AddressUtilsTest
{
public
class
AddressUtilsTest
{
@Before
public
void
before
()
throws
Exception
{
public
void
before
()
throws
Exception
{
}
@After
public
void
after
()
throws
Exception
{
public
void
after
()
throws
Exception
{
}
/**
...
...
@@ -27,11 +30,11 @@ public class AddressUtilsTest {
* <p>
*/
@Test
public
void
testGetRealAddressByIP
()
throws
Exception
{
//TODO: Test goes here...
public
void
testGetRealAddressByIP
()
throws
Exception
{
// TODO: Test goes here...
String
ipAddress
=
AddressUtils
.
getRealAddressByIP
(
"121.8.250.1"
);
System
.
out
.
println
(
ipAddress
);
}
}
}
src/test/java/com/ruoyi/project/system/dept/service/DeptServiceImplTest.java
View file @
cc9c67cd
...
...
@@ -6,10 +6,8 @@ import org.junit.Before;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -22,32 +20,37 @@ import java.util.Map;
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
DeptServiceImplTest
{
public
class
DeptServiceImplTest
{
@Autowired
private
IDeptService
deptService
;
@Before
public
void
before
()
throws
Exception
{
public
void
before
()
throws
Exception
{
}
@After
public
void
after
()
throws
Exception
{
public
void
after
()
throws
Exception
{
}
/**
* Method: selectDeptList(Dept dept)
*/
@Test
public
void
testSelectDeptList
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSelectDeptList
()
throws
Exception
{
// TODO: Test goes here...
}
/**
* Method: selectDeptAll()
*/
@Test
public
void
testSelectDeptAll
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSelectDeptAll
()
throws
Exception
{
// TODO: Test goes here...
Assert
.
assertEquals
(
deptService
.
selectDeptAll
().
size
(),
10
);
}
...
...
@@ -55,19 +58,20 @@ public class DeptServiceImplTest {
* Method: selectDeptTree()
*/
@Test
public
void
testSelectDeptTree
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSelectDeptTree
()
throws
Exception
{
// TODO: Test goes here...
List
<
Map
<
String
,
Object
>>
trees
=
deptService
.
selectDeptTree
();
trees
.
stream
()
.
forEach
(
tree
->
System
.
out
.
println
(
tree
));
trees
.
stream
().
forEach
(
tree
->
System
.
out
.
println
(
tree
));
}
/**
* Method: selectDeptCount(Long parentId)
*/
@Test
public
void
testSelectDeptCount
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSelectDeptCount
()
throws
Exception
{
// TODO: Test goes here...
Assert
.
assertEquals
(
10
,
deptService
.
selectDeptCount
(
0L
));
}
...
...
@@ -75,32 +79,36 @@ public class DeptServiceImplTest {
* Method: checkDeptExistUser(Long deptId)
*/
@Test
public
void
testCheckDeptExistUser
()
throws
Exception
{
//TODO: Test goes here...
public
void
testCheckDeptExistUser
()
throws
Exception
{
// TODO: Test goes here...
}
/**
* Method: deleteDeptById(Long deptId)
*/
@Test
public
void
testDeleteDeptById
()
throws
Exception
{
//TODO: Test goes here...
public
void
testDeleteDeptById
()
throws
Exception
{
// TODO: Test goes here...
}
/**
* Method: saveDept(Dept dept)
*/
@Test
public
void
testSaveDept
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSaveDept
()
throws
Exception
{
// TODO: Test goes here...
}
/**
* Method: selectDeptById(Long deptId)
*/
@Test
public
void
testSelectDeptById
()
throws
Exception
{
//TODO: Test goes here...
public
void
testSelectDeptById
()
throws
Exception
{
// TODO: Test goes here...
Assert
.
assertNotNull
(
"若依集团不存在"
,
deptService
.
selectDeptById
(
100L
));
}
...
...
@@ -108,9 +116,9 @@ public class DeptServiceImplTest {
* Method: checkDeptNameUnique(Dept dept)
*/
@Test
public
void
testCheckDeptNameUnique
()
throws
Exception
{
//TODO: Test goes here...
public
void
testCheckDeptNameUnique
()
throws
Exception
{
// TODO: Test goes here...
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment