若依2.2版本发布

pull/15/head
RuoYi 2018-07-22 23:05:50 +08:00
parent 9e8d80a699
commit cc9c67cdfb
115 changed files with 1579 additions and 1216 deletions

View File

@ -5,7 +5,7 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>RuoYi</artifactId> <artifactId>RuoYi</artifactId>
<version>2.1.0</version> <version>2.2.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>RuoYi</name> <name>RuoYi</name>

View File

@ -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('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('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('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('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', '角色管理菜单'); 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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('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('1041', '操作查询', '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('1033', '操作查询', '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('1042', '操作删除', '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('1034', '操作删除', '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('1043', '详细信息', '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('1035', '详细信息', '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('1044', '登录查询', '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('1036', '登录查询', '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('1045', '登录删除', '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('1037', '登录删除', '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('1046', '在线查询', '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('1038', '在线查询', '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('1047', '批量强退', '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('1039', '批量强退', '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('1048', '单条强退', '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('1040', '单条强退', '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('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('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('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('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('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('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('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('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('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('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('1055', '生成查询', '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('1046', '生成查询', '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('1056', '生成代码', '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('1047', '生成代码', '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', '1045');
insert into sys_role_menu values ('1', '1046'); insert into sys_role_menu values ('1', '1046');
insert into sys_role_menu values ('1', '1047'); 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岗位 -- 8、用户与岗位关联表 用户1-N岗位
@ -430,6 +412,7 @@ create table sys_dict_data
dict_value varchar(100) default '' comment '字典键值', dict_value varchar(100) default '' comment '字典键值',
dict_type varchar(100) default '' comment '字典类型', dict_type varchar(100) default '' comment '字典类型',
css_class varchar(500) default '' comment '样式属性', css_class varchar(500) default '' comment '样式属性',
list_class varchar(500) default '' comment '回显样式',
is_default char(1) default 'N' comment '是否默认Y是 N否', is_default char(1) default 'N' comment '是否默认Y是 N否',
status char(1) default '0' comment '状态0正常 1停用', status char(1) default '0' comment '状态0正常 1停用',
create_by varchar(64) default '' comment '创建者', create_by varchar(64) default '' comment '创建者',
@ -441,33 +424,31 @@ create table sys_dict_data
) engine=innodb auto_increment=100 default charset=utf8 comment = '字典数据表'; ) 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(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(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(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(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', 'N', '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', 'Y', '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', 'N', '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', 'Y', '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', 'N', '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', 'Y', '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', 'N', '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', '', 'Y', '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', '', 'N', '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', 'Y', '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', 'N', '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', '', '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', '', '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', '', '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', '', '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', '', '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', '', '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', '', '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', '', '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, 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(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, 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(25, 2, '失败', '1', 'sys_common_status', '', 'danger', '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', '停用状态');
-- ---------------------------- -- ----------------------------
-- 12、参数配置表 -- 12、参数配置表

View File

@ -14,20 +14,16 @@ public class BusinessType
public static final String INSERT = "1"; public static final String INSERT = "1";
/** 修改 */ /** 修改 */
public static final String UPDATE = "2"; 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 FORCE = "7";
/** 禁止访问 */
public static final String FORBID = "9";
/** 生成代码 */ /** 生成代码 */
public static final String GENCODE = "10"; public static final String GENCODE = "8";
} }

View File

@ -122,7 +122,7 @@ public class LoginService
{ {
user.setLoginIp(ShiroUtils.getIp()); user.setLoginIp(ShiroUtils.getIp());
user.setLoginDate(DateUtils.getNowDate()); user.setLoginDate(DateUtils.getNowDate());
userService.updateUser(user); userService.updateUserInfo(user);
} }
} }

View File

@ -61,6 +61,17 @@ public class BaseController
return rspData; return rspData;
} }
/**
*
*
* @param rows
* @return
*/
protected AjaxResult toAjax(int rows)
{
return rows > 0 ? success() : error();
}
/** /**
* *
*/ */

View File

@ -1,7 +1,7 @@
package com.ruoyi.framework.web.service; package com.ruoyi.framework.web.service;
import org.springframework.beans.factory.annotation.Autowired; 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; import com.ruoyi.project.system.config.service.IConfigService;
/** /**
@ -9,7 +9,7 @@ import com.ruoyi.project.system.config.service.IConfigService;
* *
* @author ruoyi * @author ruoyi
*/ */
@Component @Service("config")
public class ConfigService public class ConfigService
{ {
@Autowired @Autowired
@ -21,7 +21,7 @@ public class ConfigService
* @param configName * @param configName
* @return * @return
*/ */
public String selectConfigByKey(String configKey) public String getKey(String configKey)
{ {
return configService.selectConfigByKey(configKey); return configService.selectConfigByKey(configKey);
} }

View File

@ -2,7 +2,7 @@ package com.ruoyi.framework.web.service;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; 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.domain.DictData;
import com.ruoyi.project.system.dict.service.IDictDataService; import com.ruoyi.project.system.dict.service.IDictDataService;
@ -11,7 +11,7 @@ import com.ruoyi.project.system.dict.service.IDictDataService;
* *
* @author ruoyi * @author ruoyi
*/ */
@Component @Service("dict")
public class DictService public class DictService
{ {
@Autowired @Autowired
@ -23,8 +23,20 @@ public class DictService
* @param dictType * @param dictType
* @return * @return
*/ */
public List<DictData> selectDictData(String dictType) public List<DictData> getType(String dictType)
{ {
return dictDataService.selectDictDataByType(dictType); return dictDataService.selectDictDataByType(dictType);
} }
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String getLabel(String dictType, String dictValue)
{
return dictDataService.selectDictLabel(dictType, dictValue);
}
} }

View File

@ -1,14 +1,14 @@
package com.ruoyi.framework.shiro.service; package com.ruoyi.framework.web.service;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Service;
/** /**
* RuoYi js thymeleaf * RuoYi js thymeleaf
* *
* @author ruoyi * @author ruoyi
*/ */
@Component @Service("permission")
public class PermissionService public class PermissionService
{ {
public String hasPermi(String permission) public String hasPermi(String permission)

View File

@ -2,12 +2,15 @@ package com.ruoyi.project.common;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -20,10 +23,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
@Controller @Controller
public class CommonController public class CommonController
{ {
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@RequestMapping("common/download") @RequestMapping("common/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{ {
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
InputStream inputStream = null;
OutputStream os = null;
try try
{ {
String filePath = ResourceUtils.getURL("classpath:").getPath() + "static/file/" + fileName; String filePath = ResourceUtils.getURL("classpath:").getPath() + "static/file/" + fileName;
@ -32,16 +39,14 @@ public class CommonController
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + setFileDownloadHeader(request, realFileName)); response.setHeader("Content-Disposition", "attachment;fileName=" + setFileDownloadHeader(request, realFileName));
File file = new File(filePath); File file = new File(filePath);
InputStream inputStream = new FileInputStream(file); inputStream = new FileInputStream(file);
OutputStream os = response.getOutputStream(); os = response.getOutputStream();
byte[] b = new byte[1024]; byte[] b = new byte[1024];
int length; int length;
while ((length = inputStream.read(b)) > 0) while ((length = inputStream.read(b)) > 0)
{ {
os.write(b, 0, length); os.write(b, 0, length);
} }
os.close();
inputStream.close();
if (delete && file.exists()) if (delete && file.exists())
{ {
file.delete(); file.delete();
@ -49,7 +54,19 @@ public class CommonController
} }
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); log.error("下载文件失败", e);
}
finally
{
try
{
os.close();
inputStream.close();
}
catch (IOException e)
{
log.error("close close fail ", e);
}
} }
} }

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -94,11 +94,7 @@ public class JobController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult changeStatus(Job job) public AjaxResult changeStatus(Job job)
{ {
if (jobService.changeStatus(job) > 0) return toAjax(jobService.changeStatus(job));
{
return success();
}
return error();
} }
/** /**
@ -110,50 +106,49 @@ public class JobController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult run(Job job) public AjaxResult run(Job job)
{ {
if (jobService.run(job) > 0) return toAjax(jobService.run(job));
{
return success();
}
return error();
} }
/** /**
* *
*/ */
@Log(title = "定时任务", action = BusinessType.INSERT)
@RequiresPermissions("monitor:job:add")
@GetMapping("/add") @GetMapping("/add")
public String add(Model model) public String add()
{ {
return prefix + "/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}") @GetMapping("/edit/{jobId}")
public String edit(@PathVariable("jobId") Long jobId, Model model) public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap)
{ {
Job job = jobService.selectJobById(jobId); mmap.put("job", jobService.selectJobById(jobId));
model.addAttribute("job", job);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@Log(title = "定时任务", action = BusinessType.SAVE) @Log(title = "定时任务", action = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:save") @RequiresPermissions("monitor:job:edit")
@PostMapping("/save") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult save(Job job) public AjaxResult editSave(Job job)
{ {
if (jobService.saveJobCron(job) > 0) return toAjax(jobService.updateJobCron(job));
{
return success();
}
return error();
} }
} }

View File

@ -71,15 +71,6 @@ public class JobLogController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
try return toAjax(jobLogService.deleteJobLogByIds(ids));
{
jobLogService.deleteJobLogByIds(ids);
return success();
}
catch (Exception e)
{
e.printStackTrace();
return error(e.getMessage());
}
} }
} }

View File

@ -81,7 +81,7 @@ public interface IJobService
* @param job * @param job
* @return * @return
*/ */
public int addJobCron(Job job); public int insertJobCron(Job job);
/** /**
* *
@ -91,11 +91,4 @@ public interface IJobService
*/ */
public int updateJobCron(Job job); public int updateJobCron(Job job);
/**
*
*
* @param job
* @return
*/
public int saveJobCron(Job job);
} }

View File

@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.job.mapper.JobLogMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("jobLogService") @Service
public class JobLogServiceImpl implements IJobLogService public class JobLogServiceImpl implements IJobLogService
{ {

View File

@ -1,17 +1,13 @@
package com.ruoyi.project.monitor.job.service; package com.ruoyi.project.monitor.job.service;
import java.util.List; import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.quartz.CronTrigger; import org.quartz.CronTrigger;
import org.quartz.Scheduler; import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.ScheduleConstants; import com.ruoyi.common.constant.ScheduleConstants;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.monitor.job.domain.Job; import com.ruoyi.project.monitor.job.domain.Job;
import com.ruoyi.project.monitor.job.mapper.JobMapper; import com.ruoyi.project.monitor.job.mapper.JobMapper;
@ -22,7 +18,7 @@ import com.ruoyi.project.monitor.job.util.ScheduleUtils;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("jobService") @Service
public class JobServiceImpl implements IJobService public class JobServiceImpl implements IJobService
{ {
@Autowired @Autowired
@ -184,7 +180,7 @@ public class JobServiceImpl implements IJobService
* @param job * @param job
*/ */
@Override @Override
public int addJobCron(Job job) public int insertJobCron(Job job)
{ {
job.setCreateBy(ShiroUtils.getLoginName()); job.setCreateBy(ShiroUtils.getLoginName());
job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
@ -204,6 +200,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public int updateJobCron(Job job) public int updateJobCron(Job job)
{ {
job.setUpdateBy(ShiroUtils.getLoginName());
int rows = jobMapper.updateJob(job); int rows = jobMapper.updateJob(job);
if (rows > 0) if (rows > 0)
{ {
@ -212,25 +209,4 @@ public class JobServiceImpl implements IJobService
return rows; 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;
}
} }

View File

@ -71,11 +71,6 @@ public class LogininforController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
int rows = logininforService.deleteLogininforByIds(ids); return toAjax(logininforService.deleteLogininforByIds(ids));
if (rows > 0)
{
return success();
}
return error();
} }
} }

View File

@ -14,7 +14,7 @@ public class Logininfor extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** ID */ /** ID */
@Excel(name = "序号") @Excel(name = "序号")
private Integer infoId; private Long infoId;
/** 用户账号 */ /** 用户账号 */
@Excel(name = "用户账号") @Excel(name = "用户账号")
private String loginName; private String loginName;
@ -40,12 +40,12 @@ public class Logininfor extends BaseEntity
@Excel(name = "访问时间") @Excel(name = "访问时间")
private Date loginTime; private Date loginTime;
public Integer getInfoId() public Long getInfoId()
{ {
return infoId; return infoId;
} }
public void setInfoId(Integer infoId) public void setInfoId(Long infoId)
{ {
this.infoId = infoId; this.infoId = infoId;
} }

View File

@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.logininfor.mapper.LogininforMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("logininforService") @Service
public class LogininforServiceImpl implements ILogininforService public class LogininforServiceImpl implements ILogininforService
{ {

View File

@ -15,7 +15,7 @@ import com.ruoyi.project.monitor.online.mapper.UserOnlineMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("userOnlineService") @Service
public class UserOnlineServiceImpl implements IUserOnlineService public class UserOnlineServiceImpl implements IUserOnlineService
{ {
@Autowired @Autowired

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -72,20 +72,14 @@ public class OperlogController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
int rows = operLogService.deleteOperLogByIds(ids); return toAjax(operLogService.deleteOperLogByIds(ids));
if (rows > 0)
{
return success();
}
return error();
} }
@RequiresPermissions("monitor:operlog:detail") @RequiresPermissions("monitor:operlog:detail")
@GetMapping("/detail/{operId}") @GetMapping("/detail/{operId}")
public String detail(@PathVariable("operId") Long deptId, Model model) public String detail(@PathVariable("operId") Long deptId, ModelMap mmap)
{ {
OperLog operLog = operLogService.selectOperLogById(deptId); mmap.put("operLog", operLogService.selectOperLogById(deptId));
model.addAttribute("operLog", operLog);
return prefix + "/detail"; return prefix + "/detail";
} }
} }

View File

@ -16,7 +16,7 @@ public class OperLog extends BaseEntity
/** 日志主键 */ /** 日志主键 */
@Excel(name = "操作序号") @Excel(name = "操作序号")
private Integer operId; private Long operId;
/** 操作模块 */ /** 操作模块 */
@Excel(name = "操作模块") @Excel(name = "操作模块")
@ -70,12 +70,12 @@ public class OperLog extends BaseEntity
@Excel(name = "操作时间") @Excel(name = "操作时间")
private Date operTime; private Date operTime;
public Integer getOperId() public Long getOperId()
{ {
return operId; return operId;
} }
public void setOperId(Integer operId) public void setOperId(Long operId)
{ {
this.operId = operId; this.operId = operId;
} }

View File

@ -12,7 +12,7 @@ import com.ruoyi.project.monitor.operlog.mapper.OperLogMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("operLogService") @Service
public class OperLogServiceImpl implements IOperLogService public class OperLogServiceImpl implements IOperLogService
{ {
@Autowired @Autowired

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -35,7 +35,7 @@ public class ConfigController extends BaseController
@RequiresPermissions("system:config:view") @RequiresPermissions("system:config:view")
@GetMapping() @GetMapping()
public String index() public String config()
{ {
return prefix + "/config"; return prefix + "/config";
} }
@ -53,7 +53,6 @@ public class ConfigController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@Log(title = "参数管理", action = BusinessType.EXPORT) @Log(title = "参数管理", action = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
@ -74,41 +73,44 @@ public class ConfigController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", action = BusinessType.INSERT)
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
return prefix + "/add"; return prefix + "/add";
} }
/**
*
*/
@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}") @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); mmap.addAttribute("config", configService.selectConfigById(configId));
model.addAttribute("config", config);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@RequiresPermissions("system:config:save") @RequiresPermissions("system:config:edit")
@Log(title = "参数管理", action = BusinessType.SAVE) @Log(title = "参数管理", action = BusinessType.UPDATE)
@PostMapping("/save") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult save(Config config) public AjaxResult editSave(Config config)
{ {
if (configService.saveConfig(config) > 0) return toAjax(configService.updateConfig(config));
{
return success();
}
return error();
} }
/** /**
@ -120,11 +122,7 @@ public class ConfigController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
if (configService.deleteConfigByIds(ids) > 0) return toAjax(configService.deleteConfigByIds(ids));
{
return success();
}
return error();
} }
/** /**

View File

@ -14,7 +14,7 @@ public class Config extends BaseEntity
/** 参数主键 */ /** 参数主键 */
@Excel(name = "参数主键") @Excel(name = "参数主键")
private Integer configId; private Long configId;
/** 参数名称 */ /** 参数名称 */
@Excel(name = "参数名称") @Excel(name = "参数名称")
@ -32,12 +32,12 @@ public class Config extends BaseEntity
@Excel(name = "系统内置") @Excel(name = "系统内置")
private String configType; private String configType;
public Integer getConfigId() public Long getConfigId()
{ {
return configId; return configId;
} }
public void setConfigId(Integer configId) public void setConfigId(Long configId)
{ {
this.configId = configId; this.configId = configId;
} }

View File

@ -10,22 +10,13 @@ import java.util.List;
*/ */
public interface ConfigMapper public interface ConfigMapper
{ {
/** /**
* *
* *
* @param configId ID * @param configId
* @return * @return
*/ */
public Config selectConfigById(Integer configId); public Config selectConfig(Config config);
/**
*
*
* @param configKey
* @return
*/
public Config selectConfigByKey(String configKey);
/** /**
* *
@ -35,6 +26,14 @@ public interface ConfigMapper
*/ */
public List<Config> selectConfigList(Config config); public List<Config> selectConfigList(Config config);
/**
*
*
* @param configKey
* @return
*/
public Config checkConfigKeyUnique(String configKey);
/** /**
* *
* *
@ -51,14 +50,6 @@ public interface ConfigMapper
*/ */
public int updateConfig(Config config); public int updateConfig(Config config);
/**
*
*
* @param configId ID
* @return
*/
public int deleteConfigById(Integer configId);
/** /**
* *
* *

View File

@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils; 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.domain.Config;
import com.ruoyi.project.system.config.mapper.ConfigMapper; import com.ruoyi.project.system.config.mapper.ConfigMapper;
@ -27,9 +28,11 @@ public class ConfigServiceImpl implements IConfigService
* @return * @return
*/ */
@Override @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 @Override
public String selectConfigByKey(String configKey) public String selectConfigByKey(String configKey)
{ {
Config config = configMapper.selectConfigByKey(configKey); Config config = new Config();
return StringUtils.isNotNull(config) ? config.getConfigValue() : ""; config.setConfigKey(configKey);
Config retConfig = configMapper.selectConfig(config);
return StringUtils.isNotNull(retConfig) ? retConfig.getConfigValue() : "";
} }
/** /**
@ -66,6 +71,7 @@ public class ConfigServiceImpl implements IConfigService
@Override @Override
public int insertConfig(Config config) public int insertConfig(Config config)
{ {
config.setCreateBy(ShiroUtils.getLoginName());
return configMapper.insertConfig(config); return configMapper.insertConfig(config);
} }
@ -78,43 +84,10 @@ public class ConfigServiceImpl implements IConfigService
@Override @Override
public int updateConfig(Config config) public int updateConfig(Config config)
{ {
config.setUpdateBy(ShiroUtils.getLoginName());
return configMapper.updateConfig(config); 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);
}
/** /**
* *
* *
@ -136,14 +109,9 @@ public class ConfigServiceImpl implements IConfigService
@Override @Override
public String checkConfigKeyUnique(Config config) public String checkConfigKeyUnique(Config config)
{ {
if (config.getConfigId() == null) Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
{ Config info = configMapper.checkConfigKeyUnique(config.getConfigKey());
config.setConfigId(-1); if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
}
Integer configId = config.getConfigId();
Config info = configMapper.selectConfigByKey(config.getConfigKey());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getConfigId())
&& info.getConfigId().intValue() != configId.intValue())
{ {
return UserConstants.CONFIG_KEY_NOT_UNIQUE; return UserConstants.CONFIG_KEY_NOT_UNIQUE;
} }

View File

@ -17,7 +17,7 @@ public interface IConfigService
* @param configId ID * @param configId ID
* @return * @return
*/ */
public Config selectConfigById(Integer configId); public Config selectConfigById(Long configId);
/** /**
* *
@ -51,22 +51,6 @@ public interface IConfigService
*/ */
public int updateConfig(Config config); public int updateConfig(Config config);
/**
*
*
* @param config
* @return
*/
public int saveConfig(Config config);
/**
*
*
* @param configId ID
* @return
*/
public int deleteConfigById(Integer configId);
/** /**
* *
* *

View File

@ -5,7 +5,7 @@ import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -49,45 +49,47 @@ public class DeptController extends BaseController
} }
/** /**
* *
*/ */
@Log(title = "部门管理", action = BusinessType.UPDATE) @GetMapping("/add/{parentId}")
@RequiresPermissions("system:dept:edit") public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
@GetMapping("/edit/{deptId}")
public String edit(@PathVariable("deptId") Long deptId, Model model)
{ {
Dept dept = deptService.selectDeptById(deptId); mmap.put("dept", deptService.selectDeptById(parentId));
model.addAttribute("dept", dept); return prefix + "/add";
return prefix + "/edit";
} }
/** /**
* *
*/ */
@Log(title = "部门管理", action = BusinessType.INSERT) @Log(title = "部门管理", action = BusinessType.INSERT)
@RequiresPermissions("system:dept:add") @RequiresPermissions("system:dept:add")
@GetMapping("/add/{parentId}") @PostMapping("/add")
public String add(@PathVariable("parentId") Long parentId, Model model) @ResponseBody
public AjaxResult addSave(Dept dept)
{ {
Dept dept = deptService.selectDeptById(parentId); return toAjax(deptService.insertDept(dept));
model.addAttribute("dept", dept); }
return prefix + "/add";
/**
*
*/
@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.SAVE) @Log(title = "部门管理", action = BusinessType.UPDATE)
@RequiresPermissions("system:dept:save") @RequiresPermissions("system:dept:edit")
@PostMapping("/save") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult save(Dept dept) public AjaxResult editSave(Dept dept)
{ {
if (deptService.saveDept(dept) > 0) return toAjax(deptService.updateDept(dept));
{
return success();
}
return error();
} }
/** /**
@ -107,11 +109,7 @@ public class DeptController extends BaseController
{ {
return error(1, "部门存在用户,不允许删除"); return error(1, "部门存在用户,不允许删除");
} }
if (deptService.deleteDeptById(deptId) > 0) return toAjax(deptService.deleteDeptById(deptId));
{
return success();
}
return error();
} }
/** /**
@ -133,9 +131,9 @@ public class DeptController extends BaseController
* *
*/ */
@GetMapping("/selectDeptTree/{deptId}") @GetMapping("/selectDeptTree/{deptId}")
public String selectDeptTree(@PathVariable("deptId") Long deptId, Model model) public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
{ {
model.addAttribute("treeName", deptService.selectDeptById(deptId).getDeptName()); mmap.put("treeName", deptService.selectDeptById(deptId).getDeptName());
return prefix + "/tree"; return prefix + "/tree";
} }

View File

@ -5,7 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; 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.constant.UserConstants;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
@ -17,7 +17,7 @@ import com.ruoyi.project.system.dept.mapper.DeptMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Repository("deptService") @Service
public class DeptServiceImpl implements IDeptService public class DeptServiceImpl implements IDeptService
{ {
@Autowired @Autowired
@ -111,24 +111,29 @@ public class DeptServiceImpl implements IDeptService
} }
/** /**
* *
* *
* @param dept * @param dept
* @return * @return
*/ */
@Override @Override
public int saveDept(Dept dept) public int insertDept(Dept dept)
{
if (StringUtils.isNotNull(dept.getDeptId()))
{
dept.setUpdateBy(ShiroUtils.getLoginName());
return deptMapper.updateDept(dept);
}
else
{ {
dept.setCreateBy(ShiroUtils.getLoginName()); dept.setCreateBy(ShiroUtils.getLoginName());
return deptMapper.insertDept(dept); 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 @Override
public String checkDeptNameUnique(Dept dept) public String checkDeptNameUnique(Dept dept)
{ {
if (dept.getDeptId() == null) Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
{
dept.setDeptId(-1L);
}
Long deptId = dept.getDeptId();
Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName()); Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getDeptId()) if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
&& info.getDeptId().longValue() != deptId.longValue())
{ {
return UserConstants.DEPT_NAME_NOT_UNIQUE; return UserConstants.DEPT_NAME_NOT_UNIQUE;
} }

View File

@ -58,12 +58,20 @@ public interface IDeptService
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
/** /**
* *
* *
* @param dept * @param dept
* @return * @return
*/ */
public int saveDept(Dept dept); public int insertDept(Dept dept);
/**
*
*
* @param dept
* @return
*/
public int updateDept(Dept dept);
/** /**
* ID * ID

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -67,45 +67,48 @@ 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)
{
DictData dict = dictDataService.selectDictDataById(dictCode);
model.addAttribute("dict", dict);
return prefix + "/edit";
}
/** /**
* *
*/ */
@Log(title = "字典数据", action = BusinessType.INSERT)
@RequiresPermissions("system:dict:add")
@GetMapping("/add/{dictType}") @GetMapping("/add/{dictType}")
public String add(@PathVariable("dictType") String dictType, Model model) public String add(@PathVariable("dictType") String dictType, ModelMap mmap)
{ {
model.addAttribute("dictType", dictType); mmap.put("dictType", dictType);
return prefix + "/add"; return prefix + "/add";
} }
/** /**
* *
*/ */
@Log(title = "字典数据", action = BusinessType.SAVE) @Log(title = "字典数据", action = BusinessType.INSERT)
@RequiresPermissions("system:dict:save") @RequiresPermissions("system:dict:add")
@PostMapping("/save") @PostMapping("/add")
@ResponseBody @ResponseBody
public AjaxResult save(DictData dict) public AjaxResult addSave(DictData dict)
{ {
if (dictDataService.saveDictData(dict) > 0) return toAjax(dictDataService.insertDictData(dict));
{
return success();
} }
return error();
/**
*
*/
@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.UPDATE)
@RequiresPermissions("system:dict:edit")
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(DictData dict)
{
return toAjax(dictDataService.updateDictData(dict));
} }
@Log(title = "字典数据", action = BusinessType.DELETE) @Log(title = "字典数据", action = BusinessType.DELETE)
@ -114,11 +117,6 @@ public class DictDataController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
int rows = dictDataService.deleteDictDataByIds(ids); return toAjax(dictDataService.deleteDictDataByIds(ids));
if (rows > 0)
{
return success();
}
return error();
} }
} }

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -67,24 +67,9 @@ 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)
{
DictType dict = dictTypeService.selectDictTypeById(dictId);
model.addAttribute("dict", dict);
return prefix + "/edit";
}
/** /**
* *
*/ */
@Log(title = "字典类型", action = BusinessType.INSERT)
@RequiresPermissions("system:dict:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
@ -92,19 +77,37 @@ public class DictTypeController extends BaseController
} }
/** /**
* *
*/ */
@Log(title = "字典类型", action = BusinessType.SAVE) @Log(title = "字典类型", action = BusinessType.INSERT)
@RequiresPermissions("system:dict:save") @RequiresPermissions("system:dict:add")
@PostMapping("/save") @PostMapping("/add")
@ResponseBody @ResponseBody
public AjaxResult save(DictType dict) public AjaxResult addSave(DictType dict)
{ {
if (dictTypeService.saveDictType(dict) > 0) return toAjax(dictTypeService.insertDictType(dict));
{
return success();
} }
return error();
/**
*
*/
@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 editSave(DictType dict)
{
return toAjax(dictTypeService.updateDictType(dict));
} }
@Log(title = "字典类型", action = BusinessType.DELETE) @Log(title = "字典类型", action = BusinessType.DELETE)
@ -115,8 +118,7 @@ public class DictTypeController extends BaseController
{ {
try try
{ {
dictTypeService.deleteDictTypeByIds(ids); return toAjax(dictTypeService.deleteDictTypeByIds(ids));
return success();
} }
catch (Exception e) catch (Exception e)
{ {
@ -129,12 +131,10 @@ public class DictTypeController extends BaseController
*/ */
@RequiresPermissions("system:dict:list") @RequiresPermissions("system:dict:list")
@GetMapping("/detail/{dictId}") @GetMapping("/detail/{dictId}")
public String detail(@PathVariable("dictId") Long dictId, Model model) public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap)
{ {
DictType dict = dictTypeService.selectDictTypeById(dictId); mmap.put("dict", dictTypeService.selectDictTypeById(dictId));
List<DictType> dictTypeList = dictTypeService.selectDictTypeAll(); mmap.put("dictList", dictTypeService.selectDictTypeAll());
model.addAttribute("dict", dict);
model.addAttribute("dictList", dictTypeList);
return "system/dict/data/data"; return "system/dict/data/data";
} }

View File

@ -36,6 +36,9 @@ public class DictData extends BaseEntity
@Excel(name = "字典样式") @Excel(name = "字典样式")
private String cssClass; private String cssClass;
/** 表格字典样式 */
private String listClass;
/** 是否默认Y是 N否 */ /** 是否默认Y是 N否 */
@Excel(name = "是否默认") @Excel(name = "是否默认")
private String isDefault; private String isDefault;
@ -104,6 +107,16 @@ public class DictData extends BaseEntity
this.cssClass = cssClass; this.cssClass = cssClass;
} }
public String getListClass()
{
return listClass;
}
public void setListClass(String listClass)
{
this.listClass = listClass;
}
public String getIsDefault() public String getIsDefault()
{ {
return isDefault; return isDefault;

View File

@ -1,6 +1,9 @@
package com.ruoyi.project.system.dict.mapper; package com.ruoyi.project.system.dict.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.project.system.dict.domain.DictData; import com.ruoyi.project.system.dict.domain.DictData;
/** /**
@ -27,6 +30,15 @@ public interface DictDataMapper
*/ */
public List<DictData> selectDictDataByType(String dictType); public List<DictData> selectDictDataByType(String dictType);
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
/** /**
* ID * ID
* *

View File

@ -4,7 +4,6 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.dict.domain.DictData; import com.ruoyi.project.system.dict.domain.DictData;
import com.ruoyi.project.system.dict.mapper.DictDataMapper; import com.ruoyi.project.system.dict.mapper.DictDataMapper;
@ -14,7 +13,7 @@ import com.ruoyi.project.system.dict.mapper.DictDataMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("dictDataService") @Service
public class DictDataServiceImpl implements IDictDataService public class DictDataServiceImpl implements IDictDataService
{ {
@Autowired @Autowired
@ -44,6 +43,18 @@ public class DictDataServiceImpl implements IDictDataService
return dictDataMapper.selectDictDataByType(dictType); return dictDataMapper.selectDictDataByType(dictType);
} }
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String selectDictLabel(String dictType, String dictValue)
{
return dictDataMapper.selectDictLabel(dictType, dictValue);
}
/** /**
* ID * ID
* *
@ -81,25 +92,29 @@ public class DictDataServiceImpl implements IDictDataService
} }
/** /**
* *
* *
* @param dictData * @param dictData
* @return * @return
*/ */
@Override @Override
public int saveDictData(DictData dictData) public int insertDictData(DictData dictData)
{
Long dictCode = dictData.getDictCode();
if (StringUtils.isNotNull(dictCode))
{
dictData.setUpdateBy(ShiroUtils.getLoginName());
return dictDataMapper.updateDictData(dictData);
}
else
{ {
dictData.setCreateBy(ShiroUtils.getLoginName()); dictData.setCreateBy(ShiroUtils.getLoginName());
return dictDataMapper.insertDictData(dictData); return dictDataMapper.insertDictData(dictData);
} }
/**
*
*
* @param dictData
* @return
*/
@Override
public int updateDictData(DictData dictData)
{
dictData.setUpdateBy(ShiroUtils.getLoginName());
return dictDataMapper.updateDictData(dictData);
} }
} }

View File

@ -16,7 +16,7 @@ import com.ruoyi.project.system.dict.mapper.DictTypeMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("dictTypeService") @Service
public class DictTypeServiceImpl implements IDictTypeService public class DictTypeServiceImpl implements IDictTypeService
{ {
@Autowired @Autowired
@ -95,25 +95,29 @@ public class DictTypeServiceImpl implements IDictTypeService
} }
/** /**
* *
* *
* @param dictType * @param dictType
* @return * @return
*/ */
@Override @Override
public int saveDictType(DictType dictType) public int insertDictType(DictType dictType)
{
Long dictId = dictType.getDictId();
if (StringUtils.isNotNull(dictId))
{
dictType.setUpdateBy(ShiroUtils.getLoginName());
return dictTypeMapper.updateDictType(dictType);
}
else
{ {
dictType.setCreateBy(ShiroUtils.getLoginName()); dictType.setCreateBy(ShiroUtils.getLoginName());
return dictTypeMapper.insertDictType(dictType); 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 @Override
public String checkDictTypeUnique(DictType dict) public String checkDictTypeUnique(DictType dict)
{ {
if (dict.getDictId() == null) Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
{
dict.setDictId(-1L);
}
Long dictId = dict.getDictId();
DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId() != dictId) if (StringUtils.isNotNull(dictType) && dictType.getDictId() != dictId)
{ {

View File

@ -27,6 +27,15 @@ public interface IDictDataService
*/ */
public List<DictData> selectDictDataByType(String dictType); public List<DictData> selectDictDataByType(String dictType);
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String selectDictLabel(String dictType, String dictValue);
/** /**
* ID * ID
* *
@ -52,11 +61,19 @@ public interface IDictDataService
public int deleteDictDataByIds(String ids); public int deleteDictDataByIds(String ids);
/** /**
* *
* *
* @param dictData * @param dictData
* @return * @return
*/ */
public int saveDictData(DictData dictData); public int insertDictData(DictData dictData);
/**
*
*
* @param dictData
* @return
*/
public int updateDictData(DictData dictData);
} }

View File

@ -41,7 +41,6 @@ public interface IDictTypeService
*/ */
public int deleteDictTypeById(Long dictId); public int deleteDictTypeById(Long dictId);
/** /**
* *
* *
@ -51,12 +50,20 @@ public interface IDictTypeService
public int deleteDictTypeByIds(String ids) throws Exception; public int deleteDictTypeByIds(String ids) throws Exception;
/** /**
* *
* *
* @param dictType * @param dictType
* @return * @return
*/ */
public int saveDictType(DictType dictType); public int insertDictType(DictType dictType);
/**
*
*
* @param dictType
* @return
*/
public int updateDictType(DictType dictType);
/** /**
* *

View File

@ -5,7 +5,7 @@ import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -67,33 +67,14 @@ public class MenuController extends BaseController
{ {
return error(1, "菜单已分配,不允许删除"); return error(1, "菜单已分配,不允许删除");
} }
if (menuService.deleteMenuById(menuId) > 0) return toAjax(menuService.deleteMenuById(menuId));
{
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";
} }
/** /**
* *
*/ */
@Log(title = "菜单管理", action = BusinessType.INSERT)
@RequiresPermissions("system:menu:add")
@GetMapping("/add/{parentId}") @GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") Long parentId, Model model) public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
{ {
Menu menu = null; Menu menu = null;
if (0L != parentId) if (0L != parentId)
@ -106,24 +87,42 @@ public class MenuController extends BaseController
menu.setMenuId(0L); menu.setMenuId(0L);
menu.setMenuName("主目录"); menu.setMenuName("主目录");
} }
model.addAttribute("menu", menu); mmap.put("menu", menu);
return prefix + "/add"; return prefix + "/add";
} }
/** /**
* *
*/ */
@Log(title = "菜单管理", action = BusinessType.SAVE) @Log(title = "菜单管理", action = BusinessType.INSERT)
@RequiresPermissions("system:menu:save") @RequiresPermissions("system:menu:add")
@PostMapping("/save") @PostMapping("/add")
@ResponseBody @ResponseBody
public AjaxResult save(Menu menu) public AjaxResult addSave(Menu menu)
{ {
if (menuService.saveMenu(menu) > 0) return toAjax(menuService.insertMenu(menu));
{
return success();
} }
return error();
/**
*
*/
@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}") @GetMapping("/selectMenuTree/{menuId}")
public String selectMenuTree(@PathVariable("menuId") Long menuId, Model model) public String selectMenuTree(@PathVariable("menuId") Long menuId, ModelMap mmap)
{ {
model.addAttribute("treeName", menuService.selectMenuById(menuId).getMenuName()); mmap.put("treeName", menuService.selectMenuById(menuId).getMenuName());
return prefix + "/tree"; return prefix + "/tree";
} }
} }

View File

@ -100,12 +100,20 @@ public interface IMenuService
public int selectCountRoleMenuByMenuId(Long menuId); public int selectCountRoleMenuByMenuId(Long menuId);
/** /**
* *
* *
* @param menu * @param menu
* @return * @return
*/ */
public int saveMenu(Menu menu); public int insertMenu(Menu menu);
/**
*
*
* @param menu
* @return
*/
public int updateMenu(Menu menu);
/** /**
* *

View File

@ -25,7 +25,7 @@ import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("menuService") @Service
public class MenuServiceImpl implements IMenuService public class MenuServiceImpl implements IMenuService
{ {
public static final String PREMISSION_STRING = "perms[\"{0}\"]"; public static final String PREMISSION_STRING = "perms[\"{0}\"]";
@ -245,27 +245,31 @@ public class MenuServiceImpl implements IMenuService
} }
/** /**
* *
* *
* @param menu * @param menu
* @return * @return
*/ */
@Override @Override
public int saveMenu(Menu menu) public int insertMenu(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()); menu.setCreateBy(ShiroUtils.getLoginName());
ShiroUtils.clearCachedAuthorizationInfo(); ShiroUtils.clearCachedAuthorizationInfo();
return menuMapper.insertMenu(menu); 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 @Override
public String checkMenuNameUnique(Menu menu) public String checkMenuNameUnique(Menu menu)
{ {
if (menu.getMenuId() == null) Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
{
menu.setMenuId(-1L);
}
Long menuId = menu.getMenuId();
Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName()); Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getMenuId()) if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
&& info.getMenuId().longValue() != menuId.longValue())
{ {
return UserConstants.MENU_NAME_NOT_UNIQUE; return UserConstants.MENU_NAME_NOT_UNIQUE;
} }

View File

@ -4,19 +4,19 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; 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.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType; import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.web.controller.BaseController; 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.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,41 +55,44 @@ public class NoticeController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:notice:add")
@Log(title = "通知公告", action = BusinessType.INSERT)
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
return prefix + "/add"; return prefix + "/add";
} }
/**
*
*/
@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}") @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); mmap.put("notice", noticeService.selectNoticeById(noticeId));
model.addAttribute("notice", notice);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@RequiresPermissions("system:notice:save") @RequiresPermissions("system:notice:edit")
@Log(title = "通知公告", action = BusinessType.SAVE) @Log(title = "通知公告", action = BusinessType.UPDATE)
@PostMapping("/save") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult save(Notice notice) public AjaxResult editSave(Notice notice)
{ {
if (noticeService.saveNotice(notice) > 0) return toAjax(noticeService.updateNotice(notice));
{
return success();
}
return error();
} }
/** /**
@ -101,12 +104,7 @@ public class NoticeController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{ {
int rows = noticeService.deleteNoticeByIds(ids); return toAjax(noticeService.deleteNoticeByIds(ids));
if (rows > 0)
{
return success();
}
return error();
} }
} }

View File

@ -12,7 +12,7 @@ public class Notice extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 公告ID */ /** 公告ID */
private Integer noticeId; private Long noticeId;
/** 公告标题 */ /** 公告标题 */
private String noticeTitle; private String noticeTitle;
/** 公告类型1通知 2公告 */ /** 公告类型1通知 2公告 */
@ -22,16 +22,16 @@ public class Notice extends BaseEntity
/** 公告状态0正常 1关闭 */ /** 公告状态0正常 1关闭 */
private String status; private String status;
public void setNoticeId(Integer noticeId) public Long getNoticeId()
{
this.noticeId = noticeId;
}
public Integer getNoticeId()
{ {
return noticeId; return noticeId;
} }
public void setNoticeId(Long noticeId)
{
this.noticeId = noticeId;
}
public void setNoticeTitle(String noticeTitle) public void setNoticeTitle(String noticeTitle)
{ {
this.noticeTitle = noticeTitle; this.noticeTitle = noticeTitle;

View File

@ -16,7 +16,7 @@ public interface NoticeMapper
* @param noticeId ID * @param noticeId ID
* @return * @return
*/ */
public Notice selectNoticeById(Integer noticeId); public Notice selectNoticeById(Long noticeId);
/** /**
* *

View File

@ -16,7 +16,7 @@ public interface INoticeService
* @param noticeId ID * @param noticeId ID
* @return * @return
*/ */
public Notice selectNoticeById(Integer noticeId); public Notice selectNoticeById(Long noticeId);
/** /**
* *
@ -42,14 +42,6 @@ public interface INoticeService
*/ */
public int updateNotice(Notice notice); public int updateNotice(Notice notice);
/**
*
*
* @param notice
* @return
*/
public int saveNotice(Notice notice);
/** /**
* *
* *

View File

@ -3,7 +3,6 @@ package com.ruoyi.project.system.notice.service;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.notice.mapper.NoticeMapper; import com.ruoyi.project.system.notice.mapper.NoticeMapper;
import com.ruoyi.project.system.notice.domain.Notice; import com.ruoyi.project.system.notice.domain.Notice;
@ -29,7 +28,7 @@ public class NoticeServiceImpl implements INoticeService
* @return * @return
*/ */
@Override @Override
public Notice selectNoticeById(Integer noticeId) public Notice selectNoticeById(Long noticeId)
{ {
return noticeMapper.selectNoticeById(noticeId); return noticeMapper.selectNoticeById(noticeId);
} }
@ -55,6 +54,7 @@ public class NoticeServiceImpl implements INoticeService
@Override @Override
public int insertNotice(Notice notice) public int insertNotice(Notice notice)
{ {
notice.setCreateBy(ShiroUtils.getLoginName());
return noticeMapper.insertNotice(notice); return noticeMapper.insertNotice(notice);
} }
@ -66,34 +66,9 @@ public class NoticeServiceImpl implements INoticeService
*/ */
@Override @Override
public int updateNotice(Notice notice) public int updateNotice(Notice notice)
{
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()); notice.setUpdateBy(ShiroUtils.getLoginName());
// 修改公告 return noticeMapper.updateNotice(notice);
rows = noticeMapper.updateNotice(notice);
}
else
{
notice.setCreateBy(ShiroUtils.getLoginName());
// 新增公告
rows = noticeMapper.insertNotice(notice);
}
return rows;
} }
/** /**

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -75,8 +75,7 @@ public class PostController extends BaseController
{ {
try try
{ {
postService.deletePostByIds(ids); return toAjax(postService.deletePostByIds(ids));
return success();
} }
catch (Exception e) catch (Exception e)
{ {
@ -87,41 +86,44 @@ public class PostController extends BaseController
/** /**
* *
*/ */
@Log(title = "岗位管理", action = BusinessType.INSERT)
@RequiresPermissions("system:post:add")
@GetMapping("/add") @GetMapping("/add")
public String add(Model model) public String add()
{ {
return prefix + "/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}") @GetMapping("/edit/{postId}")
public String edit(@PathVariable("postId") Long postId, Model model) public String edit(@PathVariable("postId") Long postId, ModelMap mmap)
{ {
Post post = postService.selectPostById(postId); mmap.put("post", postService.selectPostById(postId));
model.addAttribute("post", post);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@Log(title = "岗位管理", action = BusinessType.SAVE) @RequiresPermissions("system:post:edit")
@RequiresPermissions("system:post:save") @Log(title = "岗位管理", action = BusinessType.UPDATE)
@PostMapping("/save") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult save(Post post) public AjaxResult editSave(Post post)
{ {
if (postService.savePost(post) > 0) return toAjax(postService.updatePost(post));
{
return success();
}
return error();
} }
} }

View File

@ -42,14 +42,6 @@ public interface PostMapper
*/ */
public Post selectPostById(Long postId); public Post selectPostById(Long postId);
/**
* ID
*
* @param postId ID
* @return
*/
public int deletePostById(Long postId);
/** /**
* *
* *

View File

@ -41,28 +41,28 @@ public interface IPostService
*/ */
public Post selectPostById(Long postId); public Post selectPostById(Long postId);
/**
* ID
*
* @param postId ID
* @return
*/
public boolean deletePostById(Long postId);
/** /**
* *
* *
* @param ids ID * @param ids ID
*/ */
public void deletePostByIds(String ids) throws Exception; public int deletePostByIds(String ids) throws Exception;
/** /**
* *
* *
* @param post * @param post
* @return * @return
*/ */
public int savePost(Post post); public int insertPost(Post post);
/**
*
*
* @param post
* @return
*/
public int updatePost(Post post);
/** /**
* ID使 * ID使

View File

@ -3,9 +3,7 @@ package com.ruoyi.project.system.post.service;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.domain.Post;
import com.ruoyi.project.system.post.mapper.PostMapper; import com.ruoyi.project.system.post.mapper.PostMapper;
@ -16,7 +14,7 @@ import com.ruoyi.project.system.user.mapper.UserPostMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("postService") @Service
public class PostServiceImpl implements IPostService public class PostServiceImpl implements IPostService
{ {
@Autowired @Autowired
@ -85,18 +83,6 @@ public class PostServiceImpl implements IPostService
return postMapper.selectPostById(postId); return postMapper.selectPostById(postId);
} }
/**
* ID
*
* @param postId ID
* @return
*/
@Override
public boolean deletePostById(Long postId)
{
return postMapper.deletePostById(postId) > 0 ? true : false;
}
/** /**
* *
* *
@ -104,7 +90,7 @@ public class PostServiceImpl implements IPostService
* @throws Exception * @throws Exception
*/ */
@Override @Override
public void deletePostByIds(String ids) throws Exception public int deletePostByIds(String ids) throws Exception
{ {
Long[] postIds = Convert.toLongArray(ids); Long[] postIds = Convert.toLongArray(ids);
for (Long postId : postIds) for (Long postId : postIds)
@ -115,33 +101,33 @@ public class PostServiceImpl implements IPostService
throw new Exception(String.format("%1$s已分配,不能删除", post.getPostName())); throw new Exception(String.format("%1$s已分配,不能删除", post.getPostName()));
} }
} }
postMapper.deletePostByIds(postIds); return postMapper.deletePostByIds(postIds);
} }
/** /**
* *
* *
* @param post * @param post
* @return * @return
*/ */
@Override @Override
public int savePost(Post post) public int insertPost(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()); post.setCreateBy(ShiroUtils.getLoginName());
// 新增岗位信息 return postMapper.insertPost(post);
count = postMapper.insertPost(post);
} }
return count;
/**
*
*
* @param post
* @return
*/
@Override
public int updatePost(Post post)
{
post.setUpdateBy(ShiroUtils.getLoginName());
return postMapper.updatePost(post);
} }
/** /**

View File

@ -5,7 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; 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") @GetMapping("/add")
public String add(Model model) public String add()
{ {
return prefix + "/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}") @GetMapping("/edit/{roleId}")
public String edit(@PathVariable("roleId") Long roleId, Model model) public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
{ {
Role role = roleService.selectRoleById(roleId); mmap.put("role", roleService.selectRoleById(roleId));
model.addAttribute("role", role);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@RequiresPermissions("system:role:save") @RequiresPermissions("system:role:edit")
@Log(title = "角色管理", action = BusinessType.SAVE) @Log(title = "角色管理", action = BusinessType.UPDATE)
@PostMapping("/save") @PostMapping("/edit")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ResponseBody @ResponseBody
public AjaxResult save(Role role) public AjaxResult editSave(Role role)
{ {
if (roleService.saveRole(role) > 0) return toAjax(roleService.updateRole(role));
{
return success();
}
return error();
} }
@RequiresPermissions("system:role:remove") @RequiresPermissions("system:role:remove")
@ -118,8 +123,7 @@ public class RoleController extends BaseController
{ {
try try
{ {
roleService.deleteRoleByIds(ids); return toAjax(roleService.deleteRoleByIds(ids));
return success();
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -64,15 +64,23 @@ public interface IRoleService
* *
* @param ids ID * @param ids ID
*/ */
public void deleteRoleByIds(String ids) throws Exception; public int deleteRoleByIds(String ids) throws Exception;
/** /**
* *
* *
* @param role * @param role
* @return * @return
*/ */
public int saveRole(Role role); public int insertRole(Role role);
/**
*
*
* @param role
* @return
*/
public int updateRole(Role role);
/** /**
* *

View File

@ -22,7 +22,7 @@ import com.ruoyi.project.system.user.mapper.UserRoleMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("roleService") @Service
public class RoleServiceImpl implements IRoleService public class RoleServiceImpl implements IRoleService
{ {
@ -135,7 +135,7 @@ public class RoleServiceImpl implements IRoleService
* @throws Exception * @throws Exception
*/ */
@Override @Override
public void deleteRoleByIds(String ids) throws Exception public int deleteRoleByIds(String ids) throws Exception
{ {
Long[] roleIds = Convert.toLongArray(ids); Long[] roleIds = Convert.toLongArray(ids);
for (Long roleId : roleIds) for (Long roleId : roleIds)
@ -146,33 +146,39 @@ public class RoleServiceImpl implements IRoleService
throw new Exception(String.format("%1$s已分配,不能删除", role.getRoleName())); throw new Exception(String.format("%1$s已分配,不能删除", role.getRoleName()));
} }
} }
roleMapper.deleteRoleByIds(roleIds); return roleMapper.deleteRoleByIds(roleIds);
} }
/** /**
* *
* *
* @param role * @param role
* @return * @return
*/ */
@Override @Override
public int saveRole(Role role) public int insertRole(Role role)
{ {
Long roleId = role.getRoleId(); role.setCreateBy(ShiroUtils.getLoginName());
if (StringUtils.isNotNull(roleId)) // 新增角色信息
roleMapper.insertRole(role);
ShiroUtils.clearCachedAuthorizationInfo();
return insertRoleMenu(role);
}
/**
*
*
* @param role
* @return
*/
@Override
public int updateRole(Role role)
{ {
role.setUpdateBy(ShiroUtils.getLoginName()); role.setUpdateBy(ShiroUtils.getLoginName());
// 修改角色信息 // 修改角色信息
roleMapper.updateRole(role); roleMapper.updateRole(role);
// 删除角色与菜单关联 // 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(roleId); roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
}
else
{
role.setCreateBy(ShiroUtils.getLoginName());
// 新增角色信息
roleMapper.insertRole(role);
}
ShiroUtils.clearCachedAuthorizationInfo(); ShiroUtils.clearCachedAuthorizationInfo();
return insertRoleMenu(role); return insertRoleMenu(role);
} }
@ -210,13 +216,9 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public String checkRoleNameUnique(Role role) public String checkRoleNameUnique(Role role)
{ {
if (role.getRoleId() == null) Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
{
role.setRoleId(-1L);
}
Long roleId = role.getRoleId();
Role info = roleMapper.checkRoleNameUnique(role.getRoleName()); 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; return UserConstants.ROLE_NAME_NOT_UNIQUE;
} }

