ruoyi前后分离版3.8.2+flowable6.7.0整合
- 先看看效果
- 下载若依前后分离版本 https://gitee.com/y_project/RuoYi-Vue
-
下载ruoyi-flowable模块
链接:https://pan.baidu.com/s/1s0Tc5zLzUWwCgec6caIU0A
提取码:ruoy
-
解压ruoyi-flowable压缩包,把ruoyi-flowable模块复制到ruoyi项目里面
-
ruoyi项目pom.xml文件添加ruoyi-flowable引入
<!-- flowable--> <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-flowable</artifactId> <version>${ruoyi.version}</version> </dependency>
<module>ruoyi-common</module>
-
ruoyi-admin模块入口pom.xml引入ruoyi-flowable
<!-- flowable 工作流--> <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-flowable</artifactId> </dependency>
- ruoyi-admin模块application.yml文件添加flowable项目文件扫描
,classpath*:/META-INF/modeler-mybatis-mappings/*.xml - ruoyi-admin模块application.yml文件添加flowable配置信息
#flowable
flowable:
#关闭定时任务JOB
async-executor-activate: false
# 将databaseSchemaUpdate设置为true。当Flowable发现库与数据库表结构不一致时,会自动将数据库表结构升级至新版本。
database-schema-update: true
labelFontName: 宋体
activityFontName: 宋体
annotationFontName: 宋体 - ruoyi-admin模块mybatis-config.xml文件添加properties配置信息用于扫描得工作流得mybatis文件
<properties>
<property name="blobType" value="BLOB"/>
<property name="boolValue" value="TRUE"/>
<property name="prefix" value=""/>
</properties>
-
ruoyi-admin模块启动类排除flowable自动加载类
, FlowableUiSecurityAutoConfiguration.class - ruoyi-framework模块security配置文件,放开flowable请求
.antMatchers(
HttpMethod.GET,
"/",
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/profile/**",
"/**/*.map",
"/**/*.woff",
"/**/*.ttf",
"/**/*.json",
"/**/*.jpg",
"/**/*.png"
).permitAll()
//flowable
.antMatchers("/app/rest/models/**").permitAll()
.antMatchers("/rest/models/**").permitAll()
.antMatchers("/flowable-task/**").permitAll()//flowable
-
运行项目
flowable配置database-schema-update: true自动生成表(第7步)
启动成功之后,生成对应得flowable表,关闭项目
使用ruoyi用户表替换flowable表,替换之后重新运行-- 用户表
drop VIEW if exists ACT_ID_USER;
CREATE VIEW ACT_ID_USER AS
SELECT
SU.user_name AS ID_,
1 AS REV_,
SU.user_name AS FIRST_,
SU.nick_name AS LAST_ ,
'123456' AS PWD_ ,
SU.email AS EMAIL_,
SU.avatar AS PICTURE_ID_
FROM SYS_USER AS SU;
-- 分组表
drop VIEW if exists ACT_ID_GROUP;
CREATE VIEW ACT_ID_GROUP AS
SELECT
SR.role_id AS ID_ ,
1 AS REV_,
SR.role_name AS NAME_,
SR.role_key as TYPE_
FROM
SYS_ROLE AS SR;
-- 关系表
drop VIEW if exists ACT_ID_MEMBERSHIP;
CREATE VIEW ACT_ID_MEMBERSHIP AS
SELECT
SUR.user_id AS USER_ID_,
SUR.role_id AS GROUP_ID_
FROM SYS_USER_ROLE AS SUR;
- 解压flowable压缩包,复制到ruoyi-ui\src\views目录下面
- 启动前端项目
数据库插入菜单数据--flowable
INSERT INTO `sys_menu` VALUES (2000, '流程管理', 0, 4, 'flowable', NULL, NULL, 1, 0, 'M', '0', '0', '', 'user', 'admin', '2021-10-29 16:14:27', 'admin', '2021-10-29 16:16:52', '');
INSERT INTO `sys_menu` VALUES (2001, '流程定义', 2000, 1, 'flowable_modeler', 'flowable/modeler/index', NULL, 1, 0, 'C', '0', '0', '', 'dict', 'admin', '2021-10-29 16:15:20', 'admin', '2021-11-02 09:24:59', '');
INSERT INTO `sys_menu` VALUES (2002, '流程任务', 2000, 2, 'flowable_task', 'flowable/task/index', NULL, 1, 0, 'C', '0', '0', '', 'build', 'admin', '2021-11-02 09:25:40', 'admin', '2021-11-02 09:25:49', '');
- 运行成功
qq_41423757: 成功了,但现在不用这套了,自己开发
shangaomei3929: 最后成功没
qq_41423757: /rest/models 404
逸之@: 后端缺失代码吧
heycat77: 大佬,删表那里table写成tabke了