若依开源1.1.3发布

pull/3/head
RuoYi 2018-05-13 15:10:15 +08:00
parent 20070163c2
commit 784c020fbd
154 changed files with 2243 additions and 2155 deletions

View File

@ -1,6 +1,6 @@
## 平台简介 ## 平台简介
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。她可以用于所有的Web应用程序如网站管理后台网站会员中心CMSCRMOA。所有前端后台代码封装过后十分精简易上手提高开发效率及质量。同时支持移动客户端访问。系统会陆续更新一些实用功能。 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依。她可以用于所有的Web应用程序如网站管理后台网站会员中心CMSCRMOA。所有前端后台代码封装过后十分精简易上手出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
寓意:你若不离不弃,我必生死相依 寓意:你若不离不弃,我必生死相依
@ -22,28 +22,19 @@
## 系统演示 [www.ruoyi.club](http://www.ruoyi.club) ## 系统演示 [www.ruoyi.club](http://www.ruoyi.club)
![登录界面](https://static.oschina.net/uploads/space/2018/0425/110329_Ftsu_1438828.png) ![登录界面](https://static.oschina.net/uploads/space/2018/0513/145506_0712_1438828.png)
![首页](https://static.oschina.net/uploads/space/2018/0426/215626_fkrN_1438828.png) ![系统首页](https://static.oschina.net/uploads/space/2018/0513/145514_LKRy_1438828.png)
![用户管理](https://static.oschina.net/uploads/space/2018/0424/233815_kb8P_1438828.png) ![用户管理](https://static.oschina.net/uploads/space/2018/0513/145523_7Cuh_1438828.png)
![用户修改](https://static.oschina.net/uploads/space/2018/0424/233819_spnr_1438828.png) ![用户修改](https://static.oschina.net/uploads/space/2018/0513/145530_vE5H_1438828.png)
![部门选择](https://static.oschina.net/uploads/space/2018/0424/233826_J5NV_1438828.png) ![头像修改](https://static.oschina.net/uploads/space/2018/0513/145931_iibt_1438828.png)
![部门修改](https://static.oschina.net/uploads/space/2018/0424/234035_gkfz_1438828.png) ![菜单管理](https://static.oschina.net/uploads/space/2018/0513/145608_ex4U_1438828.png)
![菜单选择](https://static.oschina.net/uploads/space/2018/0424/233929_xcaM_1438828.png)
![菜单修改](https://static.oschina.net/uploads/space/2018/0311/235921_7txy_1438828.png)
![在线构建](https://static.oschina.net/uploads/space/2018/0424/233957_fRat_1438828.png)
![代码生成](https://static.oschina.net/uploads/space/2018/0424/233952_QXsG_1438828.png)
![操作日志](https://static.oschina.net/uploads/space/2018/0424/234055_8omc_1438828.png)
![角色管理](https://static.oschina.net/uploads/space/2018/0513/150005_gV8b_1438828.png)
## 若依交流群 ## 若依交流群

22
pom.xml
View File

@ -5,7 +5,7 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>RuoYi</artifactId> <artifactId>RuoYi</artifactId>
<version>1.1.2</version> <version>1.1.3</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>RuoYi</name> <name>RuoYi</name>
@ -124,6 +124,13 @@
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.5</version> <version>2.5</version>
</dependency> </dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<!--Shiro核心框架 --> <!--Shiro核心框架 -->
<dependency> <dependency>
@ -192,6 +199,19 @@
<artifactId>velocity</artifactId> <artifactId>velocity</artifactId>
<version>${velocity.version}</version> <version>${velocity.version}</version>
</dependency> </dependency>
<!--验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
<exclusions>
<exclusion>
<artifactId>javax.servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>

View File

@ -21,16 +21,16 @@ create table sys_dept (
-- ---------------------------- -- ----------------------------
-- 初始化-部门表数据 -- 初始化-部门表数据
-- ---------------------------- -- ----------------------------
insert into sys_dept values(100, 0, '若依集团', 0, '马云', '15011112221', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(100, 0, '若依集团', 0, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(101, 100, '研发部门', 1, '马研', '15011112222', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(101, 100, '研发部门', 1, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(102, 100, '市场部门', 2, '马市', '15011112223', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(102, 100, '市场部门', 2, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(103, 100, '测试部门', 3, '马测', '15011112224', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(103, 100, '测试部门', 3, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(104, 100, '财务部门', 4, '马财', '15011112225', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(104, 100, '财务部门', 4, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(105, 100, '运维部门', 5, '马运', '15011112226', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(105, 100, '运维部门', 5, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(106, 101, '研发一部', 1, '马一', '15011112227', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(106, 101, '研发一部', 1, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(107, 101, '研发二部', 2, '马二', '15011112228', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(107, 101, '研发二部', 2, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(108, 102, '市场一部', 1, '马一', '15011112229', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(108, 102, '市场一部', 1, '若依', '15888888888', 'ry@qq.com', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_dept values(109, 102, '市场二部', 2, '马二', '15011112210', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(109, 102, '市场二部', 2, '若依', '15888888888', 'ry@qq.com', 1, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
-- ---------------------------- -- ----------------------------
@ -61,8 +61,18 @@ create table sys_user (
-- ---------------------------- -- ----------------------------
-- 初始化-用户信息表数据 -- 初始化-用户信息表数据
-- ---------------------------- -- ----------------------------
insert into sys_user values(1, 106, 'admin', '若依', 'yzz_ivy@163.com', '15088888888', '1', 'profilel.jpg', '29c67a30398638269fe600f73a054934', '111111', 'N', 0, '维护中', 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_user values(1, 106, 'admin', '若依', 'ry@163.com', '15888888888', '1', '', '29c67a30398638269fe600f73a054934', '111111', 'Y', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(2, 108, 'ry', '若依', 'ry@163.com', '15288888888', '1', 'profilel.jpg', '8e6d98b90472783cc73c17047ddccf36', '222222', 'N', 0, '锁定中', 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_user values(2, 108, 'ry', '若依', 'ry@163.com', '15888888888', '1', '', '8e6d98b90472783cc73c17047ddccf36', '222222', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(3, 106, 'ly', '刘一', 'ry@163.com', '15888888888', '0', '', '648b02ef941c587a2f18a297a88a4d2f', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(4, 106, 'ce', '陈二', 'ry@163.com', '15888888888', '0', '', '9cee0cee6868803bee994cb38512f32a', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(5, 106, 'zs', '张三', 'ry@163.com', '15888888888', '0', '', 'eba13c577181da9df8133b580302b542', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(6, 106, 'ls', '李四', 'ry@163.com', '15888888888', '0', '', '15e31a50b42934e08587a137d9c22beb', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(7, 106, 'ww', '王五', 'ry@163.com', '15888888888', '0', '', 'a4e07697413f78f286650a0682899e32', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(8, 106, 'zl', '赵六', 'ry@163.com', '15888888888', '0', '', '047e1daf6e2ac6b6d706f81bb21f67ec', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(9, 106, 'sq', '孙七', 'ry@163.com', '15888888888', '0', '', '7ff6776ff40c5c0eadc6c4c52555268b', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(10, 106, 'zb', '周八', 'ry@163.com', '15888888888', '0', '', 'd41dca20a574699eaa851a6b7e7cb12f', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(11, 106, 'wj', '吴九', 'ry@163.com', '15888888888', '0', '', 'cfa9a24ab0c402cc2898795c2c3a973d', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
insert into sys_user values(12, 106, 'ys', '阳十', 'ry@163.com', '15888888888', '0', '', '700a6f8c57d894bfba7692283b345db8', '123456', 'N', 0, '正常', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
-- ---------------------------- -- ----------------------------
@ -87,10 +97,10 @@ create table sys_post
-- ---------------------------- -- ----------------------------
-- 初始化-岗位信息表数据 -- 初始化-岗位信息表数据
-- ---------------------------- -- ----------------------------
insert into sys_post values(1, 'ceo', '董事长', 1, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_post values(1, 'ceo', '董事长', 1, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_post values(2, 'se', '项目经理', 2, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_post values(2, 'se', '项目经理', 2, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_post values(3, 'hr', '人力资源', 3, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_post values(3, 'hr', '人力资源', 3, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_post values(4, 'user', '普通员工', 4, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_post values(4, 'user', '普通员工', 4, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- ---------------------------- -- ----------------------------
@ -114,8 +124,8 @@ create table sys_role (
-- ---------------------------- -- ----------------------------
-- 初始化-角色信息表数据 -- 初始化-角色信息表数据
-- ---------------------------- -- ----------------------------
insert into sys_role values('1', '管理员', 'admin', 1, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', '管理员'); insert into sys_role values('1', '管理员', 'admin', 1, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员');
insert into sys_role values('2', '普通角色', 'common', 2, 0, 'admin', '2018-03-01', 'ry', '2018-03-01', '普通角色'); insert into sys_role values('2', '普通角色', 'common', 2, 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '普通角色');
-- ---------------------------- -- ----------------------------
@ -144,87 +154,88 @@ create table sys_menu (
-- 初始化-菜单信息表数据 -- 初始化-菜单信息表数据
-- ---------------------------- -- ----------------------------
-- 一级菜单 -- 一级菜单
insert into sys_menu values('1', '系统管理', '0', '1', '#', 'M', '0', '', 'fa fa-gear', 'admin', '2018-03-01', 'ry', '2018-03-01', '系统管理目录'); 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-01', 'ry', '2018-03-01', '系统监控目录'); 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-01', 'ry', '2018-03-01', '系统工具目录'); 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('4', '用户管理', '1', '1', '/system/user', 'C', '0', 'system:user:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '用户管理菜单'); insert into sys_menu values('4', '用户管理', '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('5', '角色管理', '1', '2', '/system/role', 'C', '0', 'system:role:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '角色管理菜单'); insert into sys_menu values('5', '角色管理', '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('6', '菜单管理', '1', '3', '/system/menu', 'C', '0', 'system:menu:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '菜单管理菜单'); insert into sys_menu values('6', '菜单管理', '1', '3', '/system/menu', 'C', '0', 'system:menu:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单管理菜单');
insert into sys_menu values('7', '部门管理', '1', '4', '/system/dept', 'C', '0', 'system:dept:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '部门管理菜单'); insert into sys_menu values('7', '部门管理', '1', '4', '/system/dept', 'C', '0', 'system:dept:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门管理菜单');
insert into sys_menu values('8', '岗位管理', '1', '5', '/system/post', 'C', '0', 'system:post:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '岗位管理菜单'); insert into sys_menu values('8', '岗位管理', '1', '5', '/system/post', 'C', '0', 'system:post:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位管理菜单');
insert into sys_menu values('9', '字典管理', '1', '6', '/system/dict', 'C', '0', 'system:dict:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '字典管理菜单'); insert into sys_menu values('9', '字典管理', '1', '6', '/system/dict', 'C', '0', 'system:dict:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典管理菜单');
insert into sys_menu values('10', '参数设置', '1', '7', '/system/config', 'C', '0', 'system:config:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '参数设置菜单'); insert into sys_menu values('10', '参数设置', '1', '7', '/system/config', 'C', '0', 'system:config:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '参数设置菜单');
insert into sys_menu values('11', '操作日志', '2', '1', '/monitor/operlog', 'C', '0', 'monitor:operlog:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '操作日志菜单'); insert into sys_menu values('11', '操作日志', '2', '1', '/monitor/operlog', 'C', '0', 'monitor:operlog:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作日志菜单');
insert into sys_menu values('12', '登录日志', '2', '2', '/monitor/logininfor', 'C', '0', 'monitor:logininfor:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '登录日志菜单'); insert into sys_menu values('12', '登录日志', '2', '2', '/monitor/logininfor', 'C', '0', 'monitor:logininfor:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录日志菜单');
insert into sys_menu values('13', '在线用户', '2', '3', '/monitor/online', 'C', '0', 'monitor:online:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '在线用户菜单'); insert into sys_menu values('13', '在线用户', '2', '3', '/monitor/online', 'C', '0', 'monitor:online:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '在线用户菜单');
insert into sys_menu values('14', '定时任务', '2', '4', '/monitor/job', 'C', '0', 'monitor:job:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '定时任务菜单'); insert into sys_menu values('14', '定时任务', '2', '4', '/monitor/job', 'C', '0', 'monitor:job:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单');
insert into sys_menu values('15', '数据监控', '2', '5', '/monitor/data', 'C', '0', 'monitor:data:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '数据监控菜单'); insert into sys_menu values('15', '数据监控', '2', '5', '/monitor/data', 'C', '0', 'monitor:data:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '数据监控菜单');
insert into sys_menu values('16', '表单构建', '3', '1', '/tool/build', 'C', '0', 'tool:build:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '表单构建菜单'); insert into sys_menu values('16', '表单构建', '3', '1', '/tool/build', 'C', '0', 'tool:build:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单');
insert into sys_menu values('17', '代码生成', '3', '2', '/tool/gen', 'C', '0', 'tool:gen:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '代码生成菜单'); insert into sys_menu values('17', '代码生成', '3', '2', '/tool/gen', 'C', '0', 'tool:gen:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单');
-- 用户管理按钮 -- 用户管理按钮
insert into sys_menu values('18', '用户查询', '4', '1', '#', 'F', '0', 'system:user:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('18', '用户查询', '4', '1', '#', 'F', '0', 'system:user:list', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_menu values('19', '用户新增', '4', '2', '#', 'F', '0', 'system:user:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('19', '用户新增', '4', '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('20', '用户修改', '4', '3', '#', 'F', '0', 'system:user:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('20', '用户修改', '4', '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('21', '用户删除', '4', '4', '#', 'F', '0', 'system:user:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('21', '用户删除', '4', '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('22', '用户保存', '4', '5', '#', 'F', '0', 'system:user:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('22', '用户保存', '4', '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('23', '批量删除', '4', '6', '#', 'F', '0', 'system:user:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('23', '批量删除', '4', '6', '#', 'F', '0', 'system:user:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_menu values('24', '重置密码', '4', '7', '#', 'F', '0', 'system:user:resetPwd', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('24', '重置密码', '4', '7', '#', 'F', '0', 'system:user:resetPwd', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 角色管理按钮 -- 角色管理按钮
insert into sys_menu values('25', '角色查询', '5', '1', '#', 'F', '0', 'system:role:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('25', '角色查询', '5', '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('26', '角色新增', '5', '2', '#', 'F', '0', 'system:role:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('26', '角色新增', '5', '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('27', '角色修改', '5', '3', '#', 'F', '0', 'system:role:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('27', '角色修改', '5', '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('28', '角色删除', '5', '4', '#', 'F', '0', 'system:role:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('28', '角色删除', '5', '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('29', '角色保存', '5', '5', '#', 'F', '0', 'system:role:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('29', '角色保存', '5', '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('30', '批量删除', '5', '6', '#', 'F', '0', 'system:role:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('30', '批量删除', '5', '6', '#', 'F', '0', 'system:role:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 菜单管理按钮 -- 菜单管理按钮
insert into sys_menu values('31', '菜单查询', '6', '1', '#', 'F', '0', 'system:menu:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('31', '菜单查询', '6', '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('32', '菜单新增', '6', '2', '#', 'F', '0', 'system:menu:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('32', '菜单新增', '6', '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('33', '菜单修改', '6', '3', '#', 'F', '0', 'system:menu:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('33', '菜单修改', '6', '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('34', '菜单删除', '6', '4', '#', 'F', '0', 'system:menu:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('34', '菜单删除', '6', '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('35', '菜单保存', '6', '5', '#', 'F', '0', 'system:menu:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('35', '菜单保存', '6', '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('36', '部门查询', '7', '1', '#', 'F', '0', 'system:dept:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('36', '部门查询', '7', '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('37', '部门新增', '7', '2', '#', 'F', '0', 'system:dept:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('37', '部门新增', '7', '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('38', '部门修改', '7', '3', '#', 'F', '0', 'system:dept:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('38', '部门修改', '7', '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('39', '部门删除', '7', '4', '#', 'F', '0', 'system:dept:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('39', '部门删除', '7', '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('40', '部门保存', '7', '5', '#', 'F', '0', 'system:dept:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('40', '部门保存', '7', '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('41', '岗位查询', '8', '1', '#', 'F', '0', 'system:post:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('41', '岗位查询', '8', '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('42', '岗位新增', '8', '2', '#', 'F', '0', 'system:post:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('42', '岗位新增', '8', '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('43', '岗位修改', '8', '3', '#', 'F', '0', 'system:post:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('43', '岗位修改', '8', '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('44', '岗位删除', '8', '4', '#', 'F', '0', 'system:post:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('44', '岗位删除', '8', '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('45', '岗位保存', '8', '5', '#', 'F', '0', 'system:post:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('45', '岗位保存', '8', '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('46', '批量删除', '8', '6', '#', 'F', '0', 'system:post:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('46', '批量删除', '8', '6', '#', 'F', '0', 'system:post:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 字典管理按钮 -- 字典管理按钮
insert into sys_menu values('47', '字典查询', '9', '1', '#', 'F', '0', 'system:dict:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('47', '字典查询', '9', '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('48', '字典新增', '9', '2', '#', 'F', '0', 'system:dict:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('48', '字典新增', '9', '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('49', '字典修改', '9', '3', '#', 'F', '0', 'system:dict:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('49', '字典修改', '9', '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('50', '字典删除', '9', '4', '#', 'F', '0', 'system:dict:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('50', '字典删除', '9', '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('51', '字典保存', '9', '5', '#', 'F', '0', 'system:dict:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('51', '字典保存', '9', '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('52', '批量删除', '9', '6', '#', 'F', '0', 'system:dict:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('52', '批量删除', '9', '6', '#', 'F', '0', 'system:dict:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 操作日志按钮 -- 操作日志按钮
insert into sys_menu values('53', '操作查询', '11', '1', '#', 'F', '0', 'monitor:operlog:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('53', '操作查询', '11', '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('54', '批量删除', '11', '2', '#', 'F', '0', 'monitor:operlog:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('54', '批量删除', '11', '2', '#', 'F', '0', 'monitor:operlog:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_menu values('55', '详细信息', '11', '3', '#', 'F', '0', 'monitor:operlog:detail', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('55', '详细信息', '11', '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('56', '登录查询', '12', '1', '#', 'F', '0', 'monitor:logininfor:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('56', '登录查询', '12', '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('57', '批量删除', '12', '2', '#', 'F', '0', 'monitor:logininfor:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('57', '批量删除', '12', '2', '#', 'F', '0', 'monitor:logininfor:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 在线用户按钮 -- 在线用户按钮
insert into sys_menu values('58', '在线查询', '13', '1', '#', 'F', '0', 'monitor:online:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('58', '在线查询', '13', '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('59', '批量强退', '13', '2', '#', 'F', '0', 'monitor:online:batchForceLogout', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('59', '批量强退', '13', '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('60', '单条强退', '13', '3', '#', 'F', '0', 'monitor:online:forceLogout', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('60', '单条强退', '13', '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('61', '任务查询', '14', '1', '#', 'F', '0', 'monitor:job:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('61', '任务查询', '14', '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('62', '任务新增', '14', '2', '#', 'F', '0', 'monitor:job:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('62', '任务新增', '14', '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('63', '任务修改', '14', '3', '#', 'F', '0', 'monitor:job:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('63', '任务修改', '14', '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('64', '任务删除', '14', '4', '#', 'F', '0', 'monitor:job:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('64', '任务删除', '14', '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('65', '任务保存', '14', '5', '#', 'F', '0', 'monitor:job:save', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('65', '任务保存', '14', '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('66', '状态修改', '14', '6', '#', 'F', '0', 'monitor:job:changeStatus', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('66', '状态修改', '14', '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('67', '批量删除', '14', '7', '#', 'F', '0', 'monitor:job:batchRemove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('67', '批量删除', '14', '7', '#', 'F', '0', 'monitor:job:batchRemove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- 代码生成按钮 -- 代码生成按钮
insert into sys_menu values('68', '生成查询', '16', '1', '#', 'F', '0', 'tool:gen:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('68', '生成查询', '16', '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('69', '生成代码', '16', '2', '#', 'F', '0', 'tool:gen:code', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_menu values('69', '生成代码', '16', '2', '#', 'F', '0', 'tool:gen:code', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- ---------------------------- -- ----------------------------
-- 6、用户和角色关联表 用户N-1角色 -- 6、用户和角色关联表 用户N-1角色
@ -326,6 +337,7 @@ insert into sys_role_menu values ('1', '67');
insert into sys_role_menu values ('1', '68'); insert into sys_role_menu values ('1', '68');
insert into sys_role_menu values ('1', '69'); insert into sys_role_menu values ('1', '69');
-- ---------------------------- -- ----------------------------
-- 8、用户与岗位关联表 用户1-N岗位 -- 8、用户与岗位关联表 用户1-N岗位
-- ---------------------------- -- ----------------------------
@ -365,8 +377,6 @@ create table sys_oper_log (
primary key (oper_id) primary key (oper_id)
) engine=innodb auto_increment=100 default charset=utf8 comment = '操作日志记录'; ) engine=innodb auto_increment=100 default charset=utf8 comment = '操作日志记录';
insert into sys_oper_log values(1, '监控管理', '在线用户-强退用户', 'com.ruoyi.project.monitor.online.controller.UserOnlineController()', 'web', 'admin', '研发部门', 'delete.do?id=1', '127.0.0.1', 'JSON参数', 0, '错误描述', '2018-03-01');
-- ---------------------------- -- ----------------------------
-- 10、字典类型表 -- 10、字典类型表
@ -387,8 +397,8 @@ create table sys_dict_type
unique (dict_type) unique (dict_type)
) engine=innodb auto_increment=100 default charset=utf8 comment = '字典类型表'; ) engine=innodb auto_increment=100 default charset=utf8 comment = '字典类型表';
insert into sys_dict_type values(1, '银行列表', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', '银行数据列表'); insert into sys_dict_type values(1, '银行列表', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '银行数据列表');
insert into sys_dict_type values(2, '支付通道', 'sys_pay_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', '支付通道列表'); insert into sys_dict_type values(2, '支付通道', 'sys_pay_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '支付通道列表');
-- ---------------------------- -- ----------------------------
@ -411,18 +421,19 @@ create table sys_dict_data
primary key (dict_code) primary key (dict_code)
) 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, '工商银行', '01', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(1, 1, '工商银行', '01', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(2, 2, '建设银行', '02', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(2, 2, '建设银行', '02', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(3, 3, '农业银行', '03', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(3, 3, '农业银行', '03', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(4, 4, '光大银行', '04', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(4, 4, '光大银行', '04', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(5, 5, '兴业银行', '05', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(5, 5, '兴业银行', '05', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(6, 6, '中国银行', '06', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(6, 6, '中国银行', '06', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(7, 7, '平安银行', '07', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(7, 7, '平安银行', '07', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(8, 8, '招商银行', '08', 'sys_bank_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(8, 8, '招商银行', '08', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(9, 1, '微信支付', 'WX', 'sys_pay_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(9, 1, '微信支付', 'WX', 'sys_pay_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(10, 2, '支付宝', 'ZFB', 'sys_pay_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(10, 2, '支付宝', 'ZFB', 'sys_pay_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(11, 3, 'QQ支付', 'JD', 'sys_pay_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(11, 3, 'QQ支付', 'JD', 'sys_pay_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_dict_data values(12, 4, '京东支付', 'QQ', 'sys_pay_code', 0, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_dict_data values(12, 4, '京东支付', 'QQ', 'sys_pay_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- ---------------------------- -- ----------------------------
-- 12、系统访问记录 -- 12、系统访问记录
@ -440,8 +451,6 @@ create table sys_logininfor (
primary key (info_id) primary key (info_id)
) engine=innodb auto_increment=100 default charset=utf8 comment = '系统访问记录'; ) engine=innodb auto_increment=100 default charset=utf8 comment = '系统访问记录';
insert into sys_logininfor values(1, 'admin', '127.0.0.1', 'Chrome 45', 'Windows 7', 0, '登录成功' ,'2018-03-01');
-- ---------------------------- -- ----------------------------
-- 13、在线用户记录 -- 13、在线用户记录
@ -461,9 +470,6 @@ create table sys_user_online (
primary key (sessionId) primary key (sessionId)
) engine=innodb default charset=utf8 comment = '在线用户记录'; ) engine=innodb default charset=utf8 comment = '在线用户记录';
insert into sys_user_online(sessionId, login_name, dept_name, ipaddr, browser, os, status, start_timestsamp, last_access_time)
values('c3b252c3-2229-4be4-a5f7-7aba4b0c314c', 'admin', '研发部门', '127.0.0.1', 'Chrome 45', 'Windows 7', 'on_line', '2018-03-01', '2018-03-01');
-- ---------------------------- -- ----------------------------
-- 14、定时任务调度表 -- 14、定时任务调度表
@ -485,8 +491,9 @@ create table sys_job (
primary key (job_id, job_name, job_group) primary key (job_id, job_name, job_group)
) engine=innodb auto_increment=100 default charset=utf8 comment = '定时任务调度表'; ) engine=innodb auto_increment=100 default charset=utf8 comment = '定时任务调度表';
insert into sys_job values(1, 'ryTask', '系统默认(无参)', 'ryNoParams', '', '0/10 * * * * ?', 1, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_job values(1, 'ryTask', '系统默认(无参)', 'ryNoParams', '', '0/10 * * * * ?', 1, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
insert into sys_job values(2, 'ryTask', '系统默认(有参)', 'ryParams', 'ry', '0/20 * * * * ?', 1, 'admin', '2018-03-01', 'ry', '2018-03-01', ''); insert into sys_job values(2, 'ryTask', '系统默认(有参)', 'ryParams', 'ry', '0/20 * * * * ?', 1, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-- ---------------------------- -- ----------------------------
-- 15、定时任务调度日志表 -- 15、定时任务调度日志表

View File

@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
*/ */
@SpringBootApplication @SpringBootApplication
@EnableTransactionManagement @EnableTransactionManagement
@MapperScan("com.ruoyi.project.*.*.dao") @MapperScan("com.ruoyi.project.*.*.mapper")
public class RuoYiApplication public class RuoYiApplication
{ {
public static void main(String[] args) public static void main(String[] args)

View File

@ -38,4 +38,24 @@ public class CommonConstant
*/ */
public static String AUTO_REOMVE_PRE = "true"; public static String AUTO_REOMVE_PRE = "true";
/**
*
*/
public static String PAGENUM = "pageNum";
/**
*
*/
public static String PAGESIZE = "pageSize";
/**
*
*/
public static String ORDERBYCOLUMN = "orderByColumn";
/**
* "desc" "asc".
*/
public static String ISASC = "isAsc";
} }

View File

@ -39,8 +39,8 @@ public class CommonMap
javaTypeMap.put("text", "String"); javaTypeMap.put("text", "String");
javaTypeMap.put("mediumtext", "String"); javaTypeMap.put("mediumtext", "String");
javaTypeMap.put("longtext", "String"); javaTypeMap.put("longtext", "String");
javaTypeMap.put("date", "String"); javaTypeMap.put("date", "Date");
javaTypeMap.put("datetime", "String"); javaTypeMap.put("datetime", "Date");
javaTypeMap.put("timestamp", "String"); javaTypeMap.put("timestamp", "Date");
} }
} }

View File

@ -37,4 +37,29 @@ public interface ShiroConstants
*/ */
public String ONLINE_SESSION = "online_session"; public String ONLINE_SESSION = "online_session";
/**
* key
*/
public static final String CURRENT_CAPTCHA = "captcha";
/**
*
*/
public static final String CURRENT_EBABLED = "captchaEbabled";
/**
*
*/
public static final String CURRENT_TYPE = "captchaType";
/**
*
*/
public static final String CURRENT_VALIDATECODE = "validateCode";
/**
*
*/
public static final String CAPTCHA_ERROR = "captchaError";
} }

View File

@ -1,32 +0,0 @@
package com.ruoyi.common.exception.base;
/**
* Dao
*
* @author ruoyi
*/
public class DaoException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
*
*/
private String defaultMessage;
public DaoException(String defaultMessage)
{
this.defaultMessage = defaultMessage;
}
public String getDefaultMessage()
{
return defaultMessage;
}
@Override
public String toString()
{
return this.getClass() + "{" + "message='" + getMessage() + '\'' + '}';
}
}

View File

@ -0,0 +1,41 @@
package com.ruoyi.common.exception.file;
import org.apache.commons.fileupload.FileUploadException;
/**
*
*
* @author ruoyi
*/
public class FileNameLengthLimitExceededException extends FileUploadException
{
private static final long serialVersionUID = 1L;
private int length;
private int maxLength;
private String filename;
public FileNameLengthLimitExceededException(String filename, int length, int maxLength)
{
super("file name : [" + filename + "], length : [" + length + "], max length : [" + maxLength + "]");
this.length = length;
this.maxLength = maxLength;
this.filename = filename;
}
public String getFilename()
{
return filename;
}
public int getLength()
{
return length;
}
public int getMaxLength()
{
return maxLength;
}
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.common.exception.file;
import java.util.Arrays;
import org.apache.commons.fileupload.FileUploadException;
/**
*
*
* @author ruoyi
*/
public class InvalidExtensionException extends FileUploadException
{
private static final long serialVersionUID = 1L;
private String[] allowedExtension;
private String extension;
private String filename;
public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
{
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : ["
+ Arrays.toString(allowedExtension) + "]");
this.allowedExtension = allowedExtension;
this.extension = extension;
this.filename = filename;
}
public String[] getAllowedExtension()
{
return allowedExtension;
}
public String getExtension()
{
return extension;
}
public String getFilename()
{
return filename;
}
public static class InvalidImageExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
public static class InvalidFlashExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
public static class InvalidMediaExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.common.exception.user;
/**
*
*
* @author ruoyi
*/
public class CaptchaException extends UserException
{
private static final long serialVersionUID = 1L;
public CaptchaException()
{
super("user.jcaptcha.error", null);
}
}

View File

@ -4,6 +4,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
/** /**
* *
* *
@ -11,9 +13,15 @@ import java.util.Date;
*/ */
public class DateUtils public class DateUtils
{ {
public static final String DEFAULT_YYYYMMDD = "yyyyMMddHHmmss"; public static String YYYY = "yyyy";
public static final String DEFAULT_YYYY_MM_DD = "yyyy-MM-dd HH:mm:ss"; public static String YYYY_MM = "yyyy-MM";
public static String YYYY_MM_DD = "yyyy-MM-dd";
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
/** /**
* , yyyy-MM-dd * , yyyy-MM-dd
@ -22,30 +30,30 @@ public class DateUtils
*/ */
public static String getDate() public static String getDate()
{ {
return dateTimeNow("yyyy-MM-dd"); return dateTimeNow(YYYY_MM_DD);
} }
public static final String dateTimeStr() public static final String getTime()
{ {
return dateTimeNow(DEFAULT_YYYY_MM_DD); return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
} }
public static final String dateTimeNow() public static final String dateTimeNow()
{ {
return dateTimeNow(DEFAULT_YYYYMMDD); return dateTimeNow(YYYYMMDDHHMMSS);
} }
public static final String dateTimeNow(final String format) public static final String dateTimeNow(final String format)
{ {
return dateTime(format, new Date()); return parseDateToStr(format, new Date());
} }
public static final String dateTime(final Date date) public static final String dateTime(final Date date)
{ {
return dateTime(DEFAULT_YYYYMMDD, date); return parseDateToStr(YYYY_MM_DD, date);
} }
public static final String dateTime(final String format, final Date date) public static final String parseDateToStr(final String format, final Date date)
{ {
return new SimpleDateFormat(format).format(date); return new SimpleDateFormat(format).format(date);
} }
@ -62,4 +70,22 @@ public class DateUtils
} }
} }
/**
* // 2018/08/08
*/
public static final String datePath()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyy/MM/dd");
}
/**
* // 20180808
*/
public static final String dateTime()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyyMMdd");
}
} }

View File

@ -0,0 +1,155 @@
package com.ruoyi.common.utils;
import java.io.File;
import java.io.IOException;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
import com.ruoyi.framework.config.RuoYiConfig;
/**
*
*
* @author ruoyi
*/
public class FileUploadUtils
{
// 默认大小 50M
public static final long DEFAULT_MAX_SIZE = 52428800;
// 默认上传的地址
private static String defaultBaseDir = RuoYiConfig.getProfile();
// 默认的文件名最大长度
public static final int DEFAULT_FILE_NAME_LENGTH = 200;
// 默认文件类型jpg
public static final String IMAGE_JPG_EXTENSION = ".jpg";
private static int counter = 0;
public static void setDefaultBaseDir(String defaultBaseDir)
{
FileUploadUtils.defaultBaseDir = defaultBaseDir;
}
public static String getDefaultBaseDir()
{
return defaultBaseDir;
}
/**
*
*
* @param file
* @return
* @throws Exception
*/
public static final String upload(MultipartFile file) throws IOException
{
try
{
return upload(getDefaultBaseDir(), file, FileUploadUtils.IMAGE_JPG_EXTENSION);
}
catch (Exception e)
{
throw new IOException(e);
}
}
/**
*
*
* @param baseDir
* @param file
* @return
* @throws IOException
*/
public static final String upload(String baseDir, MultipartFile file) throws IOException
{
try
{
return upload(baseDir, file, FileUploadUtils.IMAGE_JPG_EXTENSION);
}
catch (Exception e)
{
throw new IOException(e);
}
}
/**
*
*
* @param baseDir
* @param file
* @param needDatePathAndRandomName
* @param extension
* @return
* @throws FileSizeLimitExceededException
* @throws FileNameLengthLimitExceededException
* @throws IOException
*/
public static final String upload(String baseDir, MultipartFile file, String extension)
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException
{
int fileNamelength = file.getOriginalFilename().length();
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
{
throw new FileNameLengthLimitExceededException(file.getOriginalFilename(), fileNamelength,
FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
}
assertAllowed(file);
String fileName = encodingFilename(file.getOriginalFilename(), extension);
File desc = getAbsoluteFile(baseDir, baseDir + fileName);
file.transferTo(desc);
return fileName;
}
private static final File getAbsoluteFile(String uploadDir, String filename) throws IOException
{
File desc = new File(File.separator + filename);
if (!desc.getParentFile().exists())
{
desc.getParentFile().mkdirs();
}
if (!desc.exists())
{
desc.createNewFile();
}
return desc;
}
/**
*
*/
private static final String encodingFilename(String filename, String extension)
{
filename = filename.replace("_", " ");
filename = new Md5Hash(filename + System.nanoTime() + counter++).toHex().toString() + extension;
return filename;
}
/**
*
*
* @param file
* @return
* @throws FileSizeLimitExceededException
*/
public static final void assertAllowed(MultipartFile file) throws FileSizeLimitExceededException
{
long size = file.getSize();
if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
{
throw new FileSizeLimitExceededException("not allowed upload upload", size, DEFAULT_MAX_SIZE);
}
}
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.common.utils; package com.ruoyi.common.utils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
@ -12,11 +15,65 @@ import org.springframework.web.context.request.ServletRequestAttributes;
public class ServletUtils public class ServletUtils
{ {
/** /**
* request * getStrAttribute
*/ */
public static HttpServletRequest getHttpServletRequest() public static String getStrAttribute(String name)
{ {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); return StringUtils.valueAsStr(getRequestAttributes().getRequest().getAttribute(name));
}
/**
* getIntAttribute
*/
public static int getIntAttribute(String name)
{
return StringUtils.valueAsInt(getRequestAttributes().getRequest().getAttribute(name));
}
/**
* getStrParameter
*/
public static String getStrParameter(String name)
{
return StringUtils.valueAsStr(getRequestAttributes().getRequest().getParameter(name));
}
/**
* getIntParameter
*/
public static Integer getIntParameter(String name)
{
return StringUtils.valueAsInt(getRequestAttributes().getRequest().getParameter(name));
}
public static ServletRequestAttributes getRequestAttributes()
{
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}
/**
* request
*/
public static HttpServletRequest getRequest()
{
return getRequestAttributes().getRequest();
}
/**
* response
*/
public static HttpServletResponse getResponse()
{
return getRequestAttributes().getResponse();
}
/**
* session
*/
public static HttpSession getSession()
{
return getRequest().getSession();
} }
/** /**
@ -51,4 +108,5 @@ public class ServletUtils
return false; return false;
} }
} }

View File

@ -298,4 +298,54 @@ public class StringUtils
} }
return result.toString(); return result.toString();
} }
/**
*
*/
public static String valueAsStr(Object value)
{
if (value instanceof String)
{
return (String) value;
}
else if (value != null)
{
return value.toString();
}
else
{
return null;
}
}
/**
*
*/
public static Integer valueAsInt(Object value)
{
if (value instanceof Integer)
{
return (Integer) value;
}
else if (value instanceof Number)
{
return ((Number) value).intValue();
}
else if (value instanceof String)
{
if ("NaN".equals(value))
{
return null;
}
return Integer.valueOf((String) value);
}
else if (value instanceof Boolean)
{
return ((Boolean) value) ? 1 : 0;
}
else
{
return null;
}
}
} }

View File

@ -2,13 +2,11 @@ package com.ruoyi.common.utils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.CommonConstant; import com.ruoyi.common.constant.CommonConstant;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.project.monitor.logininfor.domain.Logininfor; import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
import com.ruoyi.project.monitor.logininfor.service.LogininforServiceImpl; import com.ruoyi.project.monitor.logininfor.service.LogininforServiceImpl;
import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.UserAgent;
/** /**
@ -53,7 +51,7 @@ public class SystemLogUtils
public static void saveOpLog(String username, String message, String status) public static void saveOpLog(String username, String message, String status)
{ {
UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getHttpServletRequest().getHeader("User-Agent")); UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
// 获取客户端操作系统 // 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName(); String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器 // 获取客户端浏览器

View File

@ -1,10 +1,10 @@
package com.ruoyi.common.utils.security; package com.ruoyi.common.utils.security;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.SimplePrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
/** /**
@ -19,6 +19,11 @@ public class ShiroUtils
{ {
return SecurityUtils.getSubject(); return SecurityUtils.getSubject();
} }
public static Session getSession()
{
return SecurityUtils.getSubject().getSession();
}
public static void logout() public static void logout()
{ {

View File

@ -87,7 +87,7 @@ public class LogAspect
// 请求的地址 // 请求的地址
String ip = ShiroUtils.getIp(); String ip = ShiroUtils.getIp();
operLog.setOperIp(ip); operLog.setOperIp(ip);
operLog.setOperUrl(ServletUtils.getHttpServletRequest().getRequestURI()); operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (currentUser != null) if (currentUser != null)
{ {
operLog.setLoginName(currentUser.getLoginName()); operLog.setLoginName(currentUser.getLoginName());
@ -148,7 +148,7 @@ public class LogAspect
*/ */
private static void setRequestValue(OperLog operLog) private static void setRequestValue(OperLog operLog)
{ {
Map<String, String[]> map = ServletUtils.getHttpServletRequest().getParameterMap(); Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
String params = JSONObject.toJSONString(map); String params = JSONObject.toJSONString(map);
operLog.setOperParam(StringUtils.substring(params, 0, 255)); operLog.setOperParam(StringUtils.substring(params, 0, 255));
} }

View File

@ -0,0 +1,61 @@
package com.ruoyi.framework.config;
import java.util.Properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
/**
*
*
* @author ruoyi
*/
@Configuration
public class CaptchaConfig
{
@Bean(name = "captchaProducer")
public DefaultKaptcha getKaptchaBean()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
properties.setProperty("kaptcha.border", "yes");
properties.setProperty("kaptcha.border.color", "105,179,90");
properties.setProperty("kaptcha.textproducer.font.color", "blue");
properties.setProperty("kaptcha.image.width", "160");
properties.setProperty("kaptcha.image.height", "60");
properties.setProperty("kaptcha.textproducer.font.size", "28");
properties.setProperty("kaptcha.session.key", "kaptchaCode");
properties.setProperty("kaptcha.textproducer.char.spac", "35");
properties.setProperty("kaptcha.textproducer.char.length", "5");
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
properties.setProperty("kaptcha.noise.color", "white");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
@Bean(name = "captchaProducerMath")
public DefaultKaptcha getKaptchaBeanMath()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
properties.setProperty("kaptcha.border", "yes");
properties.setProperty("kaptcha.border.color", "105,179,90");
properties.setProperty("kaptcha.textproducer.font.color", "blue");
properties.setProperty("kaptcha.image.width", "160");
properties.setProperty("kaptcha.image.height", "60");
properties.setProperty("kaptcha.textproducer.font.size", "38");
properties.setProperty("kaptcha.session.key", "kaptchaCodeMath");
properties.setProperty("kaptcha.textproducer.impl", "com.ruoyi.framework.config.KaptchaTextCreator");
properties.setProperty("kaptcha.textproducer.char.spac", "5");
properties.setProperty("kaptcha.textproducer.char.length", "6");
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
properties.setProperty("kaptcha.noise.color", "white");
properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise");
properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
}

View File

@ -0,0 +1,77 @@
package com.ruoyi.framework.config;
import java.util.Random;
import com.google.code.kaptcha.text.impl.DefaultTextCreator;
/**
*
*
* @author ruoyi
*/
public class KaptchaTextCreator extends DefaultTextCreator
{
private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
@Override
public String getText()
{
Integer result = 0;
Random random = new Random();
int x = random.nextInt(10);
int y = random.nextInt(10);
StringBuilder suChinese = new StringBuilder();
int randomoperands = (int) Math.round(Math.random() * 2);
if (randomoperands == 0)
{
result = x * y;
suChinese.append(CNUMBERS[x]);
suChinese.append("*");
suChinese.append(CNUMBERS[y]);
}
else if (randomoperands == 1)
{
if (!(x == 0) && y % x == 0)
{
result = y / x;
suChinese.append(CNUMBERS[y]);
suChinese.append("/");
suChinese.append(CNUMBERS[x]);
}
else
{
result = x + y;
suChinese.append(CNUMBERS[x]);
suChinese.append("+");
suChinese.append(CNUMBERS[y]);
}
}
else if (randomoperands == 2)
{
if (x >= y)
{
result = x - y;
suChinese.append(CNUMBERS[x]);
suChinese.append("-");
suChinese.append(CNUMBERS[y]);
}
else
{
result = y - x;
suChinese.append(CNUMBERS[y]);
suChinese.append("-");
suChinese.append(CNUMBERS[x]);
}
}
else
{
result = x + y;
suChinese.append(CNUMBERS[x]);
suChinese.append("+");
suChinese.append(CNUMBERS[y]);
}
suChinese.append("=?@" + result);
return suChinese.toString();
}
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.framework.config;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@ -12,7 +13,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @author ruoyi * @author ruoyi
*/ */
@Configuration @Configuration
public class BaseConfig extends WebMvcConfigurerAdapter public class ResourcesConfig extends WebMvcConfigurerAdapter
{ {
/** /**
@ -31,4 +32,10 @@ public class BaseConfig extends WebMvcConfigurerAdapter
registry.setOrder(Ordered.HIGHEST_PRECEDENCE); registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
super.addViewControllers(registry); super.addViewControllers(registry);
} }
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry)
{
registry.addResourceHandler("/profile/**").addResourceLocations("file:" + RuoYiConfig.getProfile());
}
} }

View File

@ -18,6 +18,8 @@ public class RuoYiConfig
private String version; private String version;
/** 版权年份 */ /** 版权年份 */
private String copyrightYear; private String copyrightYear;
/** 上传路径 */
private static String profile;
public String getName() public String getName()
{ {
@ -49,4 +51,14 @@ public class RuoYiConfig
this.copyrightYear = copyrightYear; this.copyrightYear = copyrightYear;
} }
public static String getProfile()
{
return profile;
}
public static void setProfile(String profile)
{
RuoYiConfig.profile = profile;
}
} }

View File

@ -2,25 +2,33 @@ package com.ruoyi.framework.config;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import javax.servlet.Filter; import javax.servlet.Filter;
import org.apache.shiro.cache.ehcache.EhCacheManager; import org.apache.shiro.cache.ehcache.EhCacheManager;
import org.apache.shiro.codec.Base64;
import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.CookieRememberMeManager;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.servlet.SimpleCookie;
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.ruoyi.framework.shiro.realm.UserRealm; import com.ruoyi.framework.shiro.realm.UserRealm;
import com.ruoyi.framework.shiro.session.OnlineSessionDAO; import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
import com.ruoyi.framework.shiro.session.OnlineSessionFactory; import com.ruoyi.framework.shiro.session.OnlineSessionFactory;
import com.ruoyi.framework.shiro.web.filter.LogoutFilter; import com.ruoyi.framework.shiro.web.filter.LogoutFilter;
import com.ruoyi.framework.shiro.web.filter.captcha.CaptchaValidateFilter;
import com.ruoyi.framework.shiro.web.filter.online.OnlineSessionFilter; import com.ruoyi.framework.shiro.web.filter.online.OnlineSessionFilter;
import com.ruoyi.framework.shiro.web.filter.sync.SyncOnlineSessionFilter; import com.ruoyi.framework.shiro.web.filter.sync.SyncOnlineSessionFilter;
import com.ruoyi.framework.shiro.web.session.OnlineWebSessionManager; import com.ruoyi.framework.shiro.web.session.OnlineWebSessionManager;
import com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler; import com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler;
import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
/** /**
@ -41,6 +49,30 @@ public class ShiroConfig
@Value("${shiro.session.validationInterval}") @Value("${shiro.session.validationInterval}")
private int validationInterval; private int validationInterval;
// 验证码开关
@Value("${shiro.user.captchaEbabled}")
private boolean captchaEbabled;
// 验证码类型
@Value("${shiro.user.captchaType}")
private String captchaType;
// 设置Cookie的域名
@Value("${shiro.cookie.domain}")
private String domain;
// 设置cookie的有效访问路径
@Value("${shiro.cookie.path}")
private String path;
// 设置HttpOnly属性
@Value("${shiro.cookie.httpOnly}")
private boolean httpOnly;
// 设置Cookie的过期时间秒为单位
@Value("${shiro.cookie.maxAge}")
private int maxAge;
// 登录地址 // 登录地址
@Value("${shiro.user.loginUrl}") @Value("${shiro.user.loginUrl}")
private String loginUrl; private String loginUrl;
@ -160,6 +192,8 @@ public class ShiroConfig
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
// 设置realm. // 设置realm.
securityManager.setRealm(userRealm); securityManager.setRealm(userRealm);
// 记住我
securityManager.setRememberMeManager(rememberMeManager());
// 注入缓存管理器; // 注入缓存管理器;
securityManager.setCacheManager(getEhCacheManager()); securityManager.setCacheManager(getEhCacheManager());
// session管理器 // session管理器
@ -199,26 +233,28 @@ public class ShiroConfig
filterChainDefinitionMap.put("/docs/**", "anon"); filterChainDefinitionMap.put("/docs/**", "anon");
filterChainDefinitionMap.put("/fonts/**", "anon"); filterChainDefinitionMap.put("/fonts/**", "anon");
filterChainDefinitionMap.put("/img/**", "anon"); filterChainDefinitionMap.put("/img/**", "anon");
filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/ajax/**", "anon"); filterChainDefinitionMap.put("/ajax/**", "anon");
filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/ruoyi/**", "anon"); filterChainDefinitionMap.put("/ruoyi/**", "anon");
filterChainDefinitionMap.put("/druid/**", "anon"); filterChainDefinitionMap.put("/druid/**", "anon");
// 不需要拦截的访问 filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
filterChainDefinitionMap.put("/login", "anon");
// 退出 logout地址shiro去清除session // 退出 logout地址shiro去清除session
filterChainDefinitionMap.put("/logout", "logout"); filterChainDefinitionMap.put("/logout", "logout");
// 不需要拦截的访问
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
// 系统权限列表 // 系统权限列表
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll()); // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
Map<String, Filter> filters = new LinkedHashMap<>(); Map<String, Filter> filters = new LinkedHashMap<>();
filters.put("onlineSession", onlineSessionFilter()); filters.put("onlineSession", onlineSessionFilter());
filters.put("syncOnlineSession", syncOnlineSessionFilter()); filters.put("syncOnlineSession", syncOnlineSessionFilter());
filters.put("captchaValidate", captchaValidateFilter());
// 注销成功,则跳转到指定页面 // 注销成功,则跳转到指定页面
filters.put("logout", logoutFilter()); filters.put("logout", logoutFilter());
shiroFilterFactoryBean.setFilters(filters); shiroFilterFactoryBean.setFilters(filters);
// 所有请求需要认证 // 所有请求需要认证
filterChainDefinitionMap.put("/**", "authc"); filterChainDefinitionMap.put("/**", "user");
// 系统请求记录当前会话 // 系统请求记录当前会话
filterChainDefinitionMap.put("/main", "onlineSession,syncOnlineSession"); filterChainDefinitionMap.put("/main", "onlineSession,syncOnlineSession");
filterChainDefinitionMap.put("/system/**", "onlineSession,syncOnlineSession"); filterChainDefinitionMap.put("/system/**", "onlineSession,syncOnlineSession");
@ -249,6 +285,42 @@ public class ShiroConfig
return syncOnlineSessionFilter; return syncOnlineSessionFilter;
} }
/**
*
*/
@Bean
public CaptchaValidateFilter captchaValidateFilter()
{
CaptchaValidateFilter captchaValidateFilter = new CaptchaValidateFilter();
captchaValidateFilter.setCaptchaEbabled(captchaEbabled);
captchaValidateFilter.setCaptchaType(captchaType);
return captchaValidateFilter;
}
/**
* cookie
*/
public SimpleCookie rememberMeCookie()
{
SimpleCookie cookie = new SimpleCookie("rememberMe");
cookie.setDomain(domain);
cookie.setPath(path);
cookie.setHttpOnly(httpOnly);
cookie.setMaxAge(maxAge * 24 * 60 * 60);
return cookie;
}
/**
*
*/
public CookieRememberMeManager rememberMeManager()
{
CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
cookieRememberMeManager.setCookie(rememberMeCookie());
cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ=="));
return cookieRememberMeManager;
}
/** /**
* Shiro * Shiro
*/ */

View File

@ -1,265 +0,0 @@
package com.ruoyi.framework.mybatis;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Properties;
import javax.xml.bind.PropertyException;
import org.apache.ibatis.executor.ErrorContext;
import org.apache.ibatis.executor.ExecutorException;
import org.apache.ibatis.executor.statement.BaseStatementHandler;
import org.apache.ibatis.executor.statement.RoutingStatementHandler;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.mapping.ParameterMode;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.property.PropertyTokenizer;
import org.apache.ibatis.scripting.xmltags.ForEachSqlNode;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.type.TypeHandler;
import org.apache.ibatis.type.TypeHandlerRegistry;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.page.PageUtilEntity;
/**
* SQL
*
* @author ruoyi
*/
@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class, Integer.class }) })
public class ExecutorPageMethodInterceptor implements Interceptor
{
private static String dialect = ""; // 数据库方言
private static String pageSqlId = ""; // mapper.xml中需要拦截的ID(正则匹配)
@Override
public Object intercept(Invocation ivk) throws Throwable
{
// TODO Auto-generated method stub
if (ivk.getTarget() instanceof RoutingStatementHandler)
{
RoutingStatementHandler statementHandler = (RoutingStatementHandler) ivk.getTarget();
BaseStatementHandler delegate = (BaseStatementHandler) ReflectHelper.getValueByFieldName(statementHandler,
"delegate");
MappedStatement mappedStatement = (MappedStatement) ReflectHelper.getValueByFieldName(delegate,
"mappedStatement");
if (mappedStatement.getId().matches(pageSqlId))
{ // 拦截需要分页的SQL
BoundSql boundSql = delegate.getBoundSql();
Object parameterObject = boundSql.getParameterObject();// 分页SQL<select>中parameterType属性对应的实体参数即Mapper接口中执行分页方法的参数,该参数不得为空
if (parameterObject == null)
{
throw new NullPointerException("parameterObject尚未实例化");
}
else
{
Connection connection = (Connection) ivk.getArgs()[0];
String sql = boundSql.getSql();
// String countSql = "select count(0) from (" + sql+ ") as tmp_count"; //记录统计
String countSql = "select count(0) from (" + sql + ") tmp_count"; // 记录统计 == oracle 加 as 报错(SQL
// command not properly ended)
PreparedStatement countStmt = connection.prepareStatement(countSql);
BoundSql countBS = new BoundSql(mappedStatement.getConfiguration(), countSql,
boundSql.getParameterMappings(), parameterObject);
setParameters(countStmt, mappedStatement, countBS, parameterObject);
ResultSet rs = countStmt.executeQuery();
int count = 0;
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
countStmt.close();
// System.out.println(count);
PageUtilEntity pageUtilEntity = null;
if (parameterObject instanceof PageUtilEntity)
{
// 参数就是Page实体
pageUtilEntity = (PageUtilEntity) parameterObject;
pageUtilEntity.setEntityOrField(true);
pageUtilEntity.setTotalResult(count);
}
else
{
// 参数为某个实体该实体拥有Page属性
Field pageField = ReflectHelper.getFieldByFieldName(parameterObject, "PageUtilEntity");
if (pageField != null)
{
pageUtilEntity = (PageUtilEntity) ReflectHelper.getValueByFieldName(parameterObject, "PageUtilEntity");
if (pageUtilEntity == null)
{
pageUtilEntity = new PageUtilEntity();
}
pageUtilEntity.setEntityOrField(false);
pageUtilEntity.setTotalResult(count);
ReflectHelper.setValueByFieldName(parameterObject, "PageUtilEntity", pageUtilEntity); // 通过反射,对实体对象设置分页对象
}
else
{
throw new NoSuchFieldException(
parameterObject.getClass().getName() + "不存在 pageUtilEntity 属性!");
}
}
String pageSql = generatePageSql(sql, pageUtilEntity);
ReflectHelper.setValueByFieldName(boundSql, "sql", pageSql); // 将分页sql语句反射回BoundSql.
}
}
}
return ivk.proceed();
}
/**
* SQL(?),org.apache.ibatis.executor.parameter.DefaultParameterHandler
*
* @param ps
* @param mappedStatement
* @param boundSql
* @param parameterObject
* @throws SQLException
*/
@SuppressWarnings("unchecked")
private void setParameters(PreparedStatement ps, MappedStatement mappedStatement, BoundSql boundSql,
Object parameterObject) throws SQLException
{
ErrorContext.instance().activity("setting parameters").object(mappedStatement.getParameterMap().getId());
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
if (parameterMappings != null)
{
Configuration configuration = mappedStatement.getConfiguration();
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
MetaObject metaObject = parameterObject == null ? null : configuration.newMetaObject(parameterObject);
for (int i = 0; i < parameterMappings.size(); i++)
{
ParameterMapping parameterMapping = parameterMappings.get(i);
if (parameterMapping.getMode() != ParameterMode.OUT)
{
Object value;
String propertyName = parameterMapping.getProperty();
PropertyTokenizer prop = new PropertyTokenizer(propertyName);
if (parameterObject == null)
{
value = null;
}
else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass()))
{
value = parameterObject;
}
else if (boundSql.hasAdditionalParameter(propertyName))
{
value = boundSql.getAdditionalParameter(propertyName);
}
else if (propertyName.startsWith(ForEachSqlNode.ITEM_PREFIX)
&& boundSql.hasAdditionalParameter(prop.getName()))
{
value = boundSql.getAdditionalParameter(prop.getName());
if (value != null)
{
value = configuration.newMetaObject(value)
.getValue(propertyName.substring(prop.getName().length()));
}
}
else
{
value = metaObject == null ? null : metaObject.getValue(propertyName);
}
@SuppressWarnings("rawtypes")
TypeHandler typeHandler = parameterMapping.getTypeHandler();
if (typeHandler == null)
{
throw new ExecutorException("There was no TypeHandler found for parameter " + propertyName
+ " of statement " + mappedStatement.getId());
}
typeHandler.setParameter(ps, i + 1, value, parameterMapping.getJdbcType());
}
}
}
}
/**
* sql
*
* @param sql
* @param page
* @return
*/
private String generatePageSql(String sql, PageUtilEntity pageUtilEntity)
{
if (pageUtilEntity != null && StringUtils.isNotEmpty(dialect))
{
StringBuffer pageSql = new StringBuffer();
if ("mysql".equals(dialect))
{
pageSql.append(sql);
if(StringUtils.isNotEmpty(pageUtilEntity.getOrderByColumn()))
{
pageSql.append(" order by " + pageUtilEntity.getOrderByColumn() + " " + pageUtilEntity.getIsAsc());
}
pageSql.append(" limit " + pageUtilEntity.getPage() + "," + pageUtilEntity.getSize());
}
else if ("oracle".equals(dialect))
{
pageSql.append("select * from (select tmp_tb.*,ROWNUM row_id from (");
pageSql.append(sql);
// pageSql.append(") as tmp_tb where ROWNUM<=");
pageSql.append(") tmp_tb where ROWNUM<=");
pageSql.append(pageUtilEntity.getPage() + pageUtilEntity.getSize());
pageSql.append(") where row_id>");
pageSql.append(pageUtilEntity.getPage());
}
return pageSql.toString();
}
else
{
return sql;
}
}
@Override
public Object plugin(Object arg0)
{
return Plugin.wrap(arg0, this);
}
@Override
public void setProperties(Properties p)
{
dialect = p.getProperty("dialect");
if (StringUtils.isEmpty(dialect))
{
try
{
throw new PropertyException("dialect property is not found!");
}
catch (PropertyException e)
{
e.printStackTrace();
}
}
pageSqlId = p.getProperty("pageSqlId");
if (StringUtils.isEmpty(pageSqlId))
{
try
{
throw new PropertyException("pageSqlId property is not found!");
}
catch (PropertyException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

View File

@ -1,92 +0,0 @@
package com.ruoyi.framework.mybatis;
import java.lang.reflect.Field;
/**
* SQL
*
* @author ruoyi
*/
public class ReflectHelper
{
/**
* objfieldNameField
*
* @param obj
* @param fieldName
* @return
*/
public static Field getFieldByFieldName(Object obj, String fieldName)
{
for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass())
{
try
{
return superClass.getDeclaredField(fieldName);
}
catch (NoSuchFieldException e)
{
}
}
return null;
}
/**
* objfieldName
*
* @param obj
* @param fieldName
* @return
* @throws SecurityException
* @throws NoSuchFieldException
* @throws IllegalArgumentException
* @throws IllegalAccessException
*/
public static Object getValueByFieldName(Object obj, String fieldName)
throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
{
Field field = getFieldByFieldName(obj, fieldName);
Object value = null;
if (field != null)
{
if (field.isAccessible())
{
value = field.get(obj);
}
else
{
field.setAccessible(true);
value = field.get(obj);
field.setAccessible(false);
}
}
return value;
}
/**
* objfieldName
*
* @param obj
* @param fieldName
* @param value
* @throws SecurityException
* @throws NoSuchFieldException
* @throws IllegalArgumentException
* @throws IllegalAccessException
*/
public static void setValueByFieldName(Object obj, String fieldName, Object value)
throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
{
Field field = obj.getClass().getDeclaredField(fieldName);
if (field.isAccessible())
{
field.set(obj, value);
}
else
{
field.setAccessible(true);
field.set(obj, value);
field.setAccessible(false);
}
}
}

View File

@ -16,6 +16,7 @@ import org.apache.shiro.subject.PrincipalCollection;
import org.slf4j.Logger; 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 com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.RoleBlockedException; import com.ruoyi.common.exception.user.RoleBlockedException;
import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserBlockedException;
import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserNotExistsException;
@ -79,6 +80,10 @@ public class UserRealm extends AuthorizingRealm
{ {
user = loginService.login(username, password); user = loginService.login(username, password);
} }
catch (CaptchaException e)
{
throw new AuthenticationException(e.getMessage(), e);
}
catch (UserNotExistsException e) catch (UserNotExistsException e)
{ {
throw new UnknownAccountException(e.getMessage(), e); throw new UnknownAccountException(e.getMessage(), e);

View File

@ -4,11 +4,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.ruoyi.common.constant.CommonConstant; import com.ruoyi.common.constant.CommonConstant;
import com.ruoyi.common.constant.ShiroConstants;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserBlockedException;
import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserNotExistsException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.SystemLogUtils; import com.ruoyi.common.utils.SystemLogUtils;
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;
@ -32,6 +35,12 @@ public class LoginService
*/ */
public User login(String username, String password) public User login(String username, String password)
{ {
// 验证码校验
if (!StringUtils.isEmpty(ServletUtils.getStrAttribute(ShiroConstants.CURRENT_CAPTCHA)))
{
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
throw new CaptchaException();
}
// 用户名或密码为空 错误 // 用户名或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
{ {

View File

@ -85,7 +85,17 @@ public class PasswordService
public static void main(String[] args) public static void main(String[] args)
{ {
System.out.println(new PasswordService().encryptPassword("admin", "admin123", "111111")); //System.out.println(new PasswordService().encryptPassword("admin", "admin123", "111111"));
System.out.println(new PasswordService().encryptPassword("ry", "admin123", "222222")); //System.out.println(new PasswordService().encryptPassword("ry", "admin123", "222222"));
System.out.println(new PasswordService().encryptPassword("ly", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("ce", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("zs", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("ls", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("ww", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("zl", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("sq", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("zb", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("wj", "admin123", "123456"));
System.out.println(new PasswordService().encryptPassword("ys", "admin123", "123456"));
} }
} }

View File

@ -11,7 +11,6 @@ import com.ruoyi.common.utils.IpUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.monitor.online.domain.OnlineSession; import com.ruoyi.project.monitor.online.domain.OnlineSession;
import com.ruoyi.project.monitor.online.domain.UserOnline; import com.ruoyi.project.monitor.online.domain.UserOnline;
import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.UserAgent;
/** /**
@ -42,8 +41,7 @@ public class OnlineSessionFactory implements SessionFactory
HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest();
if (request != null) if (request != null)
{ {
UserAgent userAgent = UserAgent UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
.parseUserAgentString(ServletUtils.getHttpServletRequest().getHeader("User-Agent"));
// 获取客户端操作系统 // 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName(); String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器 // 获取客户端浏览器

View File

@ -0,0 +1,78 @@
package com.ruoyi.framework.shiro.web.filter.captcha;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.web.filter.AccessControlFilter;
import com.google.code.kaptcha.Constants;
import com.ruoyi.common.constant.ShiroConstants;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
/**
*
*
* @author ruoyi
*/
public class CaptchaValidateFilter extends AccessControlFilter
{
/**
*
*/
private boolean captchaEbabled = true;
/**
*
*/
private String captchaType = "math";
public void setCaptchaEbabled(boolean captchaEbabled)
{
this.captchaEbabled = captchaEbabled;
}
public void setCaptchaType(String captchaType)
{
this.captchaType = captchaType;
}
@Override
public boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception
{
request.setAttribute(ShiroConstants.CURRENT_EBABLED, captchaEbabled);
request.setAttribute(ShiroConstants.CURRENT_TYPE, captchaType);
return super.onPreHandle(request, response, mappedValue);
}
@Override
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
throws Exception
{
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
// 验证码禁用 或不是表单提交 允许访问
if (captchaEbabled == false || !"post".equals(httpServletRequest.getMethod().toLowerCase()))
{
return true;
}
return validateResponse(httpServletRequest, httpServletRequest.getParameter(ShiroConstants.CURRENT_VALIDATECODE));
}
public boolean validateResponse(HttpServletRequest request, String validateCode)
{
Object obj = ShiroUtils.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY);
String code = String.valueOf(obj != null ? obj : "");
if (StringUtils.isEmpty(validateCode) || !validateCode.equalsIgnoreCase(code))
{
return false;
}
return true;
}
@Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception
{
request.setAttribute(ShiroConstants.CURRENT_CAPTCHA, ShiroConstants.CAPTCHA_ERROR);
return true;
}
}

View File

@ -6,9 +6,8 @@ import com.github.pagehelper.PageInfo;
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;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.page.PageDomain;
import com.ruoyi.framework.web.page.PageUtilEntity;
import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.framework.web.support.TableSupport; import com.ruoyi.framework.web.page.TableSupport;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
/** /**
@ -18,26 +17,17 @@ import com.ruoyi.project.system.user.domain.User;
*/ */
public class BaseController public class BaseController
{ {
/**
*
*/
public PageUtilEntity getPageUtilEntity()
{
PageUtilEntity pageUtilEntity = TableSupport.buildPageRequest();
return pageUtilEntity;
}
/** /**
* *
*/ */
protected void setPageInfo(Object obj) protected void startPage()
{ {
PageDomain page = (PageDomain) obj; PageDomain pageDomain = TableSupport.buildPageRequest();
if (StringUtils.isNotEmpty(page.getPageNum()) && StringUtils.isNotEmpty(page.getPageSize())) Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
{ {
int pageNum = Integer.valueOf(page.getPageNum()); String orderBy = pageDomain.getOrderBy();
int pageSize = Integer.valueOf(page.getPageSize());
String orderBy = page.getOrderBy();
PageHelper.startPage(pageNum, pageSize, orderBy); PageHelper.startPage(pageNum, pageSize, orderBy);
} }
} }
@ -58,7 +48,7 @@ public class BaseController
{ {
return ShiroUtils.getUser(); return ShiroUtils.getUser();
} }
public void setUser(User user) public void setUser(User user)
{ {
ShiroUtils.setUser(user); ShiroUtils.setUser(user);

View File

@ -1,207 +0,0 @@
package com.ruoyi.framework.web.dao;
import java.util.List;
import javax.annotation.Resource;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import com.ruoyi.framework.web.page.PageUtilEntity;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* DAO
*
* @author ruoyi
*/
public class DynamicObjectBaseDao
{
@Resource(name = "sqlSessionTemplate")
private SqlSessionTemplate sqlSessionTemplate;
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int save(String str, Object obj)
{
return sqlSessionTemplate.insert(str, obj);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int batchSave(String str, List<?> objs)
{
return sqlSessionTemplate.insert(str, objs);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int update(String str, Object obj)
{
return sqlSessionTemplate.update(str, obj);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public void batchUpdate(String str, List<?> objs) throws Exception
{
SqlSessionFactory sqlSessionFactory = sqlSessionTemplate.getSqlSessionFactory();
// 批量执行器
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
try
{
if (objs != null)
{
for (int i = 0, size = objs.size(); i < size; i++)
{
sqlSession.update(str, objs.get(i));
}
sqlSession.flushStatements();
sqlSession.commit();
sqlSession.clearCache();
}
}
finally
{
sqlSession.close();
}
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int batchDelete(String str, List<?> objs) throws Exception
{
return sqlSessionTemplate.delete(str, objs);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int batchDelete(String str, Long[] objs)
{
return sqlSessionTemplate.delete(str, objs);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int delete(String str, Object obj)
{
return sqlSessionTemplate.delete(str, obj);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public <T> T findForObject(String str, Object obj)
{
return sqlSessionTemplate.selectOne(str, obj);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public int count(String str, Object obj)
{
return sqlSessionTemplate.selectOne(str, obj);
}
/**
* -
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public <E> List<E> findForList(String str)
{
return sqlSessionTemplate.selectList(str);
}
/**
* -
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public <E> List<E> findForList(String str, Object obj)
{
return sqlSessionTemplate.selectList(str, obj);
}
/**
*
*
* @param str mapper
* @param obj
* @return
* @throws Exception
*/
public TableDataInfo findForList(String str, PageUtilEntity pageUtilEntity)
{
List<?> pageList = sqlSessionTemplate.selectList(str, pageUtilEntity);
TableDataInfo tableDataInfo = new TableDataInfo(pageList, pageUtilEntity.getTotalResult());
return tableDataInfo;
}
public Object findForMap(String str, Object obj, String key, String value) throws Exception
{
return sqlSessionTemplate.selectMap(str, obj, key);
}
}

View File

@ -0,0 +1,98 @@
package com.ruoyi.framework.web.domain;
import java.io.Serializable;
import java.util.Date;
import com.ruoyi.common.utils.DateUtils;
/**
* Entity
*
* @author ruoyi
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建时间 */
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private Date updateTime;
/** 备注 */
private String remark;
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTimeStr()
{
return createTime != null ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, createTime) : "";
}
public String getCreateDateTimeStr()
{
return createTime != null ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, createTime) : "";
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateTimeStr()
{
return updateTime != null ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, updateTime) : "";
}
public String getUpdateDateTimeStr()
{
return updateTime != null ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, updateTime) : "";
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
}

View File

@ -1,7 +1,6 @@
package com.ruoyi.framework.web.domain; package com.ruoyi.framework.web.domain;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* *
@ -13,12 +12,10 @@ public class Message extends HashMap<String, Object>
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* Message * Message
*/ */
public Message() public Message()
{ {
put("code", 0);
put("msg", "操作成功");
} }
/** /**
@ -63,34 +60,22 @@ public class Message extends HashMap<String, Object>
* @param msg * @param msg
* @return * @return
*/ */
public static Message ok(String msg) public static Message success(String msg)
{ {
Message json = new Message(); Message json = new Message();
json.put("msg", msg); json.put("msg", msg);
json.put("code", 0);
return json; return json;
} }
/**
*
*
* @param map
* @return
*/
public static Message ok(Map<String, Object> map)
{
Message json = new Message();
json.putAll(map);
return json;
}
/** /**
* *
* *
* @return * @return
*/ */
public static Message ok() public static Message success()
{ {
return new Message(); return Message.success("操作成功");
} }
/** /**

View File

@ -1,82 +0,0 @@
package com.ruoyi.framework.web.page;
import com.ruoyi.common.utils.StringUtils;
/**
*
*
* @author ruoyi
*/
public class PageDomain
{
/** 当前记录起始索引 */
private String pageNum;
/** 每页显示记录数 */
private String pageSize;
/** 排序列 */
private String orderByColumn;
/** 排序的方向 "desc" 或者 "asc". */
private String isAsc;
/** 搜索值 */
private String searchValue;
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
{
return "";
}
return orderByColumn + " " + isAsc;
}
public String getPageNum()
{
return pageNum;
}
public void setPageNum(String pageNum)
{
this.pageNum = pageNum;
}
public String getPageSize()
{
return pageSize;
}
public void setPageSize(String pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
this.isAsc = isAsc;
}
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
}

View File

@ -1,109 +0,0 @@
package com.ruoyi.framework.web.page;
import java.util.Map;
/**
*
*
* @author ruoyi
*/
public class PageUtilEntity
{
/** 当前记录起始索引 */
private int page;
/** 每页显示记录数 */
private int size;
/** 排序列 */
private String orderByColumn;
/** 排序的方向 "desc" 或者 "asc". */
private String isAsc;
/** true:需要分页的地方传入的参数就是Page实体false:需要分页的地方传入的参数所代表的实体拥有Page属性 */
private boolean entityOrField;
/** 总记录数 */
private int totalResult;
/** 搜索值 */
private String searchValue;
/** 请求参数 */
protected Map<String, Object> reqMap;
public int getPage()
{
return page;
}
public void setPage(int page)
{
this.page = page;
}
public int getSize()
{
return size;
}
public void setSize(int size)
{
this.size = size;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
this.isAsc = isAsc;
}
public boolean isEntityOrField()
{
return entityOrField;
}
public void setEntityOrField(boolean entityOrField)
{
this.entityOrField = entityOrField;
}
public int getTotalResult()
{
return totalResult;
}
public void setTotalResult(int totalResult)
{
this.totalResult = totalResult;
}
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
public Map<String, Object> getReqMap()
{
return reqMap;
}
public void setReqMap(Map<String, Object> reqMap)
{
this.reqMap = reqMap;
}
}

View File

@ -0,0 +1,31 @@
package com.ruoyi.framework.web.page;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.constant.CommonConstant;
/**
*
*
* @author ruoyi
*/
public class TableSupport
{
/**
*
*/
public static PageDomain getPageDomain()
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(ServletUtils.getIntParameter(CommonConstant.PAGENUM));
pageDomain.setPageSize(ServletUtils.getIntParameter(CommonConstant.PAGESIZE));
pageDomain.setOrderByColumn(ServletUtils.getStrParameter(CommonConstant.ORDERBYCOLUMN));
pageDomain.setIsAsc(ServletUtils.getStrParameter(CommonConstant.ISASC));
return pageDomain;
}
public static PageDomain buildPageRequest()
{
return getPageDomain();
}
}

View File

@ -1,37 +0,0 @@
package com.ruoyi.framework.web.support;
import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.MapDataUtil;
import com.ruoyi.framework.web.page.PageUtilEntity;
/**
*
*
* @author ruoyi
*/
public class TableSupport
{
/**
*
*/
public static PageUtilEntity getPageUtilEntity()
{
HttpServletRequest request = ServletUtils.getHttpServletRequest();
PageUtilEntity pageUtilEntity = new PageUtilEntity();
pageUtilEntity.setPage(Integer.valueOf(request.getParameter("offset")));
pageUtilEntity.setSize(Integer.valueOf(request.getParameter("limit")));
pageUtilEntity.setOrderByColumn(request.getParameter("sort"));
pageUtilEntity.setIsAsc(request.getParameter("order"));
pageUtilEntity.setSearchValue(request.getParameter("search"));
pageUtilEntity.setReqMap(MapDataUtil.convertDataMap(request));
return pageUtilEntity;
}
public static PageUtilEntity buildPageRequest()
{
return getPageUtilEntity();
}
}

View File

@ -44,7 +44,7 @@ public class JobController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(Job job) public TableDataInfo list(Job job)
{ {
setPageInfo(job); startPage();
List<Job> list = jobService.selectJobList(job); List<Job> list = jobService.selectJobList(job);
return getDataTable(list); return getDataTable(list);
} }
@ -65,7 +65,7 @@ public class JobController extends BaseController
} }
if (jobService.deleteJob(job) > 0) if (jobService.deleteJob(job) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -79,7 +79,7 @@ public class JobController extends BaseController
try try
{ {
jobService.batchDeleteJob(ids); jobService.batchDeleteJob(ids);
return Message.ok(); return Message.success();
} }
catch (Exception e) catch (Exception e)
{ {
@ -99,7 +99,7 @@ public class JobController extends BaseController
{ {
if (jobService.changeStatus(job) > 0) if (jobService.changeStatus(job) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -139,7 +139,7 @@ public class JobController extends BaseController
{ {
if (jobService.saveJobCron(job) > 0) if (jobService.saveJobCron(job) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -43,7 +43,7 @@ public class JobLogController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(JobLog jobLog) public TableDataInfo list(JobLog jobLog)
{ {
setPageInfo(jobLog); startPage();
List<JobLog> list = jobLogService.selectJobLogList(jobLog); List<JobLog> list = jobLogService.selectJobLogList(jobLog);
return getDataTable(list); return getDataTable(list);
} }
@ -64,7 +64,7 @@ public class JobLogController extends BaseController
} }
if (jobLogService.deleteJobLogById(jobLogId) > 0) if (jobLogService.deleteJobLogById(jobLogId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -78,7 +78,7 @@ public class JobLogController extends BaseController
try try
{ {
jobLogService.batchDeleteJoblog(ids); jobLogService.batchDeleteJoblog(ids);
return Message.ok(); return Message.success();
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -1,14 +1,14 @@
package com.ruoyi.project.monitor.job.domain; package com.ruoyi.project.monitor.job.domain;
import java.io.Serializable; import java.io.Serializable;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_job * sys_job
* *
* @author ruoyi * @author ruoyi
*/ */
public class Job extends PageDomain implements Serializable public class Job extends BaseEntity implements Serializable
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -26,16 +26,6 @@ public class Job extends PageDomain implements Serializable
private String cronExpression; private String cronExpression;
/** 状态0正常 1暂停 */ /** 状态0正常 1暂停 */
private int status; private int status;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新时间 */
private String updateTime;
/** 更新者 */
private String updateBy;
/** 备注 */
private String remark;
public Long getJobId() public Long getJobId()
{ {
@ -107,63 +97,11 @@ public class Job extends PageDomain implements Serializable
this.status = status; this.status = status;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
@Override @Override
public String toString() public String toString()
{ {
return "Job [jobId=" + jobId + ", jobName=" + jobName + ", jobGroup=" + jobGroup + ", methodName=" + methodName return "Job [jobId=" + jobId + ", jobName=" + jobName + ", jobGroup=" + jobGroup + ", methodName=" + methodName
+ ", params=" + params + ", cronExpression=" + cronExpression + ", status=" + status + ", createBy=" + ", params=" + params + ", cronExpression=" + cronExpression + ", status=" + status + "]";
+ createBy + ", createTime=" + createTime + ", updateTime=" + updateTime + ", updateBy=" + updateBy
+ ", remark=" + remark + "]";
} }
} }

View File

@ -1,15 +1,15 @@
package com.ruoyi.project.monitor.job.domain; package com.ruoyi.project.monitor.job.domain;
import java.util.Date; import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.framework.web.page.PageDomain;
/** /**
* sys_job_log * sys_job_log
* *
* @author ruoyi * @author ruoyi
*/ */
public class JobLog extends PageDomain public class JobLog extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** ID */ /** ID */
private Long jobLogId; private Long jobLogId;
/** 任务名称 */ /** 任务名称 */
@ -26,8 +26,6 @@ public class JobLog extends PageDomain
private int isException; private int isException;
/** 异常信息 */ /** 异常信息 */
private String exceptionInfo; private String exceptionInfo;
/** 创建时间 */
private Date createTime;
public Long getJobLogId() public Long getJobLogId()
{ {
@ -109,22 +107,12 @@ public class JobLog extends PageDomain
this.exceptionInfo = exceptionInfo; this.exceptionInfo = exceptionInfo;
} }
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
@Override @Override
public String toString() public String toString()
{ {
return "JobLog [jobLogId=" + jobLogId + ", jobName=" + jobName + ", jobGroup=" + jobGroup + ", methodName=" return "JobLog [jobLogId=" + jobLogId + ", jobName=" + jobName + ", jobGroup=" + jobGroup + ", methodName="
+ methodName + ", params=" + params + ", jobMessage=" + jobMessage + ", isException=" + isException + methodName + ", params=" + params + ", jobMessage=" + jobMessage + ", isException=" + isException
+ ", exceptionInfo=" + exceptionInfo + ", createTime=" + createTime + "]"; + ", exceptionInfo=" + exceptionInfo + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.job.dao; package com.ruoyi.project.monitor.job.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.monitor.job.domain.JobLog; import com.ruoyi.project.monitor.job.domain.JobLog;
@ -8,7 +8,7 @@ import com.ruoyi.project.monitor.job.domain.JobLog;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IJobLogDao public interface JobLogMapper
{ {
/** /**

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.job.dao; package com.ruoyi.project.monitor.job.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.monitor.job.domain.Job; import com.ruoyi.project.monitor.job.domain.Job;
@ -8,7 +8,7 @@ import com.ruoyi.project.monitor.job.domain.Job;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IJobDao public interface JobMapper
{ {
/** /**

View File

@ -3,8 +3,8 @@ package com.ruoyi.project.monitor.job.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.project.monitor.job.dao.IJobLogDao;
import com.ruoyi.project.monitor.job.domain.JobLog; import com.ruoyi.project.monitor.job.domain.JobLog;
import com.ruoyi.project.monitor.job.mapper.JobLogMapper;
/** /**
* *
@ -16,7 +16,7 @@ public class JobLogServiceImpl implements IJobLogService
{ {
@Autowired @Autowired
private IJobLogDao jobLogDao; private JobLogMapper jobLogMapper;
/** /**
* quartz * quartz
@ -27,7 +27,7 @@ public class JobLogServiceImpl implements IJobLogService
@Override @Override
public List<JobLog> selectJobLogList(JobLog jobLog) public List<JobLog> selectJobLogList(JobLog jobLog)
{ {
return jobLogDao.selectJobLogList(jobLog); return jobLogMapper.selectJobLogList(jobLog);
} }
/** /**
@ -39,7 +39,7 @@ public class JobLogServiceImpl implements IJobLogService
@Override @Override
public JobLog selectJobLogById(Long jobLogId) public JobLog selectJobLogById(Long jobLogId)
{ {
return jobLogDao.selectJobLogById(jobLogId); return jobLogMapper.selectJobLogById(jobLogId);
} }
/** /**
@ -50,7 +50,7 @@ public class JobLogServiceImpl implements IJobLogService
@Override @Override
public void addJobLog(JobLog jobLog) public void addJobLog(JobLog jobLog)
{ {
jobLogDao.insertJobLog(jobLog); jobLogMapper.insertJobLog(jobLog);
} }
/** /**
@ -62,7 +62,7 @@ public class JobLogServiceImpl implements IJobLogService
@Override @Override
public int batchDeleteJoblog(Long[] ids) public int batchDeleteJoblog(Long[] ids)
{ {
return jobLogDao.batchDeleteJobLog(ids); return jobLogMapper.batchDeleteJobLog(ids);
} }
/** /**
@ -73,7 +73,7 @@ public class JobLogServiceImpl implements IJobLogService
@Override @Override
public int deleteJobLogById(Long jobId) public int deleteJobLogById(Long jobId)
{ {
return jobLogDao.deleteJobLogById(jobId); return jobLogMapper.deleteJobLogById(jobId);
} }
} }

View File

@ -9,8 +9,8 @@ import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.ScheduleConstants; import com.ruoyi.common.constant.ScheduleConstants;
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;
import com.ruoyi.project.monitor.job.dao.IJobDao;
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.util.ScheduleUtils; import com.ruoyi.project.monitor.job.util.ScheduleUtils;
/** /**
@ -25,7 +25,7 @@ public class JobServiceImpl implements IJobService
private Scheduler scheduler; private Scheduler scheduler;
@Autowired @Autowired
private IJobDao jobDao; private JobMapper jobMapper;
/** /**
* *
@ -33,7 +33,7 @@ public class JobServiceImpl implements IJobService
@PostConstruct @PostConstruct
public void init() public void init()
{ {
List<Job> jobList = jobDao.selectJobAll(); List<Job> jobList = jobMapper.selectJobAll();
for (Job job : jobList) for (Job job : jobList)
{ {
CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, job.getJobId()); CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, job.getJobId());
@ -58,7 +58,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public List<Job> selectJobList(Job job) public List<Job> selectJobList(Job job)
{ {
return jobDao.selectJobList(job); return jobMapper.selectJobList(job);
} }
/** /**
@ -70,7 +70,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public Job selectJobById(Long jobId) public Job selectJobById(Long jobId)
{ {
return jobDao.selectJobById(jobId); return jobMapper.selectJobById(jobId);
} }
/** /**
@ -83,7 +83,7 @@ public class JobServiceImpl implements IJobService
{ {
job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
job.setUpdateBy(ShiroUtils.getLoginName()); job.setUpdateBy(ShiroUtils.getLoginName());
int rows = jobDao.updateJob(job); int rows = jobMapper.updateJob(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.pauseJob(scheduler, job.getJobId()); ScheduleUtils.pauseJob(scheduler, job.getJobId());
@ -101,7 +101,7 @@ public class JobServiceImpl implements IJobService
{ {
job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
job.setUpdateBy(ShiroUtils.getLoginName()); job.setUpdateBy(ShiroUtils.getLoginName());
int rows = jobDao.updateJob(job); int rows = jobMapper.updateJob(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.resumeJob(scheduler, job.getJobId()); ScheduleUtils.resumeJob(scheduler, job.getJobId());
@ -117,7 +117,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public int deleteJob(Job job) public int deleteJob(Job job)
{ {
int rows = jobDao.deleteJobById(job); int rows = jobMapper.deleteJobById(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.deleteScheduleJob(scheduler, job.getJobId()); ScheduleUtils.deleteScheduleJob(scheduler, job.getJobId());
@ -136,7 +136,7 @@ public class JobServiceImpl implements IJobService
{ {
for (Long jobId : ids) for (Long jobId : ids)
{ {
Job job = jobDao.selectJobById(jobId); Job job = jobMapper.selectJobById(jobId);
deleteJob(job); deleteJob(job);
} }
} }
@ -170,7 +170,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public int triggerJob(Job job) public int triggerJob(Job job)
{ {
int rows = jobDao.updateJob(job); int rows = jobMapper.updateJob(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.run(scheduler, job); ScheduleUtils.run(scheduler, job);
@ -188,7 +188,7 @@ public class JobServiceImpl implements IJobService
{ {
job.setCreateBy(ShiroUtils.getLoginName()); job.setCreateBy(ShiroUtils.getLoginName());
job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
int rows = jobDao.insertJob(job); int rows = jobMapper.insertJob(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.createScheduleJob(scheduler, job); ScheduleUtils.createScheduleJob(scheduler, job);
@ -204,7 +204,7 @@ public class JobServiceImpl implements IJobService
@Override @Override
public int updateJobCron(Job job) public int updateJobCron(Job job)
{ {
int rows = jobDao.updateJob(job); int rows = jobMapper.updateJob(job);
if (rows > 0) if (rows > 0)
{ {
ScheduleUtils.updateScheduleJob(scheduler, job); ScheduleUtils.updateScheduleJob(scheduler, job);

View File

@ -42,7 +42,7 @@ public class LogininforController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(Logininfor logininfor) public TableDataInfo list(Logininfor logininfor)
{ {
setPageInfo(logininfor); startPage();
List<Logininfor> list = logininforService.selectLogininforList(logininfor); List<Logininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list); return getDataTable(list);
} }
@ -56,7 +56,7 @@ public class LogininforController extends BaseController
int rows = logininforService.batchDeleteLogininfor(ids); int rows = logininforService.batchDeleteLogininfor(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,15 +1,16 @@
package com.ruoyi.project.monitor.logininfor.domain; package com.ruoyi.project.monitor.logininfor.domain;
import java.util.Date; import java.util.Date;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* 访 sys_logininfor * 访 sys_logininfor
* *
* @author ruoyi * @author ruoyi
*/ */
public class Logininfor extends PageDomain public class Logininfor extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** ID */ /** ID */
private Integer infoId; private Integer infoId;
/** 用户账号 */ /** 用户账号 */

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.logininfor.dao; package com.ruoyi.project.monitor.logininfor.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.monitor.logininfor.domain.Logininfor; import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
@ -8,7 +8,7 @@ import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface ILogininforDao public interface LogininforMapper
{ {
/** /**
* *

View File

@ -3,8 +3,8 @@ package com.ruoyi.project.monitor.logininfor.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.project.monitor.logininfor.dao.ILogininforDao;
import com.ruoyi.project.monitor.logininfor.domain.Logininfor; import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
import com.ruoyi.project.monitor.logininfor.mapper.LogininforMapper;
/** /**
* 访 * 访
@ -16,7 +16,7 @@ public class LogininforServiceImpl implements ILogininforService
{ {
@Autowired @Autowired
private ILogininforDao logininforDao; private LogininforMapper logininforMapper;
/** /**
* *
@ -26,7 +26,7 @@ public class LogininforServiceImpl implements ILogininforService
@Override @Override
public void insertLogininfor(Logininfor logininfor) public void insertLogininfor(Logininfor logininfor)
{ {
logininforDao.insertLogininfor(logininfor); logininforMapper.insertLogininfor(logininfor);
} }
/** /**
@ -38,7 +38,7 @@ public class LogininforServiceImpl implements ILogininforService
@Override @Override
public List<Logininfor> selectLogininforList(Logininfor logininfor) public List<Logininfor> selectLogininforList(Logininfor logininfor)
{ {
return logininforDao.selectLogininforList(logininfor); return logininforMapper.selectLogininforList(logininfor);
} }
/** /**
@ -50,6 +50,6 @@ public class LogininforServiceImpl implements ILogininforService
@Override @Override
public int batchDeleteLogininfor(Long[] ids) public int batchDeleteLogininfor(Long[] ids)
{ {
return logininforDao.batchDeleteLogininfor(ids); return logininforMapper.batchDeleteLogininfor(ids);
} }
} }

View File

@ -48,7 +48,7 @@ public class UserOnlineController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(UserOnline userOnline) public TableDataInfo list(UserOnline userOnline)
{ {
setPageInfo(userOnline); startPage();
List<UserOnline> list = userOnlineService.selectUserOnlineList(userOnline); List<UserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
return getDataTable(list); return getDataTable(list);
} }
@ -75,7 +75,7 @@ public class UserOnlineController extends BaseController
online.setStatus(OnlineSession.OnlineStatus.off_line); online.setStatus(OnlineSession.OnlineStatus.off_line);
userOnlineService.saveOnline(online); userOnlineService.saveOnline(online);
} }
return Message.ok(); return Message.success();
} }
@RequiresPermissions("monitor:online:forceLogout") @RequiresPermissions("monitor:online:forceLogout")
@ -97,7 +97,7 @@ public class UserOnlineController extends BaseController
onlineSession.setStatus(OnlineSession.OnlineStatus.off_line); onlineSession.setStatus(OnlineSession.OnlineStatus.off_line);
online.setStatus(OnlineSession.OnlineStatus.off_line); online.setStatus(OnlineSession.OnlineStatus.off_line);
userOnlineService.saveOnline(online); userOnlineService.saveOnline(online);
return Message.ok(); return Message.success();
} }
} }

View File

@ -1,7 +1,7 @@
package com.ruoyi.project.monitor.online.domain; package com.ruoyi.project.monitor.online.domain;
import java.util.Date; import java.util.Date;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus; import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus;
/** /**
@ -9,8 +9,9 @@ import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus;
* *
* @author ruoyi * @author ruoyi
*/ */
public class UserOnline extends PageDomain public class UserOnline extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 用户会话id */ /** 用户会话id */
private String sessionId; private String sessionId;

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.online.dao; package com.ruoyi.project.monitor.online.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.monitor.online.domain.UserOnline; import com.ruoyi.project.monitor.online.domain.UserOnline;
@ -8,7 +8,7 @@ import com.ruoyi.project.monitor.online.domain.UserOnline;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IUserOnlineDao public interface UserOnlineMapper
{ {
/** /**
* *

View File

@ -7,8 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.shiro.session.OnlineSessionDAO; import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
import com.ruoyi.project.monitor.online.dao.IUserOnlineDao;
import com.ruoyi.project.monitor.online.domain.UserOnline; import com.ruoyi.project.monitor.online.domain.UserOnline;
import com.ruoyi.project.monitor.online.mapper.UserOnlineMapper;
/** /**
* 线 * 线
@ -19,7 +19,7 @@ import com.ruoyi.project.monitor.online.domain.UserOnline;
public class UserOnlineServiceImpl implements IUserOnlineService public class UserOnlineServiceImpl implements IUserOnlineService
{ {
@Autowired @Autowired
private IUserOnlineDao userOnlineDao; private UserOnlineMapper userOnlineDao;
@Autowired @Autowired
private OnlineSessionDAO onlineSessionDAO; private OnlineSessionDAO onlineSessionDAO;
@ -118,7 +118,7 @@ public class UserOnlineServiceImpl implements IUserOnlineService
@Override @Override
public List<UserOnline> selectOnlineByExpired(Date expiredDate) public List<UserOnline> selectOnlineByExpired(Date expiredDate)
{ {
String lastAccessTime = DateUtils.dateTime("yyyy-MM-dd HH:mm:ss", expiredDate); String lastAccessTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, expiredDate);
return userOnlineDao.selectOnlineByExpired(lastAccessTime); return userOnlineDao.selectOnlineByExpired(lastAccessTime);
} }
} }

View File

@ -43,7 +43,7 @@ public class OperlogController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(OperLog operLog) public TableDataInfo list(OperLog operLog)
{ {
setPageInfo(operLog); startPage();
List<OperLog> list = operLogService.selectOperLogList(operLog); List<OperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list); return getDataTable(list);
} }
@ -56,7 +56,7 @@ public class OperlogController extends BaseController
int rows = operLogService.batchDeleteOperLog(ids); int rows = operLogService.batchDeleteOperLog(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,15 +1,16 @@
package com.ruoyi.project.monitor.operlog.domain; package com.ruoyi.project.monitor.operlog.domain;
import java.util.Date; import java.util.Date;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* oper_log * oper_log
* *
* @author ruoyi * @author ruoyi
*/ */
public class OperLog extends PageDomain public class OperLog extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 日志主键 */ /** 日志主键 */
private Integer operId; private Integer operId;
/** 模块标题 */ /** 模块标题 */

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.operlog.dao; package com.ruoyi.project.monitor.operlog.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.monitor.operlog.domain.OperLog; import com.ruoyi.project.monitor.operlog.domain.OperLog;
@ -8,7 +8,7 @@ import com.ruoyi.project.monitor.operlog.domain.OperLog;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IOperLogDao public interface OperLogMapper
{ {
/** /**
* *

View File

@ -3,8 +3,8 @@ package com.ruoyi.project.monitor.operlog.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.project.monitor.operlog.dao.IOperLogDao;
import com.ruoyi.project.monitor.operlog.domain.OperLog; import com.ruoyi.project.monitor.operlog.domain.OperLog;
import com.ruoyi.project.monitor.operlog.mapper.OperLogMapper;
/** /**
* *
@ -15,7 +15,7 @@ import com.ruoyi.project.monitor.operlog.domain.OperLog;
public class OperLogServiceImpl implements IOperLogService public class OperLogServiceImpl implements IOperLogService
{ {
@Autowired @Autowired
private IOperLogDao operLogDao; private OperLogMapper operLogMapper;
/** /**
* *
@ -25,7 +25,7 @@ public class OperLogServiceImpl implements IOperLogService
@Override @Override
public void insertOperlog(OperLog operLog) public void insertOperlog(OperLog operLog)
{ {
operLogDao.insertOperlog(operLog); operLogMapper.insertOperlog(operLog);
} }
/** /**
@ -37,7 +37,7 @@ public class OperLogServiceImpl implements IOperLogService
@Override @Override
public List<OperLog> selectOperLogList(OperLog operLog) public List<OperLog> selectOperLogList(OperLog operLog)
{ {
return operLogDao.selectOperLogList(operLog); return operLogMapper.selectOperLogList(operLog);
} }
/** /**
@ -49,7 +49,7 @@ public class OperLogServiceImpl implements IOperLogService
@Override @Override
public int batchDeleteOperLog(Long[] ids) public int batchDeleteOperLog(Long[] ids)
{ {
return operLogDao.batchDeleteOperLog(ids); return operLogMapper.batchDeleteOperLog(ids);
} }
/** /**
@ -61,6 +61,6 @@ public class OperLogServiceImpl implements IOperLogService
@Override @Override
public OperLog selectOperLogById(Long operId) public OperLog selectOperLogById(Long operId)
{ {
return operLogDao.selectOperLogById(operId); return operLogMapper.selectOperLogById(operId);
} }
} }

View File

@ -84,7 +84,7 @@ public class DeptController extends BaseController
{ {
if (deptService.saveDept(dept) > 0) if (deptService.saveDept(dept) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -108,7 +108,7 @@ public class DeptController extends BaseController
} }
if (deptService.deleteDeptById(deptId) > 0) if (deptService.deleteDeptById(deptId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,12 +1,15 @@
package com.ruoyi.project.system.dept.domain; package com.ruoyi.project.system.dept.domain;
import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_dept * sys_dept
* *
* @author ruoyi * @author ruoyi
*/ */
public class Dept public class Dept extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 部门ID */ /** 部门ID */
private Long deptId; private Long deptId;
/** 父部门ID */ /** 父部门ID */
@ -25,14 +28,6 @@ public class Dept
private int status; private int status;
/** 父部门名称 */ /** 父部门名称 */
private String parentName; private String parentName;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private String updateTime;
public Long getDeptId() public Long getDeptId()
{ {
@ -124,53 +119,12 @@ public class Dept
this.parentName = parentName; this.parentName = parentName;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
@Override @Override
public String toString() public String toString()
{ {
return "Dept [deptId=" + deptId + ", parentId=" + parentId + ", deptName=" + deptName + ", orderNum=" + orderNum return "Dept [deptId=" + deptId + ", parentId=" + parentId + ", deptName=" + deptName + ", orderNum=" + orderNum
+ ", leader=" + leader + ", phone=" + phone + ", email=" + email + ", status=" + status + ", leader=" + leader + ", phone=" + phone + ", email=" + email + ", status=" + status
+ ", parentName=" + parentName + ", createBy=" + createBy + ", createTime=" + createTime + ", updateBy=" + ", parentName=" + parentName + "]";
+ updateBy + ", updateTime=" + updateTime + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.dept.dao; package com.ruoyi.project.system.dept.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.dept.domain.Dept;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IDeptDao public interface DeptMapper
{ {
/** /**
* *

View File

@ -6,12 +6,11 @@ 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.Repository;
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;
import com.ruoyi.project.system.dept.dao.IDeptDao;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
import com.ruoyi.project.system.dept.mapper.DeptMapper;
/** /**
* *
@ -22,7 +21,7 @@ import com.ruoyi.project.system.dept.domain.Dept;
public class DeptServiceImpl implements IDeptService public class DeptServiceImpl implements IDeptService
{ {
@Autowired @Autowired
private IDeptDao deptDao; private DeptMapper deptMapper;
/** /**
* *
@ -32,7 +31,7 @@ public class DeptServiceImpl implements IDeptService
@Override @Override
public List<Dept> selectDeptAll() public List<Dept> selectDeptAll()
{ {
return deptDao.selectDeptAll(); return deptMapper.selectDeptAll();
} }
/** /**
@ -44,7 +43,7 @@ public class DeptServiceImpl implements IDeptService
public List<Map<String, Object>> selectDeptTree() public List<Map<String, Object>> selectDeptTree()
{ {
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<Dept> deptList = deptDao.selectDeptAll(); List<Dept> deptList = deptMapper.selectDeptAll();
for (Dept dept : deptList) for (Dept dept : deptList)
{ {
@ -71,7 +70,7 @@ public class DeptServiceImpl implements IDeptService
{ {
Dept dept = new Dept(); Dept dept = new Dept();
dept.setParentId(parentId); dept.setParentId(parentId);
return deptDao.selectDeptCount(dept); return deptMapper.selectDeptCount(dept);
} }
/** /**
@ -83,7 +82,7 @@ public class DeptServiceImpl implements IDeptService
@Override @Override
public boolean checkDeptExistUser(Long deptId) public boolean checkDeptExistUser(Long deptId)
{ {
int result = deptDao.checkDeptExistUser(deptId); int result = deptMapper.checkDeptExistUser(deptId);
return result > 0 ? true : false; return result > 0 ? true : false;
} }
@ -96,7 +95,7 @@ public class DeptServiceImpl implements IDeptService
@Override @Override
public int deleteDeptById(Long deptId) public int deleteDeptById(Long deptId)
{ {
return deptDao.deleteDeptById(deptId); return deptMapper.deleteDeptById(deptId);
} }
/** /**
@ -111,12 +110,12 @@ public class DeptServiceImpl implements IDeptService
if (StringUtils.isNotNull(dept.getDeptId())) if (StringUtils.isNotNull(dept.getDeptId()))
{ {
dept.setUpdateBy(ShiroUtils.getLoginName()); dept.setUpdateBy(ShiroUtils.getLoginName());
return deptDao.updateDept(dept); return deptMapper.updateDept(dept);
} }
else else
{ {
dept.setCreateBy(ShiroUtils.getLoginName()); dept.setCreateBy(ShiroUtils.getLoginName());
return deptDao.insertDept(dept); return deptMapper.insertDept(dept);
} }
} }
@ -129,7 +128,7 @@ public class DeptServiceImpl implements IDeptService
@Override @Override
public Dept selectDeptById(Long deptId) public Dept selectDeptById(Long deptId)
{ {
return deptDao.selectDeptById(deptId); return deptMapper.selectDeptById(deptId);
} }
/** /**
@ -142,7 +141,7 @@ public class DeptServiceImpl implements IDeptService
public String checkDeptNameUnique(Dept dept) public String checkDeptNameUnique(Dept dept)
{ {
Long deptId = dept.getDeptId(); Long deptId = dept.getDeptId();
Dept info = deptDao.checkDeptNameUnique(dept.getDeptName()); Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getDeptId()) if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getDeptId())
&& info.getDeptId().longValue() != deptId.longValue()) && info.getDeptId().longValue() != deptId.longValue())
{ {

View File

@ -44,7 +44,7 @@ public class DictDataController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(DictData dictData) public TableDataInfo list(DictData dictData)
{ {
setPageInfo(dictData); startPage();
List<DictData> list = dictDataService.selectDictDataList(dictData); List<DictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list); return getDataTable(list);
} }
@ -85,7 +85,7 @@ public class DictDataController extends BaseController
{ {
if (dictDataService.saveDictData(dict) > 0) if (dictDataService.saveDictData(dict) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -106,7 +106,7 @@ public class DictDataController extends BaseController
} }
if (dictDataService.deleteDictDataById(dictCode) > 0) if (dictDataService.deleteDictDataById(dictCode) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -120,7 +120,7 @@ public class DictDataController extends BaseController
int rows = dictDataService.batchDeleteDictData(ids); int rows = dictDataService.batchDeleteDictData(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,7 +1,6 @@
package com.ruoyi.project.system.dict.controller; package com.ruoyi.project.system.dict.controller;
import java.util.List; 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;
@ -12,7 +11,6 @@ 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.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.Message; import com.ruoyi.framework.web.domain.Message;
@ -46,7 +44,7 @@ public class DictTypeController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(DictType dictType) public TableDataInfo list(DictType dictType)
{ {
setPageInfo(dictType); startPage();
List<DictType> list = dictTypeService.selectDictTypeList(dictType); List<DictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list); return getDataTable(list);
} }
@ -86,7 +84,7 @@ public class DictTypeController extends BaseController
{ {
if (dictTypeService.saveDictType(dict) > 0) if (dictTypeService.saveDictType(dict) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -107,7 +105,7 @@ public class DictTypeController extends BaseController
} }
if (dictTypeService.deleteDictTypeById(dictId) > 0) if (dictTypeService.deleteDictTypeById(dictId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -121,7 +119,7 @@ public class DictTypeController extends BaseController
int rows = dictTypeService.batchDeleteDictType(ids); int rows = dictTypeService.batchDeleteDictType(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,14 +1,15 @@
package com.ruoyi.project.system.dict.domain; package com.ruoyi.project.system.dict.domain;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_dict_data * sys_dict_data
* *
* @author ruoyi * @author ruoyi
*/ */
public class DictData extends PageDomain public class DictData extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 字典编码 */ /** 字典编码 */
private Long dictCode; private Long dictCode;
/** 字典排序 */ /** 字典排序 */
@ -21,16 +22,6 @@ public class DictData extends PageDomain
private String dictType; private String dictType;
/** 状态0正常 1禁用 */ /** 状态0正常 1禁用 */
private int status; private int status;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private String updateTime;
/** 备注 */
private String remark;
public Long getDictCode() public Long getDictCode()
{ {
@ -92,63 +83,11 @@ public class DictData extends PageDomain
this.status = status; this.status = status;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
@Override @Override
public String toString() public String toString()
{ {
return "DictData [dictCode=" + dictCode + ", dictSort=" + dictSort + ", dictLabel=" + dictLabel + ", dictValue=" return "DictData [dictCode=" + dictCode + ", dictSort=" + dictSort + ", dictLabel=" + dictLabel + ", dictValue="
+ dictValue + ", dictType=" + dictType + ", status=" + status + ", createBy=" + createBy + dictValue + ", dictType=" + dictType + ", status=" + status + "]";
+ ", createTime=" + createTime + ", updateBy=" + updateBy + ", updateTime=" + updateTime + ", remark="
+ remark + "]";
} }
} }

View File

@ -1,14 +1,15 @@
package com.ruoyi.project.system.dict.domain; package com.ruoyi.project.system.dict.domain;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_dict_type * sys_dict_type
* *
* @author ruoyi * @author ruoyi
*/ */
public class DictType extends PageDomain public class DictType extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 字典主键 */ /** 字典主键 */
private Long dictId; private Long dictId;
/** 字典名称 */ /** 字典名称 */
@ -17,16 +18,6 @@ public class DictType extends PageDomain
private String dictType; private String dictType;
/** 状态0正常 1禁用 */ /** 状态0正常 1禁用 */
private int status; private int status;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private String updateTime;
/** 备注 */
private String remark;
public Long getDictId() public Long getDictId()
{ {
@ -68,62 +59,10 @@ public class DictType extends PageDomain
this.status = status; this.status = status;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
@Override @Override
public String toString() public String toString()
{ {
return "DictType [dictId=" + dictId + ", dictName=" + dictName + ", dictType=" + dictType + ", status=" + status return "DictType [dictId=" + dictId + ", dictName=" + dictName + ", dictType=" + dictType + ", status=" + status + "]";
+ ", createBy=" + createBy + ", createTime=" + createTime + ", updateBy=" + updateBy + ", updateTime="
+ updateTime + ", remark=" + remark + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.dict.dao; package com.ruoyi.project.system.dict.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.dict.domain.DictData; import com.ruoyi.project.system.dict.domain.DictData;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.dict.domain.DictData;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IDictDataDao public interface DictDataMapper
{ {
/** /**

View File

@ -1,9 +1,7 @@
package com.ruoyi.project.system.dict.dao; package com.ruoyi.project.system.dict.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.ruoyi.project.system.dict.domain.DictType; import com.ruoyi.project.system.dict.domain.DictType;
/** /**
@ -12,7 +10,7 @@ import com.ruoyi.project.system.dict.domain.DictType;
* @author ruoyi * @author ruoyi
*/ */
@Mapper @Mapper
public interface IDictTypeDao public interface DictTypeMapper
{ {
/** /**
* *

View File

@ -5,8 +5,8 @@ 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.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.dict.dao.IDictDataDao;
import com.ruoyi.project.system.dict.domain.DictData; import com.ruoyi.project.system.dict.domain.DictData;
import com.ruoyi.project.system.dict.mapper.DictDataMapper;
/** /**
* *
@ -17,7 +17,7 @@ import com.ruoyi.project.system.dict.domain.DictData;
public class DictDataServiceImpl implements IDictDataService public class DictDataServiceImpl implements IDictDataService
{ {
@Autowired @Autowired
private IDictDataDao dictDao; private DictDataMapper dictDataMapper;
/** /**
* *
@ -28,7 +28,7 @@ public class DictDataServiceImpl implements IDictDataService
@Override @Override
public List<DictData> selectDictDataList(DictData dictData) public List<DictData> selectDictDataList(DictData dictData)
{ {
return dictDao.selectDictDataList(dictData); return dictDataMapper.selectDictDataList(dictData);
} }
/** /**
@ -40,7 +40,7 @@ public class DictDataServiceImpl implements IDictDataService
@Override @Override
public DictData selectDictDataById(Long dictCode) public DictData selectDictDataById(Long dictCode)
{ {
return dictDao.selectDictDataById(dictCode); return dictDataMapper.selectDictDataById(dictCode);
} }
/** /**
@ -52,7 +52,7 @@ public class DictDataServiceImpl implements IDictDataService
@Override @Override
public int deleteDictDataById(Long dictCode) public int deleteDictDataById(Long dictCode)
{ {
return dictDao.deleteDictDataById(dictCode); return dictDataMapper.deleteDictDataById(dictCode);
} }
/** /**
@ -64,7 +64,7 @@ public class DictDataServiceImpl implements IDictDataService
@Override @Override
public int batchDeleteDictData(Long[] ids) public int batchDeleteDictData(Long[] ids)
{ {
return dictDao.batchDeleteDictData(ids); return dictDataMapper.batchDeleteDictData(ids);
} }
/** /**
@ -80,12 +80,12 @@ public class DictDataServiceImpl implements IDictDataService
if (StringUtils.isNotNull(dictCode)) if (StringUtils.isNotNull(dictCode))
{ {
dictData.setUpdateBy(ShiroUtils.getLoginName()); dictData.setUpdateBy(ShiroUtils.getLoginName());
return dictDao.updateDictData(dictData); return dictDataMapper.updateDictData(dictData);
} }
else else
{ {
dictData.setCreateBy(ShiroUtils.getLoginName()); dictData.setCreateBy(ShiroUtils.getLoginName());
return dictDao.insertDictData(dictData); return dictDataMapper.insertDictData(dictData);
} }
} }

View File

@ -6,8 +6,8 @@ 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;
import com.ruoyi.project.system.dict.dao.IDictTypeDao;
import com.ruoyi.project.system.dict.domain.DictType; import com.ruoyi.project.system.dict.domain.DictType;
import com.ruoyi.project.system.dict.mapper.DictTypeMapper;
/** /**
* *
@ -18,7 +18,7 @@ import com.ruoyi.project.system.dict.domain.DictType;
public class DictTypeServiceImpl implements IDictTypeService public class DictTypeServiceImpl implements IDictTypeService
{ {
@Autowired @Autowired
private IDictTypeDao dictTypeDao; private DictTypeMapper dictTypeMapper;
/** /**
* *
@ -29,7 +29,7 @@ public class DictTypeServiceImpl implements IDictTypeService
@Override @Override
public List<DictType> selectDictTypeList(DictType dictType) public List<DictType> selectDictTypeList(DictType dictType)
{ {
return dictTypeDao.selectDictTypeList(dictType); return dictTypeMapper.selectDictTypeList(dictType);
} }
/** /**
@ -41,7 +41,7 @@ public class DictTypeServiceImpl implements IDictTypeService
@Override @Override
public DictType selectDictTypeById(Long dictId) public DictType selectDictTypeById(Long dictId)
{ {
return dictTypeDao.selectDictTypeById(dictId); return dictTypeMapper.selectDictTypeById(dictId);
} }
/** /**
@ -53,7 +53,7 @@ public class DictTypeServiceImpl implements IDictTypeService
@Override @Override
public int deleteDictTypeById(Long dictId) public int deleteDictTypeById(Long dictId)
{ {
return dictTypeDao.deleteDictTypeById(dictId); return dictTypeMapper.deleteDictTypeById(dictId);
} }
/** /**
@ -65,7 +65,7 @@ public class DictTypeServiceImpl implements IDictTypeService
@Override @Override
public int batchDeleteDictType(Long[] ids) public int batchDeleteDictType(Long[] ids)
{ {
return dictTypeDao.batchDeleteDictType(ids); return dictTypeMapper.batchDeleteDictType(ids);
} }
/** /**
@ -81,12 +81,12 @@ public class DictTypeServiceImpl implements IDictTypeService
if (StringUtils.isNotNull(dictId)) if (StringUtils.isNotNull(dictId))
{ {
dictType.setUpdateBy(ShiroUtils.getLoginName()); dictType.setUpdateBy(ShiroUtils.getLoginName());
return dictTypeDao.updateDictType(dictType); return dictTypeMapper.updateDictType(dictType);
} }
else else
{ {
dictType.setCreateBy(ShiroUtils.getLoginName()); dictType.setCreateBy(ShiroUtils.getLoginName());
return dictTypeDao.insertDictType(dictType); return dictTypeMapper.insertDictType(dictType);
} }
} }
@ -104,7 +104,7 @@ public class DictTypeServiceImpl implements IDictTypeService
dict.setDictId(-1L); dict.setDictId(-1L);
} }
Long dictId = dict.getDictId(); Long dictId = dict.getDictId();
DictType dictType = dictTypeDao.checkDictTypeUnique(dict.getDictType()); DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId() != dictId) if (StringUtils.isNotNull(dictType) && dictType.getDictId() != dictId)
{ {
return UserConstants.NAME_NOT_UNIQUE; return UserConstants.NAME_NOT_UNIQUE;

View File

@ -68,7 +68,7 @@ public class MenuController extends BaseController
} }
if (menuService.deleteMenuById(menuId) > 0) if (menuService.deleteMenuById(menuId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -120,7 +120,7 @@ public class MenuController extends BaseController
{ {
if (menuService.saveMenu(menu) > 0) if (menuService.saveMenu(menu) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -2,14 +2,16 @@ package com.ruoyi.project.system.menu.domain;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_menu * sys_menu
* *
* @author ruoyi * @author ruoyi
*/ */
public class Menu public class Menu extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 菜单ID */ /** 菜单ID */
private Long menuId; private Long menuId;
/** 菜单名称 */ /** 菜单名称 */
@ -30,16 +32,6 @@ public class Menu
private String perms; private String perms;
/** 菜单图标 */ /** 菜单图标 */
private String icon; private String icon;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新时间 */
private String updateTime;
/** 更新者 */
private String updateBy;
/** 备注 */
private String remark;
/** 子菜单 */ /** 子菜单 */
private List<Menu> children = new ArrayList<Menu>(); private List<Menu> children = new ArrayList<Menu>();
@ -143,56 +135,6 @@ public class Menu
this.icon = icon; this.icon = icon;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public List<Menu> getChildren() public List<Menu> getChildren()
{ {
return children; return children;
@ -208,9 +150,7 @@ public class Menu
{ {
return "Menu [menuId=" + menuId + ", menuName=" + menuName + ", parentName=" + parentName + ", parentId=" return "Menu [menuId=" + menuId + ", menuName=" + menuName + ", parentName=" + parentName + ", parentId="
+ parentId + ", orderNum=" + orderNum + ", url=" + url + ", menuType=" + menuType + ", visible=" + parentId + ", orderNum=" + orderNum + ", url=" + url + ", menuType=" + menuType + ", visible="
+ visible + ", perms=" + perms + ", icon=" + icon + ", createBy=" + createBy + ", createTime=" + visible + ", perms=" + perms + ", icon=" + icon + ", children=" + children + "]";
+ createTime + ", updateTime=" + updateTime + ", updateBy=" + updateBy + ", remark=" + remark
+ ", children=" + children + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.menu.dao; package com.ruoyi.project.system.menu.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.menu.domain.Menu; import com.ruoyi.project.system.menu.domain.Menu;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.menu.domain.Menu;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IMenuDao public interface MenuMapper
{ {
/** /**

View File

@ -9,18 +9,16 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
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.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.TreeUtils; import com.ruoyi.common.utils.TreeUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.menu.dao.IMenuDao;
import com.ruoyi.project.system.menu.domain.Menu; import com.ruoyi.project.system.menu.domain.Menu;
import com.ruoyi.project.system.role.dao.IRoleMenuDao; import com.ruoyi.project.system.menu.mapper.MenuMapper;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
/** /**
* *
@ -33,10 +31,10 @@ public class MenuServiceImpl implements IMenuService
public static final String PREMISSION_STRING = "perms[\"{0}\"]"; public static final String PREMISSION_STRING = "perms[\"{0}\"]";
@Autowired @Autowired
private IMenuDao menuDao; private MenuMapper menuMapper;
@Autowired @Autowired
private IRoleMenuDao roleMenuDao; private RoleMenuMapper roleMenuMapper;
/** /**
* ID * ID
@ -47,7 +45,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public List<Menu> selectMenusByUserId(Long userId) public List<Menu> selectMenusByUserId(Long userId)
{ {
List<Menu> menus = menuDao.selectMenusByUserId(userId); List<Menu> menus = menuMapper.selectMenusByUserId(userId);
return TreeUtils.getChildPerms(menus, 0); return TreeUtils.getChildPerms(menus, 0);
} }
@ -59,7 +57,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public List<Menu> selectMenuAll() public List<Menu> selectMenuAll()
{ {
return menuDao.selectMenuAll(); return menuMapper.selectMenuAll();
} }
/** /**
@ -71,7 +69,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public Set<String> selectPermsByUserId(Long userId) public Set<String> selectPermsByUserId(Long userId)
{ {
List<String> perms = menuDao.selectPermsByUserId(userId); List<String> perms = menuMapper.selectPermsByUserId(userId);
Set<String> permsSet = new HashSet<>(); Set<String> permsSet = new HashSet<>();
for (String perm : perms) for (String perm : perms)
{ {
@ -94,10 +92,10 @@ public class MenuServiceImpl implements IMenuService
{ {
Long roleId = role.getRoleId(); Long roleId = role.getRoleId();
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<Menu> menuList = menuDao.selectMenuAll(); List<Menu> menuList = menuMapper.selectMenuAll();
if (StringUtils.isNotNull(roleId)) if (StringUtils.isNotNull(roleId))
{ {
List<String> roleMenuList = menuDao.selectMenuTree(roleId); List<String> roleMenuList = menuMapper.selectMenuTree(roleId);
trees = getTrees(menuList, true, roleMenuList, true); trees = getTrees(menuList, true, roleMenuList, true);
} }
else else
@ -117,7 +115,7 @@ public class MenuServiceImpl implements IMenuService
public List<Map<String, Object>> menuTreeData() public List<Map<String, Object>> menuTreeData()
{ {
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<Menu> menuList = menuDao.selectMenuAll(); List<Menu> menuList = menuMapper.selectMenuAll();
trees = getTrees(menuList, false, null, false); trees = getTrees(menuList, false, null, false);
return trees; return trees;
} }
@ -131,7 +129,7 @@ public class MenuServiceImpl implements IMenuService
public LinkedHashMap<String, String> selectPermsAll() public LinkedHashMap<String, String> selectPermsAll()
{ {
LinkedHashMap<String, String> section = new LinkedHashMap<>(); LinkedHashMap<String, String> section = new LinkedHashMap<>();
List<Menu> permissions = menuDao.selectMenuAll(); List<Menu> permissions = menuMapper.selectMenuAll();
if (StringUtils.isNotEmpty(permissions)) if (StringUtils.isNotEmpty(permissions))
{ {
for (Menu menu : permissions) for (Menu menu : permissions)
@ -194,7 +192,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public int deleteMenuById(Long menuId) public int deleteMenuById(Long menuId)
{ {
return menuDao.deleteMenuById(menuId); return menuMapper.deleteMenuById(menuId);
} }
/** /**
@ -206,7 +204,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public Menu selectMenuById(Long menuId) public Menu selectMenuById(Long menuId)
{ {
return menuDao.selectMenuById(menuId); return menuMapper.selectMenuById(menuId);
} }
/** /**
@ -218,7 +216,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public int selectCountMenuByParentId(Long parentId) public int selectCountMenuByParentId(Long parentId)
{ {
return menuDao.selectCountMenuByParentId(parentId); return menuMapper.selectCountMenuByParentId(parentId);
} }
/** /**
@ -230,7 +228,7 @@ public class MenuServiceImpl implements IMenuService
@Override @Override
public int selectCountRoleMenuByMenuId(Long menuId) public int selectCountRoleMenuByMenuId(Long menuId)
{ {
return roleMenuDao.selectCountRoleMenuByMenuId(menuId); return roleMenuMapper.selectCountRoleMenuByMenuId(menuId);
} }
/** /**
@ -246,12 +244,12 @@ public class MenuServiceImpl implements IMenuService
if (StringUtils.isNotNull(menuId)) if (StringUtils.isNotNull(menuId))
{ {
menu.setUpdateBy(ShiroUtils.getLoginName()); menu.setUpdateBy(ShiroUtils.getLoginName());
return menuDao.updateMenu(menu); return menuMapper.updateMenu(menu);
} }
else else
{ {
menu.setCreateBy(ShiroUtils.getLoginName()); menu.setCreateBy(ShiroUtils.getLoginName());
return menuDao.insertMenu(menu); return menuMapper.insertMenu(menu);
} }
} }
@ -265,7 +263,7 @@ public class MenuServiceImpl implements IMenuService
public String checkMenuNameUnique(Menu menu) public String checkMenuNameUnique(Menu menu)
{ {
Long menuId = menu.getMenuId(); Long menuId = menu.getMenuId();
Menu info = menuDao.checkMenuNameUnique(menu.getMenuName()); Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getMenuId()) if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getMenuId())
&& info.getMenuId().longValue() != menuId.longValue()) && info.getMenuId().longValue() != menuId.longValue())
{ {

View File

@ -44,7 +44,7 @@ public class PostController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(Post post) public TableDataInfo list(Post post)
{ {
setPageInfo(post); startPage();
List<Post> list = postService.selectPostList(post); List<Post> list = postService.selectPostList(post);
return getDataTable(list); return getDataTable(list);
} }
@ -69,7 +69,7 @@ public class PostController extends BaseController
} }
if (postService.deletePostById(postId) > 0) if (postService.deletePostById(postId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -83,7 +83,7 @@ public class PostController extends BaseController
int rows = postService.batchDeletePost(ids); int rows = postService.batchDeletePost(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -123,7 +123,7 @@ public class PostController extends BaseController
{ {
if (postService.savePost(post) > 0) if (postService.savePost(post) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,14 +1,15 @@
package com.ruoyi.project.system.post.domain; package com.ruoyi.project.system.post.domain;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* sys_post * sys_post
* *
* @author ruoyi * @author ruoyi
*/ */
public class Post extends PageDomain public class Post extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 岗位ID */ /** 岗位ID */
private Long postId; private Long postId;
/** 岗位编码 */ /** 岗位编码 */
@ -21,16 +22,6 @@ public class Post extends PageDomain
private int status; private int status;
/** 用户是否存在此岗位标识 默认不存在 */ /** 用户是否存在此岗位标识 默认不存在 */
private boolean flag = false; private boolean flag = false;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新时间 */
private String updateTime;
/** 更新者 */
private String updateBy;
/** 备注 */
private String remark;
public Long getPostId() public Long getPostId()
{ {
@ -92,62 +83,11 @@ public class Post extends PageDomain
this.flag = flag; this.flag = flag;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
@Override @Override
public String toString() public String toString()
{ {
return "Post [postId=" + postId + ", postCode=" + postCode + ", postName=" + postName + ", postSort=" + postSort return "Post [postId=" + postId + ", postCode=" + postCode + ", postName=" + postName + ", postSort=" + postSort
+ ", status=" + status + ", flag=" + flag + ", createBy=" + createBy + ", createTime=" + createTime + ", status=" + status + ", flag=" + flag + "]";
+ ", updateTime=" + updateTime + ", updateBy=" + updateBy + ", remark=" + remark + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.post.dao; package com.ruoyi.project.system.post.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.domain.Post;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.post.domain.Post;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IPostDao public interface PostMapper
{ {
/** /**

View File

@ -1,15 +1,13 @@
package com.ruoyi.project.system.post.service; 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.utils.StringUtils; 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.dao.IPostDao;
import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.domain.Post;
import com.ruoyi.project.system.user.dao.IUserPostDao; import com.ruoyi.project.system.post.mapper.PostMapper;
import com.ruoyi.project.system.user.mapper.UserPostMapper;
/** /**
* *
@ -20,10 +18,10 @@ import com.ruoyi.project.system.user.dao.IUserPostDao;
public class PostServiceImpl implements IPostService public class PostServiceImpl implements IPostService
{ {
@Autowired @Autowired
private IPostDao postDao; private PostMapper postMapper;
@Autowired @Autowired
private IUserPostDao userPostDao; private UserPostMapper userPostMapper;
/** /**
* *
@ -34,7 +32,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public List<Post> selectPostList(Post post) public List<Post> selectPostList(Post post)
{ {
return postDao.selectPostList(post); return postMapper.selectPostList(post);
} }
/** /**
@ -45,7 +43,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public List<Post> selectPostAll() public List<Post> selectPostAll()
{ {
return postDao.selectPostAll(); return postMapper.selectPostAll();
} }
/** /**
@ -57,8 +55,8 @@ public class PostServiceImpl implements IPostService
@Override @Override
public List<Post> selectPostsByUserId(Long userId) public List<Post> selectPostsByUserId(Long userId)
{ {
List<Post> userPosts = postDao.selectPostsByUserId(userId); List<Post> userPosts = postMapper.selectPostsByUserId(userId);
List<Post> posts = postDao.selectPostAll(); List<Post> posts = postMapper.selectPostAll();
for (Post post : posts) for (Post post : posts)
{ {
for (Post userRole : userPosts) for (Post userRole : userPosts)
@ -82,7 +80,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public Post selectPostById(Long postId) public Post selectPostById(Long postId)
{ {
return postDao.selectPostById(postId); return postMapper.selectPostById(postId);
} }
/** /**
@ -94,7 +92,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public int deletePostById(Long postId) public int deletePostById(Long postId)
{ {
return postDao.deletePostById(postId); return postMapper.deletePostById(postId);
} }
/** /**
@ -106,7 +104,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public int batchDeletePost(Long[] ids) public int batchDeletePost(Long[] ids)
{ {
return postDao.batchDeletePost(ids); return postMapper.batchDeletePost(ids);
} }
/** /**
@ -124,13 +122,13 @@ public class PostServiceImpl implements IPostService
{ {
post.setUpdateBy(ShiroUtils.getLoginName()); post.setUpdateBy(ShiroUtils.getLoginName());
// 修改岗位信息 // 修改岗位信息
count = postDao.updatePost(post); count = postMapper.updatePost(post);
} }
else else
{ {
post.setCreateBy(ShiroUtils.getLoginName()); post.setCreateBy(ShiroUtils.getLoginName());
// 新增岗位信息 // 新增岗位信息
count = postDao.insertPost(post); count = postMapper.insertPost(post);
} }
return count; return count;
} }
@ -144,7 +142,7 @@ public class PostServiceImpl implements IPostService
@Override @Override
public int selectCountPostById(Long postId) public int selectCountPostById(Long postId)
{ {
return userPostDao.selectCountPostById(postId); return userPostMapper.selectCountPostById(postId);
} }
} }

View File

@ -46,7 +46,7 @@ public class RoleController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(Role role) public TableDataInfo list(Role role)
{ {
setPageInfo(role); startPage();
List<Role> list = roleService.selectRoleList(role); List<Role> list = roleService.selectRoleList(role);
return getDataTable(list); return getDataTable(list);
} }
@ -87,7 +87,7 @@ public class RoleController extends BaseController
{ {
if (roleService.saveRole(role) > 0) if (roleService.saveRole(role) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -110,7 +110,7 @@ public class RoleController extends BaseController
} }
if (roleService.deleteRoleById(roleId) > 0) if (roleService.deleteRoleById(roleId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -124,7 +124,7 @@ public class RoleController extends BaseController
int rows = roleService.batchDeleteRole(ids); int rows = roleService.batchDeleteRole(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,16 +1,16 @@
package com.ruoyi.project.system.role.domain; package com.ruoyi.project.system.role.domain;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.framework.web.page.PageDomain;
/** /**
* sys_role * sys_role
* *
* @author ruoyi * @author ruoyi
*/ */
public class Role extends PageDomain public class Role extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 角色ID */ /** 角色ID */
private Long roleId; private Long roleId;
/** 角色名 */ /** 角色名 */
@ -21,16 +21,6 @@ public class Role extends PageDomain
private String roleSort; private String roleSort;
/** 角色状态:0正常,1禁用 */ /** 角色状态:0正常,1禁用 */
private int status; private int status;
/** 创建者 */
private String createBy;
/** 创建时间 */
private Date createTime;
/** 更新时间 */
private Date updateTime;
/** 更新者 */
private String updateBy;
/** 备注 */
private String remark;
/** 用户是否存在此角色标识 默认不存在 */ /** 用户是否存在此角色标识 默认不存在 */
private boolean flag = false; private boolean flag = false;
/** 菜单组 */ /** 菜单组 */
@ -86,56 +76,6 @@ public class Role extends PageDomain
this.status = status; this.status = status;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public boolean isFlag() public boolean isFlag()
{ {
return flag; return flag;
@ -160,9 +100,7 @@ public class Role extends PageDomain
public String toString() public String toString()
{ {
return "Role [roleId=" + roleId + ", roleName=" + roleName + ", roleKey=" + roleKey + ", roleSort=" + roleSort return "Role [roleId=" + roleId + ", roleName=" + roleName + ", roleKey=" + roleKey + ", roleSort=" + roleSort
+ ", status=" + status + ", createBy=" + createBy + ", createTime=" + createTime + ", updateTime=" + ", status=" + status + ", flag=" + flag + ", menuIds=" + Arrays.toString(menuIds) + "]";
+ updateTime + ", updateBy=" + updateBy + ", remark=" + remark + ", flag=" + flag + ", menuIds="
+ Arrays.toString(menuIds) + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.role.dao; package com.ruoyi.project.system.role.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.role.domain.Role;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IRoleDao public interface RoleMapper
{ {
/** /**

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.role.dao; package com.ruoyi.project.system.role.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.role.domain.RoleMenu; import com.ruoyi.project.system.role.domain.RoleMenu;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.role.domain.RoleMenu;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IRoleMenuDao public interface RoleMenuMapper
{ {
/** /**

View File

@ -5,18 +5,16 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
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.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;
import com.ruoyi.project.system.role.dao.IRoleDao;
import com.ruoyi.project.system.role.dao.IRoleMenuDao;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.role.domain.RoleMenu; import com.ruoyi.project.system.role.domain.RoleMenu;
import com.ruoyi.project.system.user.dao.IUserRoleDao; import com.ruoyi.project.system.role.mapper.RoleMapper;
import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
import com.ruoyi.project.system.user.mapper.UserRoleMapper;
/** /**
* *
@ -28,13 +26,13 @@ public class RoleServiceImpl implements IRoleService
{ {
@Autowired @Autowired
private IRoleDao roleDao; private RoleMapper roleMapper;
@Autowired @Autowired
private IRoleMenuDao roleMenuDao; private RoleMenuMapper roleMenuMapper;
@Autowired @Autowired
private IUserRoleDao userRoleDao; private UserRoleMapper userRoleMapper;
/** /**
* *
@ -45,7 +43,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public List<Role> selectRoleList(Role role) public List<Role> selectRoleList(Role role)
{ {
return roleDao.selectRoleList(role); return roleMapper.selectRoleList(role);
} }
/** /**
@ -57,7 +55,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public Set<String> selectRoleKeys(Long userId) public Set<String> selectRoleKeys(Long userId)
{ {
List<Role> perms = roleDao.selectRolesByUserId(userId); List<Role> perms = roleMapper.selectRolesByUserId(userId);
Set<String> permsSet = new HashSet<>(); Set<String> permsSet = new HashSet<>();
for (Role perm : perms) for (Role perm : perms)
{ {
@ -78,8 +76,8 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public List<Role> selectRolesByUserId(Long userId) public List<Role> selectRolesByUserId(Long userId)
{ {
List<Role> userRoles = roleDao.selectRolesByUserId(userId); List<Role> userRoles = roleMapper.selectRolesByUserId(userId);
List<Role> roles = roleDao.selectRolesAll(); List<Role> roles = roleMapper.selectRolesAll();
for (Role role : roles) for (Role role : roles)
{ {
for (Role userRole : userRoles) for (Role userRole : userRoles)
@ -102,7 +100,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public List<Role> selectRoleAll() public List<Role> selectRoleAll()
{ {
return roleDao.selectRolesAll(); return roleMapper.selectRolesAll();
} }
/** /**
@ -114,7 +112,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public Role selectRoleById(Long roleId) public Role selectRoleById(Long roleId)
{ {
return roleDao.selectRoleById(roleId); return roleMapper.selectRoleById(roleId);
} }
/** /**
@ -126,8 +124,8 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public int deleteRoleById(Long roleId) public int deleteRoleById(Long roleId)
{ {
roleMenuDao.deleteRoleMenuByRoleId(roleId); roleMenuMapper.deleteRoleMenuByRoleId(roleId);
return roleDao.deleteRoleById(roleId); return roleMapper.deleteRoleById(roleId);
} }
/** /**
@ -139,8 +137,8 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public int batchDeleteRole(Long[] ids) public int batchDeleteRole(Long[] ids)
{ {
roleMenuDao.deleteRoleMenu(ids); roleMenuMapper.deleteRoleMenu(ids);
return roleDao.batchDeleteRole(ids); return roleMapper.batchDeleteRole(ids);
} }
/** /**
@ -157,15 +155,15 @@ public class RoleServiceImpl implements IRoleService
{ {
role.setUpdateBy(ShiroUtils.getLoginName()); role.setUpdateBy(ShiroUtils.getLoginName());
// 修改角色信息 // 修改角色信息
roleDao.updateRole(role); roleMapper.updateRole(role);
// 删除角色与菜单关联 // 删除角色与菜单关联
roleMenuDao.deleteRoleMenuByRoleId(roleId); roleMenuMapper.deleteRoleMenuByRoleId(roleId);
} }
else else
{ {
role.setCreateBy(ShiroUtils.getLoginName()); role.setCreateBy(ShiroUtils.getLoginName());
// 新增角色信息 // 新增角色信息
roleDao.insertRole(role); roleMapper.insertRole(role);
} }
return insertRoleMenu(role); return insertRoleMenu(role);
} }
@ -189,7 +187,7 @@ public class RoleServiceImpl implements IRoleService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
rows = roleMenuDao.batchRoleMenu(list); rows = roleMenuMapper.batchRoleMenu(list);
} }
return rows; return rows;
} }
@ -204,7 +202,7 @@ public class RoleServiceImpl implements IRoleService
public String checkRoleNameUnique(Role role) public String checkRoleNameUnique(Role role)
{ {
Long roleId = role.getRoleId(); Long roleId = role.getRoleId();
Role info = roleDao.checkRoleNameUnique(role.getRoleName()); Role info = roleMapper.checkRoleNameUnique(role.getRoleName());
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getRoleId()) && info.getRoleId() != roleId) if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getRoleId()) && info.getRoleId() != roleId)
{ {
return UserConstants.NAME_NOT_UNIQUE; return UserConstants.NAME_NOT_UNIQUE;
@ -221,7 +219,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public int selectCountUserRoleByRoleId(Long roleId) public int selectCountUserRoleByRoleId(Long roleId)
{ {
return userRoleDao.selectCountUserRoleByRoleId(roleId); return userRoleMapper.selectCountUserRoleByRoleId(roleId);
} }
} }

View File

@ -0,0 +1,123 @@
package com.ruoyi.project.system.user.controller;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import com.ruoyi.framework.web.domain.Message;
/**
*
* @author ruoyi
*/
@Controller
@RequestMapping("/captcha")
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
/**
*
*/
@RequestMapping(value = "/captchaImage")
public ModelAndView getKaptchaImage(HttpServletRequest request, HttpServletResponse response)
{
ServletOutputStream out = null;
try
{
HttpSession session = request.getSession();
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
response.setContentType("image/jpeg");
String type = request.getParameter("type");
String capStr = null;
String code = null;
BufferedImage bi = null;
if ("math".equals(type))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
bi = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(type))
{
capStr = code = captchaProducer.createText();
bi = captchaProducer.createImage(capStr);
}
session.setAttribute(Constants.KAPTCHA_SESSION_KEY, code);
out = response.getOutputStream();
ImageIO.write(bi, "jpg", out);
out.flush();
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if (out != null)
{
out.close();
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
return null;
}
/**
* @Desc
* @param kaptchaCode
* @param request
* @return
* @author YY<20171031>
*/
@RequestMapping("/captchaVerify")
@ResponseBody
public Message captchaVerify(String kaptchaCode, HttpServletRequest request)
{
try
{
HttpSession session = request.getSession();
Object obj = session.getAttribute(Constants.KAPTCHA_SESSION_KEY);
String code = String.valueOf(obj != null ? obj : "");
if (StringUtils.isNotBlank(kaptchaCode) && kaptchaCode.equalsIgnoreCase(code))
{
return Message.success("验证码正确");
}
}
catch (Exception e)
{
e.printStackTrace();
return Message.error("系统错误:" + e.getMessage());
}
return Message.error("验证码错误");
}
}

View File

@ -29,14 +29,14 @@ public class LoginController extends BaseController
@PostMapping("/login") @PostMapping("/login")
@ResponseBody @ResponseBody
public Message ajaxLogin(String username, String password) public Message ajaxLogin(String username, String password, Boolean rememberMe)
{ {
UsernamePasswordToken token = new UsernamePasswordToken(username, password); UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe);
Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
try try
{ {
subject.login(token); subject.login(token);
return Message.ok(); return Message.success();
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {

View File

@ -1,6 +1,8 @@
package com.ruoyi.project.system.user.controller; package com.ruoyi.project.system.user.controller;
import org.apache.shiro.crypto.hash.Md5Hash; import org.apache.shiro.crypto.hash.Md5Hash;
import org.slf4j.Logger;
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.Model;
@ -8,7 +10,10 @@ 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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.utils.FileUploadUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.Message; import com.ruoyi.framework.web.domain.Message;
@ -24,6 +29,8 @@ import com.ruoyi.project.system.user.service.IUserService;
@RequestMapping("/system/user/profile") @RequestMapping("/system/user/profile")
public class ProfileController extends BaseController public class ProfileController extends BaseController
{ {
private static final Logger log = LoggerFactory.getLogger(ProfileController.class);
private String prefix = "system/user/profile"; private String prefix = "system/user/profile";
@Autowired @Autowired
@ -84,7 +91,7 @@ public class ProfileController extends BaseController
if (rows > 0) if (rows > 0)
{ {
setUser(userService.selectUserById(user.getUserId())); setUser(userService.selectUserById(user.getUserId()));
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -101,6 +108,18 @@ public class ProfileController extends BaseController
return prefix + "/edit"; return prefix + "/edit";
} }
/**
*
*/
@Log(title = "系统管理", action = "个人信息-修改头像")
@GetMapping("/avatar/{userId}")
public String avatar(@PathVariable("userId") Long userId, Model model)
{
User user = userService.selectUserById(userId);
model.addAttribute("user", user);
return prefix + "/avatar";
}
/** /**
* *
*/ */
@ -112,8 +131,37 @@ public class ProfileController extends BaseController
if (userService.updateUser(user) > 0) if (userService.updateUser(user) > 0)
{ {
setUser(userService.selectUserById(user.getUserId())); setUser(userService.selectUserById(user.getUserId()));
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
/**
*
*/
@Log(title = "系统管理", action = "个人信息-保存头像")
@PostMapping("/updateAvatar")
@ResponseBody
public Message updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file)
{
try
{
if (!file.isEmpty())
{
String avatar = FileUploadUtils.upload(file);
user.setAvatar(avatar);
if (userService.updateUser(user) > 0)
{
setUser(userService.selectUserById(user.getUserId()));
return Message.success();
}
}
return Message.error();
}
catch (Exception e)
{
log.error("updateAvatar failed!", e);
return Message.error(e.getMessage());
}
}
} }

View File

@ -56,7 +56,7 @@ public class UserController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(User user) public TableDataInfo list(User user)
{ {
setPageInfo(user); startPage();
List<User> list = userService.selectUserList(user); List<User> list = userService.selectUserList(user);
return getDataTable(list); return getDataTable(list);
} }
@ -112,7 +112,7 @@ public class UserController extends BaseController
int rows = userService.resetUserPwd(user); int rows = userService.resetUserPwd(user);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -131,7 +131,7 @@ public class UserController extends BaseController
} }
if (userService.deleteUserById(userId) > 0) if (userService.deleteUserById(userId) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -146,7 +146,7 @@ public class UserController extends BaseController
int rows = userService.batchDeleteUser(ids); int rows = userService.batchDeleteUser(ids);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }
@ -163,7 +163,7 @@ public class UserController extends BaseController
{ {
if (userService.saveUser(user) > 0) if (userService.saveUser(user) > 0)
{ {
return Message.ok(); return Message.success();
} }
return Message.error(); return Message.error();
} }

View File

@ -1,10 +1,8 @@
package com.ruoyi.project.system.user.domain; package com.ruoyi.project.system.user.domain;
import java.util.Arrays; import java.util.Arrays;
import org.apache.shiro.crypto.SecureRandomNumberGenerator; import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.framework.web.page.PageDomain;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
/** /**
@ -12,8 +10,9 @@ import com.ruoyi.project.system.dept.domain.Dept;
* *
* @author ruoyi * @author ruoyi
*/ */
public class User extends PageDomain public class User extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 用户ID */ /** 用户ID */
private Long userId; private Long userId;
/** 部门ID */ /** 部门ID */
@ -42,14 +41,6 @@ public class User extends PageDomain
private int status; private int status;
/** 拒绝登录描述 */ /** 拒绝登录描述 */
private String refuseDes; private String refuseDes;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private String updateTime;
/** 部门对象 */ /** 部门对象 */
private Dept dept; private Dept dept;
/** 角色组 */ /** 角色组 */
@ -208,46 +199,6 @@ public class User extends PageDomain
this.refuseDes = refuseDes; this.refuseDes = refuseDes;
} }
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public Dept getDept() public Dept getDept()
{ {
return dept; return dept;
@ -282,11 +233,10 @@ public class User extends PageDomain
public String toString() public String toString()
{ {
return "User [userId=" + userId + ", deptId=" + deptId + ", parentId=" + parentId + ", loginName=" + loginName return "User [userId=" + userId + ", deptId=" + deptId + ", parentId=" + parentId + ", loginName=" + loginName
+ ", userName=" + userName + ", email=" + email + ", phonenumber=" + phonenumber + ", password=" + ", userName=" + userName + ", email=" + email + ", phonenumber=" + phonenumber + ", sex=" + sex
+ password + ", salt=" + salt + ", userType=" + userType + ", status=" + status + ", refuseDes=" + ", avatar=" + avatar + ", password=" + password + ", salt=" + salt + ", userType=" + userType
+ refuseDes + ", createBy=" + createBy + ", createTime=" + createTime + ", updateBy=" + updateBy + ", status=" + status + ", refuseDes=" + refuseDes + ", dept=" + dept + ", roleIds="
+ ", updateTime=" + updateTime + ", dept=" + dept + ", roleIds=" + Arrays.toString(roleIds) + Arrays.toString(roleIds) + ", postIds=" + Arrays.toString(postIds) + "]";
+ ", postIds=" + Arrays.toString(postIds) + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.user.dao; package com.ruoyi.project.system.user.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.user.domain.User;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IUserDao public interface UserMapper
{ {
/** /**

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.user.dao; package com.ruoyi.project.system.user.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.user.domain.UserPost; import com.ruoyi.project.system.user.domain.UserPost;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.user.domain.UserPost;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IUserPostDao public interface UserPostMapper
{ {
/** /**

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.user.dao; package com.ruoyi.project.system.user.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.system.user.domain.UserRole; import com.ruoyi.project.system.user.domain.UserRole;
@ -8,7 +8,7 @@ import com.ruoyi.project.system.user.domain.UserRole;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IUserRoleDao public interface UserRoleMapper
{ {
/** /**

View File

@ -58,7 +58,7 @@ public interface IUserService
* @return * @return
*/ */
public int saveUser(User user); public int saveUser(User user);
/** /**
* *
* *

View File

@ -2,24 +2,22 @@ package com.ruoyi.project.system.user.service;
import java.util.ArrayList; import java.util.ArrayList;
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.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;
import com.ruoyi.framework.shiro.service.PasswordService; import com.ruoyi.framework.shiro.service.PasswordService;
import com.ruoyi.project.system.post.dao.IPostDao;
import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.domain.Post;
import com.ruoyi.project.system.role.dao.IRoleDao; import com.ruoyi.project.system.post.mapper.PostMapper;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.user.dao.IUserDao; import com.ruoyi.project.system.role.mapper.RoleMapper;
import com.ruoyi.project.system.user.dao.IUserPostDao;
import com.ruoyi.project.system.user.dao.IUserRoleDao;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
import com.ruoyi.project.system.user.domain.UserPost; import com.ruoyi.project.system.user.domain.UserPost;
import com.ruoyi.project.system.user.domain.UserRole; import com.ruoyi.project.system.user.domain.UserRole;
import com.ruoyi.project.system.user.mapper.UserMapper;
import com.ruoyi.project.system.user.mapper.UserPostMapper;
import com.ruoyi.project.system.user.mapper.UserRoleMapper;
/** /**
* *
@ -31,19 +29,19 @@ public class UserServiceImpl implements IUserService
{ {
@Autowired @Autowired
private IUserDao userDao; private UserMapper userMapper;
@Autowired @Autowired
private IRoleDao roleDao; private RoleMapper roleMapper;
@Autowired @Autowired
private IPostDao postDao; private PostMapper postMapper;
@Autowired @Autowired
private IUserPostDao userPostDao; private UserPostMapper userPostMapper;
@Autowired @Autowired
private IUserRoleDao userRoleDao; private UserRoleMapper userRoleMapper;
@Autowired @Autowired
private PasswordService passwordService; private PasswordService passwordService;
@ -58,7 +56,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public List<User> selectUserList(User user) public List<User> selectUserList(User user)
{ {
return userDao.selectUserList(user); return userMapper.selectUserList(user);
} }
/** /**
@ -70,7 +68,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public User selectUserByName(String userName) public User selectUserByName(String userName)
{ {
return userDao.selectUserByName(userName); return userMapper.selectUserByName(userName);
} }
/** /**
@ -82,7 +80,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public User selectUserById(Long userId) public User selectUserById(Long userId)
{ {
return userDao.selectUserById(userId); return userMapper.selectUserById(userId);
} }
/** /**
@ -95,10 +93,10 @@ public class UserServiceImpl implements IUserService
public int deleteUserById(Long userId) public int deleteUserById(Long userId)
{ {
// 删除用户与角色关联 // 删除用户与角色关联
userRoleDao.deleteUserRoleByUserId(userId); userRoleMapper.deleteUserRoleByUserId(userId);
// 删除用户与岗位表 // 删除用户与岗位表
userPostDao.deleteUserPostByUserId(userId); userPostMapper.deleteUserPostByUserId(userId);
return userDao.deleteUserById(userId); return userMapper.deleteUserById(userId);
} }
/** /**
@ -110,9 +108,9 @@ public class UserServiceImpl implements IUserService
@Override @Override
public int batchDeleteUser(Long[] ids) public int batchDeleteUser(Long[] ids)
{ {
userRoleDao.deleteUserRole(ids); userRoleMapper.deleteUserRole(ids);
userPostDao.deleteUserPost(ids); userPostMapper.deleteUserPost(ids);
return userDao.batchDeleteUser(ids); return userMapper.batchDeleteUser(ids);
} }
/** /**
@ -130,13 +128,13 @@ public class UserServiceImpl implements IUserService
{ {
user.setUpdateBy(ShiroUtils.getLoginName()); user.setUpdateBy(ShiroUtils.getLoginName());
// 修改用户信息 // 修改用户信息
count = userDao.updateUser(user); count = userMapper.updateUser(user);
// 删除用户与角色关联 // 删除用户与角色关联
userRoleDao.deleteUserRoleByUserId(userId); userRoleMapper.deleteUserRoleByUserId(userId);
// 新增用户与角色管理 // 新增用户与角色管理
insertUserRole(user); insertUserRole(user);
// 删除用户与岗位关联 // 删除用户与岗位关联
userPostDao.deleteUserPostByUserId(userId); userPostMapper.deleteUserPostByUserId(userId);
// 新增用户与岗位管理 // 新增用户与岗位管理
insertUserPost(user); insertUserPost(user);
@ -147,7 +145,7 @@ public class UserServiceImpl implements IUserService
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
user.setCreateBy(ShiroUtils.getLoginName()); user.setCreateBy(ShiroUtils.getLoginName());
// 新增用户信息 // 新增用户信息
count = userDao.insertUser(user); count = userMapper.insertUser(user);
// 新增用户岗位关联 // 新增用户岗位关联
insertUserPost(user); insertUserPost(user);
// 新增用户与角色管理 // 新增用户与角色管理
@ -165,7 +163,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public int updateUser(User user) public int updateUser(User user)
{ {
return userDao.updateUser(user); return userMapper.updateUser(user);
} }
/** /**
@ -179,7 +177,7 @@ public class UserServiceImpl implements IUserService
{ {
user.randomSalt(); user.randomSalt();
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
return userDao.updateUser(user); return userMapper.updateUser(user);
} }
/** /**
@ -200,7 +198,7 @@ public class UserServiceImpl implements IUserService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
userRoleDao.batchUserRole(list); userRoleMapper.batchUserRole(list);
} }
} }
@ -222,7 +220,7 @@ public class UserServiceImpl implements IUserService
} }
if (list.size() > 0) if (list.size() > 0)
{ {
userPostDao.batchUserPost(list); userPostMapper.batchUserPost(list);
} }
} }
@ -235,7 +233,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public String checkUserNameUnique(String loginName) public String checkUserNameUnique(String loginName)
{ {
int count = userDao.checkUserNameUnique(loginName); int count = userMapper.checkUserNameUnique(loginName);
if (count > 0) if (count > 0)
{ {
return UserConstants.NAME_NOT_UNIQUE; return UserConstants.NAME_NOT_UNIQUE;
@ -252,7 +250,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public String selectUserRoleGroup(Long userId) public String selectUserRoleGroup(Long userId)
{ {
List<Role> list = roleDao.selectRolesByUserId(userId); List<Role> list = roleMapper.selectRolesByUserId(userId);
StringBuffer idsStr = new StringBuffer(); StringBuffer idsStr = new StringBuffer();
for (Role role : list) for (Role role : list)
{ {
@ -274,7 +272,7 @@ public class UserServiceImpl implements IUserService
@Override @Override
public String selectUserPostGroup(Long userId) public String selectUserPostGroup(Long userId)
{ {
List<Post> list = postDao.selectPostsByUserId(userId); List<Post> list = postMapper.selectPostsByUserId(userId);
StringBuffer idsStr = new StringBuffer(); StringBuffer idsStr = new StringBuffer();
for (Post post : list) for (Post post : list)
{ {

View File

@ -44,7 +44,7 @@ public class GenController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(TableInfo tableInfo) public TableDataInfo list(TableInfo tableInfo)
{ {
setPageInfo(tableInfo); startPage();
List<TableInfo> list = genService.selectTableList(tableInfo); List<TableInfo> list = genService.selectTableList(tableInfo);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -1,29 +1,24 @@
package com.ruoyi.project.tool.gen.domain; package com.ruoyi.project.tool.gen.domain;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.domain.BaseEntity;
/** /**
* ry * ry
* *
* @author ruoyi * @author ruoyi
*/ */
public class TableInfo extends PageDomain public class TableInfo extends BaseEntity
{ {
private static final long serialVersionUID = 1L;
/** 表名称 */ /** 表名称 */
private String tableName; private String tableName;
/** 表描述 */ /** 表描述 */
private String tableComment; private String tableComment;
/** 表创建时间 */
private String createTime;
/** 表更新时间 */
private String updateTime;
/** 表的主键列信息 */ /** 表的主键列信息 */
private ColumnInfo primaryKey; private ColumnInfo primaryKey;
@ -56,26 +51,6 @@ public class TableInfo extends PageDomain
this.tableComment = tableComment; this.tableComment = tableComment;
} }
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}
public List<ColumnInfo> getColumns() public List<ColumnInfo> getColumns()
{ {
return columns; return columns;
@ -129,8 +104,8 @@ public class TableInfo extends PageDomain
@Override @Override
public String toString() public String toString()
{ {
return "Gen [tableName=" + tableName + ", tableComment=" + tableComment + ", createTime=" + createTime return "TableInfo [tableName=" + tableName + ", tableComment=" + tableComment + ", primaryKey=" + primaryKey
+ ", updateTime=" + updateTime + "]"; + ", columns=" + columns + ", className=" + className + ", classname=" + classname + "]";
} }
} }

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.tool.gen.dao; package com.ruoyi.project.tool.gen.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.project.tool.gen.domain.ColumnInfo; import com.ruoyi.project.tool.gen.domain.ColumnInfo;
@ -9,7 +9,7 @@ import com.ruoyi.project.tool.gen.domain.TableInfo;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface IGenDao public interface GenMapper
{ {
/** /**
* ry * ry

View File

@ -15,9 +15,9 @@ import org.springframework.stereotype.Service;
import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.config.GenConfig; import com.ruoyi.framework.config.GenConfig;
import com.ruoyi.project.tool.gen.dao.IGenDao;
import com.ruoyi.project.tool.gen.domain.ColumnInfo; import com.ruoyi.project.tool.gen.domain.ColumnInfo;
import com.ruoyi.project.tool.gen.domain.TableInfo; import com.ruoyi.project.tool.gen.domain.TableInfo;
import com.ruoyi.project.tool.gen.mapper.GenMapper;
import com.ruoyi.project.tool.gen.util.GenUtils; import com.ruoyi.project.tool.gen.util.GenUtils;
import com.ruoyi.project.tool.gen.util.VelocityInitializer; import com.ruoyi.project.tool.gen.util.VelocityInitializer;
@ -30,7 +30,7 @@ import com.ruoyi.project.tool.gen.util.VelocityInitializer;
public class GenServiceImpl implements IGenService public class GenServiceImpl implements IGenService
{ {
@Autowired @Autowired
private IGenDao genDao; private GenMapper genMapper;
/** /**
* ry * ry
@ -41,7 +41,7 @@ public class GenServiceImpl implements IGenService
@Override @Override
public List<TableInfo> selectTableList(TableInfo tableInfo) public List<TableInfo> selectTableList(TableInfo tableInfo)
{ {
return genDao.selectTableList(tableInfo); return genMapper.selectTableList(tableInfo);
} }
/** /**
@ -56,9 +56,9 @@ public class GenServiceImpl implements IGenService
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream); ZipOutputStream zip = new ZipOutputStream(outputStream);
// 查询表信息 // 查询表信息
TableInfo table = genDao.selectTableByName(tableName); TableInfo table = genMapper.selectTableByName(tableName);
// 查询列信息 // 查询列信息
List<ColumnInfo> columns = genDao.selectTableColumnsByName(tableName); List<ColumnInfo> columns = genMapper.selectTableColumnsByName(tableName);
// 生成代码 // 生成代码
generatorCode(table, columns, zip); generatorCode(table, columns, zip);
IOUtils.closeQuietly(zip); IOUtils.closeQuietly(zip);
@ -79,9 +79,9 @@ public class GenServiceImpl implements IGenService
for (String tableName : tableNames) for (String tableName : tableNames)
{ {
// 查询表信息 // 查询表信息
TableInfo table = genDao.selectTableByName(tableName); TableInfo table = genMapper.selectTableByName(tableName);
// 查询列信息 // 查询列信息
List<ColumnInfo> columns = genDao.selectTableColumnsByName(tableName); List<ColumnInfo> columns = genMapper.selectTableColumnsByName(tableName);
// 生成代码 // 生成代码
generatorCode(table, columns, zip); generatorCode(table, columns, zip);
} }

View File

@ -85,7 +85,7 @@ public class GenUtils
{ {
List<String> templates = new ArrayList<String>(); List<String> templates = new ArrayList<String>();
templates.add("templates/vm/java/domain.java.vm"); templates.add("templates/vm/java/domain.java.vm");
templates.add("templates/vm/java/Dao.java.vm"); templates.add("templates/vm/java/Mapper.java.vm");
templates.add("templates/vm/java/Service.java.vm"); templates.add("templates/vm/java/Service.java.vm");
templates.add("templates/vm/java/ServiceImpl.java.vm"); templates.add("templates/vm/java/ServiceImpl.java.vm");
templates.add("templates/vm/java/Controller.java.vm"); templates.add("templates/vm/java/Controller.java.vm");
@ -140,9 +140,9 @@ public class GenUtils
return javaPath + "domain" + "/" + className + ".java"; return javaPath + "domain" + "/" + className + ".java";
} }
if (template.contains("Dao.java.vm")) if (template.contains("Mapper.java.vm"))
{ {
return javaPath + "dao" + "/" + "I" + className + "Dao.java"; return javaPath + "mapper" + "/" + "I" + className + "Mapper.java";
} }
if (template.contains("Service.java.vm")) if (template.contains("Service.java.vm"))

View File

@ -1,8 +1,9 @@
# 项目名称、版本、版权年份 # 项目名称、版本、版权年份
ruoyi: ruoyi:
name: RuoYi name: RuoYi
version: 1.1.2 version: 1.1.3
copyrightYear: 2018 copyrightYear: 2018
profile: D:/profile/
#开发环境配置 #开发环境配置
server: server:
@ -64,6 +65,19 @@ shiro:
unauthorizedUrl: /unauth unauthorizedUrl: /unauth
# 首页地址 # 首页地址
indexUrl: /index indexUrl: /index
# 验证码开关
captchaEbabled: true
# 验证码类型 math 数组计算 char 字符
captchaType: math
cookie:
# 设置Cookie的域名 默认空,即当前访问的域名
domain:
# 设置cookie的有效访问路径
path: /
# 设置HttpOnly属性
httpOnly: true
# 设置Cookie的过期时间天为单位
maxAge: 30
session: session:
# Session超时时间默认30分钟 # Session超时时间默认30分钟
expireTime: 30 expireTime: 30

View File

@ -1,5 +1,6 @@
#错误消息 #错误消息
not.null=* 必须填写 not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.not.exists=用户不存在/密码错误 user.not.exists=用户不存在/密码错误
user.password.not.match=用户不存在/密码错误 user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次,{1} user.password.retry.limit.count=密码输入错误{0}次,{1}
@ -13,8 +14,6 @@ length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成且必须以非数字开头 user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成且必须以非数字开头
user.password.not.valid=* 5-50个字符 user.password.not.valid=* 5-50个字符
user.jcaptcha.error=验证码错误
user.email.not.valid=邮箱格式错误 user.email.not.valid=邮箱格式错误
user.mobile.phone.number.not.valid=手机号格式错误 user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功 user.login.success=登录成功

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