View File

@ -3,7 +3,7 @@ package com.ruoyi.project.system.user.controller;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import com.ruoyi.framework.config.RuoYiConfig; import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.controller.BaseController;
@ -27,23 +27,23 @@ public class IndexController extends BaseController
// 系统首页 // 系统首页
@GetMapping("/index") @GetMapping("/index")
public String index(Model model) public String index(ModelMap mmap)
{ {
// 取身份信息 // 取身份信息
User user = getUser(); User user = getUser();
// 根据用户id取出菜单 // 根据用户id取出菜单
List<Menu> menus = menuService.selectMenusByUserId(user.getUserId()); List<Menu> menus = menuService.selectMenusByUserId(user.getUserId());
model.addAttribute("menus", menus); mmap.put("menus", menus);
model.addAttribute("user", user); mmap.put("user", user);
model.addAttribute("copyrightYear", ruoYiConfig.getCopyrightYear()); mmap.put("copyrightYear", ruoYiConfig.getCopyrightYear());
return "index"; return "index";
} }
// 系统介绍 // 系统介绍
@GetMapping("/system/main") @GetMapping("/system/main")
public String main(Model model) public String main(ModelMap mmap)
{ {
model.addAttribute("version", ruoYiConfig.getVersion()); mmap.put("version", ruoYiConfig.getVersion());
return "main"; return "main";
} }

View File

@ -7,7 +7,6 @@ import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
@ -26,7 +25,7 @@ public class LoginController extends BaseController
{ {
@GetMapping("/login") @GetMapping("/login")
public String login(HttpServletRequest request, HttpServletResponse response, Model model) public String login(HttpServletRequest request, HttpServletResponse response)
{ {
// 如果是Ajax请求返回Json字符串。 // 如果是Ajax请求返回Json字符串。
if (ServletUtils.isAjaxRequest((HttpServletRequest) request)) if (ServletUtils.isAjaxRequest((HttpServletRequest) request))

View File

@ -5,7 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; 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.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult; 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.domain.User;
import com.ruoyi.project.system.user.service.IUserService; import com.ruoyi.project.system.user.service.IUserService;
@ -37,27 +38,20 @@ public class ProfileController extends BaseController
@Autowired @Autowired
private IUserService userService; private IUserService userService;
@Autowired
private DictService dict;
/** /**
* *
*/ */
@GetMapping() @GetMapping()
public String profile(Model model) public String profile(ModelMap mmap)
{ {
User user = getUser(); User user = getUser();
String sex = user.getSex(); user.setSex(dict.getLabel("sys_user_sex", user.getSex()));
if ("0".equals(sex)) mmap.put("user", user);
{ mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
user.setSex("性别:男"); mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
}
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);
return prefix + "/profile"; return prefix + "/profile";
} }
@ -75,10 +69,9 @@ public class ProfileController extends BaseController
} }
@GetMapping("/resetPwd/{userId}") @GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, Model model) public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
{ {
User user = userService.selectUserById(userId); mmap.put("user", userService.selectUserById(userId));
model.addAttribute("user", user);
return prefix + "/resetPwd"; return prefix + "/resetPwd";
} }
@ -99,36 +92,32 @@ public class ProfileController extends BaseController
/** /**
* *
*/ */
@Log(title = "个人信息", action = BusinessType.UPDATE)
@GetMapping("/edit/{userId}") @GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, Model model) public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
{ {
User user = userService.selectUserById(userId); mmap.put("user", userService.selectUserById(userId));
model.addAttribute("user", user);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@Log(title = "个人信息", action = BusinessType.UPDATE)
@GetMapping("/avatar/{userId}") @GetMapping("/avatar/{userId}")
public String avatar(@PathVariable("userId") Long userId, Model model) public String avatar(@PathVariable("userId") Long userId, ModelMap mmap)
{ {
User user = userService.selectUserById(userId); mmap.put("user", userService.selectUserById(userId));
model.addAttribute("user", user);
return prefix + "/avatar"; return prefix + "/avatar";
} }
/** /**
* *
*/ */
@Log(title = "个人信息", action = BusinessType.SAVE) @Log(title = "个人信息", action = BusinessType.UPDATE)
@PostMapping("/update") @PostMapping("/update")
@ResponseBody @ResponseBody
public AjaxResult update(User user) public AjaxResult update(User user)
{ {
if (userService.updateUser(user) > 0) if (userService.updateUserInfo(user) > 0)
{ {
setUser(userService.selectUserById(user.getUserId())); setUser(userService.selectUserById(user.getUserId()));
return success(); return success();
@ -139,7 +128,7 @@ public class ProfileController extends BaseController
/** /**
* *
*/ */
@Log(title = "个人信息", action = BusinessType.SAVE) @Log(title = "个人信息", action = BusinessType.UPDATE)
@PostMapping("/updateAvatar") @PostMapping("/updateAvatar")
@ResponseBody @ResponseBody
public AjaxResult updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file) public AjaxResult updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file)
@ -150,7 +139,7 @@ public class ProfileController extends BaseController
{ {
String avatar = FileUploadUtils.upload(file); String avatar = FileUploadUtils.upload(file);
user.setAvatar(avatar); user.setAvatar(avatar);
if (userService.updateUser(user) > 0) if (userService.updateUserInfo(user) > 0)
{ {
setUser(userService.selectUserById(user.getUserId())); setUser(userService.selectUserById(user.getUserId()));
return success(); return success();

View File

@ -1,5 +1,16 @@
package com.ruoyi.project.system.user.controller; 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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log; 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.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo; 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.post.service.IPostService;
import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.role.service.IRoleService; import com.ruoyi.project.system.role.service.IRoleService;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
import com.ruoyi.project.system.user.service.IUserService; 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;
/** /**
* *
@ -75,60 +77,79 @@ 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}") @GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, Model model) public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
{ {
User user = userService.selectUserById(userId); mmap.put("user", userService.selectUserById(userId));
List<Role> roles = roleService.selectRolesByUserId(userId); mmap.put("roles", roleService.selectRolesByUserId(userId));
List<Post> posts = postService.selectPostsByUserId(userId); mmap.put("posts", postService.selectPostsByUserId(userId));
model.addAttribute("roles", roles);
model.addAttribute("posts", posts);
model.addAttribute("user", user);
return prefix + "/edit"; return prefix + "/edit";
} }
/** /**
* *
*/ */
@RequiresPermissions("system:user:add") @RequiresPermissions("system:user:edit")
@Log(title = "用户管理", action = BusinessType.INSERT) @Log(title = "用户管理", action = BusinessType.UPDATE)
@GetMapping("/add") @PostMapping("/edit")
public String add(Model model) @Transactional(rollbackFor = Exception.class)
@ResponseBody
public AjaxResult editSave(User user)
{ {
List<Role> roles = roleService.selectRoleAll(); if (StringUtils.isNotNull(user.getUserId()) && User.isAdmin(user.getUserId()))
List<Post> posts = postService.selectPostAll(); {
model.addAttribute("roles", roles); return error("不允许修改超级管理员用户");
model.addAttribute("posts", posts); }
return prefix + "/add"; return toAjax(userService.updateUser(user));
} }
@RequiresPermissions("system:user:resetPwd") @RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", action = BusinessType.UPDATE) @Log(title = "重置密码", action = BusinessType.UPDATE)
@GetMapping("/resetPwd/{userId}") @GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, Model model) public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
{ {
User user = userService.selectUserById(userId); mmap.put("user", userService.selectUserById(userId));
model.addAttribute("user", user);
return prefix + "/resetPwd"; return prefix + "/resetPwd";
} }
@RequiresPermissions("system:user:resetPwd") @RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", action = BusinessType.SAVE) @Log(title = "重置密码", action = BusinessType.UPDATE)
@PostMapping("/resetPwd") @PostMapping("/resetPwd")
@ResponseBody @ResponseBody
public AjaxResult resetPwd(User user) public AjaxResult resetPwd(User user)
{ {
int rows = userService.resetUserPwd(user); return toAjax(userService.resetUserPwd(user));
if (rows > 0)
{
return success();
}
return error();
} }
@RequiresPermissions("system:user:remove") @RequiresPermissions("system:user:remove")
@ -139,8 +160,7 @@ public class UserController extends BaseController
{ {
try try
{ {
userService.deleteUserByIds(ids); return toAjax(userService.deleteUserByIds(ids));
return success();
} }
catch (Exception e) catch (Exception e)
{ {
@ -148,23 +168,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();
}
/** /**
* *
*/ */

View File

@ -64,7 +64,7 @@ public interface IUserService
* *
* @param ids ID * @param ids ID
*/ */
public void deleteUserByIds(String ids) throws Exception; public int deleteUserByIds(String ids) throws Exception;
/** /**
* *
@ -72,16 +72,24 @@ public interface IUserService
* @param user * @param user
* @return * @return
*/ */
public int saveUser(User user); public int insertUser(User user);
/** /**
* *
* *
* @param user * @param user
* @return * @return
*/ */
public int updateUser(User user); public int updateUser(User user);
/**
*
*
* @param user
* @return
*/
public int updateUserInfo(User user);
/** /**
* *
* *

View File

@ -25,7 +25,7 @@ import com.ruoyi.project.system.user.mapper.UserRoleMapper;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("userService") @Service
public class UserServiceImpl implements IUserService public class UserServiceImpl implements IUserService
{ {
@Autowired @Autowired
@ -130,7 +130,7 @@ public class UserServiceImpl implements IUserService
* @return * @return
*/ */
@Override @Override
public void deleteUserByIds(String ids) throws Exception public int deleteUserByIds(String ids) throws Exception
{ {
Long[] userIds = Convert.toLongArray(ids); Long[] userIds = Convert.toLongArray(ids);
for (Long userId : userIds) for (Long userId : userIds)
@ -140,25 +140,41 @@ public class UserServiceImpl implements IUserService
throw new Exception("不允许删除超级管理员用户"); throw new Exception("不允许删除超级管理员用户");
} }
} }
userMapper.deleteUserByIds(userIds); return userMapper.deleteUserByIds(userIds);
} }
/** /**
* *
* *
* @param user * @param user
* @return * @return
*/ */
@Override @Override
public int saveUser(User user) public int insertUser(User user)
{
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
*/
@Override
public int updateUser(User user)
{ {
int count = 0;
Long userId = user.getUserId(); Long userId = user.getUserId();
if (StringUtils.isNotNull(userId))
{
user.setUpdateBy(ShiroUtils.getLoginName()); user.setUpdateBy(ShiroUtils.getLoginName());
// 修改用户信息
count = updateUser(user);
// 删除用户与角色关联 // 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId); userRoleMapper.deleteUserRoleByUserId(userId);
// 新增用户与角色管理 // 新增用户与角色管理
@ -167,31 +183,17 @@ public class UserServiceImpl implements IUserService
userPostMapper.deleteUserPostByUserId(userId); userPostMapper.deleteUserPostByUserId(userId);
// 新增用户与岗位管理 // 新增用户与岗位管理
insertUserPost(user); insertUserPost(user);
return userMapper.updateUser(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;
} }
/** /**
* *
* *
* @param user * @param user
* @return * @return
*/ */
@Override @Override
public int updateUser(User user) public int updateUserInfo(User user)
{ {
return userMapper.updateUser(user); return userMapper.updateUser(user);
} }
@ -280,14 +282,9 @@ public class UserServiceImpl implements IUserService
@Override @Override
public String checkPhoneUnique(User user) public String checkPhoneUnique(User user)
{ {
if (user.getUserId() == null) Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
{
user.setUserId(-1L);
}
Long userId = user.getUserId();
User info = userMapper.checkPhoneUnique(user.getPhonenumber()); User info = userMapper.checkPhoneUnique(user.getPhonenumber());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getUserId()) if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
&& info.getUserId().longValue() != userId.longValue())
{ {
return UserConstants.USER_PHONE_NOT_UNIQUE; return UserConstants.USER_PHONE_NOT_UNIQUE;
} }
@ -303,14 +300,9 @@ public class UserServiceImpl implements IUserService
@Override @Override
public String checkEmailUnique(User user) public String checkEmailUnique(User user)
{ {
if (user.getUserId() == null) Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
{
user.setUserId(-1L);
}
Long userId = user.getUserId();
User info = userMapper.checkEmailUnique(user.getEmail()); User info = userMapper.checkEmailUnique(user.getEmail());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getUserId()) if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
&& info.getUserId().longValue() != userId.longValue())
{ {
return UserConstants.USER_EMAIL_NOT_UNIQUE; return UserConstants.USER_EMAIL_NOT_UNIQUE;
} }

View File

@ -28,7 +28,7 @@ import com.ruoyi.project.tool.gen.util.VelocityInitializer;
* *
* @author ruoyi * @author ruoyi
*/ */
@Service("genService") @Service
public class GenServiceImpl implements IGenService public class GenServiceImpl implements IGenService
{ {
@Autowired @Autowired

View File

@ -1,7 +1,7 @@
# 项目名称、版本、版权年份 # 项目名称、版本、版权年份
ruoyi: ruoyi:
name: RuoYi name: RuoYi
version: 2.1.0 version: 2.2.0
copyrightYear: 2018 copyrightYear: 2018
profile: D:/profile/ profile: D:/profile/

View File

@ -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 select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
</sql> </sql>
<select id="selectConfigById" parameterType="Integer" resultMap="ConfigResult"> <!-- 查询条件 -->
<include refid="selectConfigVo"/> <sql id="sqlwhereSearch">
where config_id = #{configId} <where>
</select> <if test="configId !=null">
and config_id = #{configId}
</if>
<if test="configKey !=null and configKey != ''">
and config_key = #{configKey}
</if>
</where>
</sql>
<select id="selectConfigByKey" parameterType="String" resultMap="ConfigResult"> <select id="selectConfig" parameterType="Config" resultMap="ConfigResult">
<include refid="selectConfigVo"/> <include refid="selectConfigVo"/>
where config_key = #{configKey} <include refid="sqlwhereSearch"/>
</select> </select>
<select id="selectConfigList" parameterType="Config" resultMap="ConfigResult"> <select id="selectConfigList" parameterType="Config" resultMap="ConfigResult">
@ -51,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="checkConfigKeyUnique" parameterType="String" resultMap="ConfigResult">
<include refid="selectConfigVo"/>
where config_key = #{configKey}
</select>
<insert id="insertConfig" parameterType="Config"> <insert id="insertConfig" parameterType="Config">
insert into sys_config ( insert into sys_config (
<if test="configName != null and configName != '' ">config_name,</if> <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} where config_id = #{configId}
</update> </update>
<delete id="deleteConfigById" parameterType="Integer">
delete from sys_config where config_id = #{value}
</delete>
<delete id="deleteConfigByIds" parameterType="String"> <delete id="deleteConfigByIds" parameterType="String">
delete from sys_config where config_id in delete from sys_config where config_id in
<foreach item="configId" collection="array" open="(" separator="," close=")"> <foreach item="configId" collection="array" open="(" separator="," close=")">

View File

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dictValue" column="dict_value" /> <result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" /> <result property="dictType" column="dict_type" />
<result property="cssClass" column="css_class" /> <result property="cssClass" column="css_class" />
<result property="listClass" column="list_class" />
<result property="isDefault" column="is_default" /> <result property="isDefault" column="is_default" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictDataVo"> <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> </sql>
<select id="selectDictDataList" parameterType="DictData" resultMap="DictDataResult"> <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 where dict_type = #{dictType} order by dict_sort asc
</select> </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"> <select id="selectDictDataById" parameterType="Long" resultMap="DictDataResult">
<include refid="selectDictDataVo"/> <include refid="selectDictDataVo"/>
where dict_code = #{dictCode} 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="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="cssClass != null and cssClass != ''">css_class = #{cssClass},</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="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</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="dictValue != null and dictValue != ''">dict_value,</if>
<if test="dictType != null and dictType != ''">dict_type,</if> <if test="dictType != null and dictType != ''">dict_type,</if>
<if test="cssClass != null and cssClass != ''">css_class,</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="isDefault != null and isDefault != ''">is_default,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</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="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if> <if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="cssClass != null and cssClass != ''">#{cssClass},</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="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>

View File

@ -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 select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice
</sql> </sql>
<select id="selectNoticeById" parameterType="Integer" resultMap="NoticeResult"> <select id="selectNoticeById" parameterType="Long" resultMap="NoticeResult">
<include refid="selectNoticeVo"/> <include refid="selectNoticeVo"/>
where notice_id = #{noticeId} where notice_id = #{noticeId}
</select> </select>

View File

@ -53,10 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where post_id = #{postId} where post_id = #{postId}
</select> </select>
<delete id="deletePostById" parameterType="Long">
delete from sys_post where post_id = #{postId}
</delete>
<delete id="deletePostByIds" parameterType="Long"> <delete id="deletePostByIds" parameterType="Long">
delete from sys_post where post_id in delete from sys_post where post_id in
<foreach collection="array" item="postId" open="(" separator="," close=")"> <foreach collection="array" item="postId" open="(" separator="," close=")">

View File

@ -187,7 +187,6 @@ $(function() {
}); });
function menuItem() { function menuItem() {
$.modal.loading("数据加载中,请稍后...");
// 获取标识数据 // 获取标识数据
var dataUrl = $(this).attr('href'), var dataUrl = $(this).attr('href'),
dataIndex = $(this).data('index'), dataIndex = $(this).data('index'),
@ -222,11 +221,16 @@ $(function() {
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></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); $('.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); $('.menuTabs .page-tabs-content').append(str);
scrollToTab($('.menuTab.active')); scrollToTab($('.menuTab.active'));
} }
$.modal.closeLoading();
return false; return false;
} }

View File

@ -95,6 +95,17 @@
return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) { return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
return row[$.table._option.columns[1].field]; 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('');
} }
}, },
// 表格树封装处理 // 表格树封装处理

File diff suppressed because one or more lines are too long

View File

@ -40,8 +40,8 @@
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script> <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/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.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/common.js?v=2.2.0}"></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 src="http://tajs.qq.com/stats?sId=62048022"></script> <script src="http://tajs.qq.com/stats?sId=62048022"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; </script> <script th:inline="javascript"> var ctx = [[@{/}]]; </script>
</div> </div>

View File

@ -15,12 +15,12 @@
<link th:href="@{/css/font-awesome.css}" rel="stylesheet"/> <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet"/> <link th:href="@{/css/animate.css}" rel="stylesheet"/>
<link th:href="@{/css/style.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"> <style type="text/css">
.nav > li:hover .dropdown-menu {display: block;} .nav > li:hover .dropdown-menu {display: block;}
</style> </style>
</head> </head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden" th:classappend="${@configService.selectConfigByKey('sys.index.skinName')}"> <body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden" th:classappend="${@config.getKey('sys.index.skinName')}">
<div id="wrapper"> <div id="wrapper">
<!--左侧导航开始--> <!--左侧导航开始-->
@ -136,7 +136,7 @@
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script> <script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script> <script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="http://tajs.qq.com/stats?sId=62048022"></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="@{/ruoyi/index.js}"></script>
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script> <script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
</body> </body>

View File

@ -12,7 +12,7 @@
<link href="../static/css/style.css" th:href="@{css/style.css}" rel="stylesheet"/> <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/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/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]> <!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" /> <meta http-equiv="refresh" content="0;ie.html" />
<![endif]--> <![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/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="../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="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> <script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
</body> </body>
</html> </html>

View File

@ -97,10 +97,34 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h5 class="panel-title"> <h5 class="panel-title">
<a data-toggle="collapse" data-parent="#version" href="#v20">v2.1.0</a><code class="pull-right">2018.07.10</code> <a data-toggle="collapse" data-parent="#version" href="#v22">v2.2.0</a><code class="pull-right">2018.07.23</code>
</h5> </h5>
</div> </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"> <div class="panel-body">
<ol> <ol>
<li>新增登陆超时提醒</li> <li>新增登陆超时提醒</li>

View File

@ -46,7 +46,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -85,7 +85,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-job-add').serialize()); $.operate.save(prefix + "/add", $('#form-job-add').serialize());
} }
}); });
</script> </script>

View File

@ -47,7 +47,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -86,7 +86,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-job-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-job-edit').serialize());
} }
}); });
</script> </script>

View File

@ -18,7 +18,7 @@
方法名称:<input type="text" name="methodName"/> 方法名称:<input type="text" name="methodName"/>
</li> </li>
<li> <li>
任务状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_job_status')}"> 任务状态:<select name="status" th:with="type=${@dict.getType('sys_job_status')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -51,9 +51,10 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('monitor:job:edit')}]]; var editFlag = [[${@permission.hasPermi('monitor:job:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('monitor:job:remove')}]]; var removeFlag = [[${@permission.hasPermi('monitor:job:remove')}]];
var statusFlag = [[${@permissionService.hasPermi('monitor:job:changeStatus')}]]; var statusFlag = [[${@permission.hasPermi('monitor:job:changeStatus')}]];
var datas = [[${@dict.getType('sys_job_status')}]];
var prefix = ctx + "monitor/job" var prefix = ctx + "monitor/job"
$(function() { $(function() {
@ -102,11 +103,7 @@
title: '任务状态', title: '任务状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">暂停</span>';
}
} }
}, },
{ {

View File

@ -18,7 +18,7 @@
<label>方法名称:</label><input type="text" name="methodName"/> <label>方法名称:</label><input type="text" name="methodName"/>
</li> </li>
<li> <li>
<label>执行状态:</label><select name="status" th:with="type=${@dictService.selectDictData('sys_common_status')}"> <label>执行状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -51,7 +51,8 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <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" var prefix = ctx + "monitor/jobLog"
$(function() { $(function() {
@ -98,11 +99,7 @@
title: '状态', title: '状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">失败</span>';
}
} }
}, },
{ {

View File

@ -18,7 +18,7 @@
<label>登录名称:</label><input type="text" name="loginName"/> <label>登录名称:</label><input type="text" name="loginName"/>
</li> </li>
<li> <li>
<label>登录状态:</label><select name="status" th:with="type=${@dictService.selectDictData('sys_common_status')}"> <label>登录状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -51,7 +51,8 @@
</div> </div>
<div th:include="include :: footer"></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" var prefix = ctx + "monitor/logininfor"
$(function() { $(function() {
@ -96,11 +97,7 @@
title: '登录状态', title: '登录状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">成功</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">失败</span>';
}
} }
}, },
{ {

View File

@ -38,7 +38,7 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var forceFlag = [[${@permissionService.hasPermi('monitor:online:forceLogout')}]]; var forceFlag = [[${@permission.hasPermi('monitor:online:forceLogout')}]];
var prefix = ctx + "monitor/online" var prefix = ctx + "monitor/online"
$(function() { $(function() {

View File

@ -8,7 +8,7 @@
<form class="form-horizontal m-t" id="signupForm"> <form class="form-horizontal m-t" id="signupForm">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">操作模块:</label> <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> </div>
<div class="form-group"> <div class="form-group">

View File

@ -18,7 +18,7 @@
<label>操作人员: </label><input type="text" name="operName"/> <label>操作人员: </label><input type="text" name="operName"/>
</li> </li>
<li> <li>
<label>操作类型: </label><select name="action" th:with="type=${@dictService.selectDictData('sys_oper_type')}"> <label>操作类型: </label><select name="action" th:with="type=${@dict.getType('sys_oper_type')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -52,7 +52,8 @@
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <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" var prefix = ctx + "monitor/operlog"
$(function() { $(function() {
@ -80,27 +81,7 @@
title: '操作类型', title: '操作类型',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 1) { return $.table.selectDictLabel(datas, value);
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>';
}
} }
}, },
{ {

View File

@ -25,7 +25,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">系统内置:</label> <label class="col-sm-3 control-label">系统内置:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -82,7 +82,7 @@
} }
}, },
submitHandler: function(form) { submitHandler: function(form) {
$.operate.save(prefix + "/save", $('#form-config-add').serialize()); $.operate.save(prefix + "/add", $('#form-config-add').serialize());
} }
}); });
</script> </script>

View File

@ -17,7 +17,7 @@
参数键名:<input type="text" name="configKey"/> 参数键名:<input type="text" name="configKey"/>
</li> </li>
<li> <li>
系统内置:<select name="configType" th:with="type=${@dictService.selectDictData('sys_yes_no')}"> 系统内置:<select name="configType" th:with="type=${@dict.getType('sys_yes_no')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -52,8 +52,9 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:config:edit')}]]; var editFlag = [[${@permission.hasPermi('system:config:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:config:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:config:remove')}]];
var datas = [[${@dict.getType('sys_yes_no')}]];
var prefix = ctx + "system/config" var prefix = ctx + "system/config"
$(function() { $(function() {
@ -92,11 +93,7 @@
title: '系统内置', title: '系统内置',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 'Y') { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary"></span>';
} else if (value == 'N') {
return '<span class="badge badge-danger"></span>';
}
} }
}, },
{ {

View File

@ -26,7 +26,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">系统内置:</label> <label class="col-sm-3 control-label">系统内置:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -86,7 +86,7 @@
} }
}, },
submitHandler: function(form) { submitHandler: function(form) {
$.operate.save(prefix + "/save", $('#form-config-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-config-edit').serialize());
} }
}); });
</script> </script>

View File

@ -44,7 +44,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">部门状态:</label> <label class="col-sm-3 control-label">部门状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -94,7 +94,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dept-add').serialize()); $.operate.save(prefix + "/add", $('#form-dept-add').serialize());
} }
}); });

View File

@ -14,7 +14,7 @@
部门名称:<input type="text" name="deptName"/> 部门名称:<input type="text" name="deptName"/>
</li> </li>
<li> <li>
部门状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_normal_disable')}"> 部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -39,9 +39,10 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var addFlag = [[${@permissionService.hasPermi('system:dept:add')}]]; var addFlag = [[${@permission.hasPermi('system:dept:add')}]];
var editFlag = [[${@permissionService.hasPermi('system:dept:edit')}]]; var editFlag = [[${@permission.hasPermi('system:dept:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:dept:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:dept:remove')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/dept" var prefix = ctx + "system/dept"
window.onload = function() { window.onload = function() {
@ -71,11 +72,7 @@
title: '状态', title: '状态',
align: "center", align: "center",
formatter: function(item, index) { formatter: function(item, index) {
if (item.status == '0') { return $.table.selectDictLabel(datas, item.status);
return '<span class="badge badge-primary">正常</span>';
} else if (item.status == '1') {
return '<span class="badge badge-danger">停用</span>';
}
} }
}, },
{ {

View File

@ -45,7 +45,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">部门状态:</label> <label class="col-sm-3 control-label">部门状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -97,7 +97,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dept-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
} }
}); });

View File

@ -29,9 +29,15 @@
<input class="form-control" type="text" id="cssClass" name="cssClass"> <input class="form-control" type="text" id="cssClass" name="cssClass">
</div> </div>
</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"> <div class="form-group">
<label class="col-sm-3 control-label">系统默认:</label> <label class="col-sm-3 control-label">系统默认:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -46,7 +52,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -86,7 +92,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dict-add').serialize()); $.operate.save(prefix + "/add", $('#form-dict-add').serialize());
} }
}); });
</script> </script>

View File

@ -20,7 +20,7 @@
字典标签:<input type="text" name="dictLabel"/> 字典标签:<input type="text" name="dictLabel"/>
</li> </li>
<li> <li>
数据状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_normal_disable')}"> 数据状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -51,8 +51,9 @@
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script> <script th:src="@{/ajax/libs/select/select2.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:dict:edit')}]]; var editFlag = [[${@permission.hasPermi('system:dict:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:dict:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:dict:remove')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/dict/data" var prefix = ctx + "system/dict/data"
$(function() { $(function() {
@ -92,11 +93,7 @@
title: '状态', title: '状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">停用</span>';
}
} }
}, },
{ {

View File

@ -30,9 +30,15 @@
<input class="form-control" type="text" id="cssClass" name="cssClass" th:field="*{cssClass}"> <input class="form-control" type="text" id="cssClass" name="cssClass" th:field="*{cssClass}">
</div> </div>
</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"> <div class="form-group">
<label class="col-sm-3 control-label">系统默认:</label> <label class="col-sm-3 control-label">系统默认:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -47,7 +53,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -87,7 +93,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dict-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
} }
}); });
</script> </script>

View File

@ -19,7 +19,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -75,7 +75,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dict-add').serialize()); $.operate.save(prefix + "/add", $('#form-dict-add').serialize());
} }
}); });
</script> </script>

View File

@ -20,7 +20,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -79,7 +79,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-dict-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
} }
}); });
</script> </script>

View File

@ -18,7 +18,7 @@
字典类型:<input type="text" name="dictType"/> 字典类型:<input type="text" name="dictType"/>
</li> </li>
<li> <li>
字典状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_normal_disable')}"> 字典状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -54,9 +54,10 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:dict:edit')}]]; var editFlag = [[${@permission.hasPermi('system:dict:edit')}]];
var listFlag = [[${@permissionService.hasPermi('system:dict:list')}]]; var listFlag = [[${@permission.hasPermi('system:dict:list')}]];
var removeFlag = [[${@permissionService.hasPermi('system:dict:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:dict:remove')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/dict" var prefix = ctx + "system/dict"
$(function() { $(function() {
@ -96,11 +97,7 @@
title: '状态', title: '状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">停用</span>';
}
} }
}, },
{ {

View File

@ -58,7 +58,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">菜单状态:</label> <label class="col-sm-3 control-label">菜单状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -107,7 +107,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-menu-add').serialize()); $.operate.save(prefix + "/add", $('#form-menu-add').serialize());
} }
}); });

View File

@ -59,7 +59,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">菜单状态:</label> <label class="col-sm-3 control-label">菜单状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -117,7 +117,7 @@
} }
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-menu-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-menu-edit').serialize());
} }
}); });

View File

@ -14,7 +14,7 @@
菜单名称:<input type="text" name="menuName"/> 菜单名称:<input type="text" name="menuName"/>
</li> </li>
<li> <li>
菜单状态:<select name="visible" th:with="type=${@dictService.selectDictData('sys_show_hide')}"> 菜单状态:<select name="visible" th:with="type=${@dict.getType('sys_show_hide')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -40,9 +40,10 @@
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var addFlag = [[${@permissionService.hasPermi('system:menu:add')}]]; var addFlag = [[${@permission.hasPermi('system:menu:add')}]];
var editFlag = [[${@permissionService.hasPermi('system:menu:edit')}]]; var editFlag = [[${@permission.hasPermi('system:menu:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:menu:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:menu:remove')}]];
var datas = [[${@dict.getType('sys_show_hide')}]];
var prefix = ctx + "system/menu" var prefix = ctx + "system/menu"
window.onload = function() { window.onload = function() {
@ -106,11 +107,7 @@
width: '10%', width: '10%',
align: "center", align: "center",
formatter: function(row, index) { formatter: function(row, index) {
if (row.visible == 0) { return $.table.selectDictLabel(datas, row.visible);
return '<span class="badge badge-primary">显示</span>';
} else if (row.visible == 1) {
return '<span class="badge badge-danger">隐藏</span>';
}
} }
}, },
{ {

View File

@ -16,7 +16,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">公告类型:</label> <label class="col-sm-3 control-label">公告类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="noticeType" class="form-control m-b" th:with="type=${@dictService.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> <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
</select> </select>
</div> </div>
@ -30,7 +30,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">公告状态:</label> <label class="col-sm-3 control-label">公告状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -65,7 +65,7 @@
submitHandler: function(form) { submitHandler: function(form) {
var sHTML = $('.summernote').code(); var sHTML = $('.summernote').code();
$("#noticeContent").val(sHTML); $("#noticeContent").val(sHTML);
$.operate.save(prefix + "/save", $('#form-notice-add').serialize()); $.operate.save(prefix + "/add", $('#form-notice-add').serialize());
} }
}); });
</script> </script>

View File

@ -17,7 +17,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">公告类型:</label> <label class="col-sm-3 control-label">公告类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="noticeType" class="form-control m-b" th:with="type=${@dictService.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> <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" th:field="*{noticeType}"></option>
</select> </select>
</div> </div>
@ -31,7 +31,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">公告状态:</label> <label class="col-sm-3 control-label">公告状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -69,7 +69,7 @@
submitHandler: function(form) { submitHandler: function(form) {
var sHTML = $('.summernote').code(); var sHTML = $('.summernote').code();
$("#noticeContent").val(sHTML); $("#noticeContent").val(sHTML);
$.operate.save(prefix + "/save", $('#form-notice-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-notice-edit').serialize());
} }
}); });
</script> </script>

View File

@ -17,7 +17,7 @@
操作人员:<input type="text" name="createBy"/> 操作人员:<input type="text" name="createBy"/>
</li> </li>
<li> <li>
公告类型:<select name="noticeType" th:with="type=${@dictService.selectDictData('sys_notice_type')}"> 公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -46,8 +46,10 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:notice:edit')}]]; var editFlag = [[${@permission.hasPermi('system:notice:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:notice:remove')}]]; 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" var prefix = ctx + "system/notice"
$(function() { $(function() {
@ -74,11 +76,7 @@
title: '公告类型', title: '公告类型',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == '1') { return $.table.selectDictLabel(types, value);
return '<span class="label label-warning">通知</span>';
} else if (value == '2') {
return '<span class="badge badge-success">公告</span>';
}
} }
}, },
{ {
@ -86,11 +84,7 @@
title: '状态', title: '状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == '0') { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == '1') {
return '<span class="badge badge-danger">关闭</span>';
}
} }
}, },
{ {

View File

@ -25,7 +25,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label> <label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -64,7 +64,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-post-add').serialize()); $.operate.save(prefix + "/add", $('#form-post-add').serialize());
} }
}); });
</script> </script>

View File

@ -26,7 +26,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label> <label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8" th:with="type=${@dictService.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']}"> <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}"> <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> <label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
@ -65,7 +65,7 @@
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){
$.operate.save(prefix + "/save", $('#form-post-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
} }
}); });
</script> </script>

View File

@ -18,7 +18,7 @@
岗位名称:<input type="text" name="postName"/> 岗位名称:<input type="text" name="postName"/>
</li> </li>
<li> <li>
岗位状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_normal_disable')}"> 岗位状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
</select> </select>
@ -48,8 +48,9 @@
</div> </div>
<div th:include="include :: footer"></div> <div th:include="include :: footer"></div>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permissionService.hasPermi('system:post:edit')}]]; var editFlag = [[${@permission.hasPermi('system:post:edit')}]];
var removeFlag = [[${@permissionService.hasPermi('system:post:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/post" var prefix = ctx + "system/post"
$(function() { $(function() {
@ -90,11 +91,7 @@
title: '状态', title: '状态',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (value == 0) { return $.table.selectDictLabel(datas, value);
return '<span class="badge badge-primary">正常</span>';
} else if (value == 1) {
return '<span class="badge badge-danger">停用</span>';
}
} }
}, },
{ {

Some files were not shown because too many files have changed in this diff Show More