把开源项目dingding-mid-business-java集成到若依前后端分离版

发布时间:2024年01月03日

开源项目地址
dingding-mid 中国式传统流程引擎开源标杆(Activiti 567 Flowable 56,Camunda7 )

1、先在若依下新建一个子模块,参考若依官方文档 新建子模块

2、把开源项目整个复制到子模块,大概就是下图的样子
在这里插入图片描述

3、根目录pom.xml 文件,主要是增加了工作流模子模块和okhttp。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	
    <groupId>com.qilaike</groupId>
    <artifactId>qilaike</artifactId>
    <version>3.8.6</version>

    <name>qilaike</name>
    <url>http://www.ruoyi.vip</url>
    
    <properties>
        <qilaike.version>3.8.6</qilaike.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
        <druid.version>1.2.16</druid.version>
        <bitwalker.version>1.21</bitwalker.version>
        <swagger.version>3.0.0</swagger.version>
        <kaptcha.version>2.3.3</kaptcha.version>
        <pagehelper.boot.version>1.4.6</pagehelper.boot.version>
        <fastjson.version>2.0.39</fastjson.version>
        <oshi.version>6.4.4</oshi.version>
        <commons.io.version>2.13.0</commons.io.version>
        <commons.collections.version>3.2.2</commons.collections.version>
        <poi.version>4.1.2</poi.version>
        <velocity.version>2.3</velocity.version>
        <jwt.version>0.9.1</jwt.version>
    </properties>

    <!-- 依赖声明 -->
    <dependencyManagement>
        <dependencies>

            <!-- SpringBoot的依赖配置-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.5.15</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- 阿里数据库连接池 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid.version}</version>
            </dependency>

            <!-- 解析客户端操作系统、浏览器等 -->
            <dependency>
                <groupId>eu.bitwalker</groupId>
                <artifactId>UserAgentUtils</artifactId>
                <version>${bitwalker.version}</version>
            </dependency>

            <!-- pagehelper 分页插件 -->
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper-spring-boot-starter</artifactId>
                <version>${pagehelper.boot.version}</version>
            </dependency>

            <!-- 获取系统信息 -->
            <dependency>
                <groupId>com.github.oshi</groupId>
                <artifactId>oshi-core</artifactId>
                <version>${oshi.version}</version>
            </dependency>

            <!-- Swagger3依赖 -->
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-boot-starter</artifactId>
                <version>${swagger.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>io.swagger</groupId>
                        <artifactId>swagger-models</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- io常用工具类 -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>

            <!-- excel工具 -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>${poi.version}</version>
            </dependency>

            <!-- velocity代码生成使用模板 -->
            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity-engine-core</artifactId>
                <version>${velocity.version}</version>
            </dependency>

            <!-- collections工具类 -->
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons.collections.version}</version>
            </dependency>

            <!-- 阿里JSON解析器 -->
            <dependency>
                <groupId>com.alibaba.fastjson2</groupId>
                <artifactId>fastjson2</artifactId>
                <version>${fastjson.version}</version>
            </dependency>

            <!-- Token生成与解析-->
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt</artifactId>
                <version>${jwt.version}</version>
            </dependency>

            <!-- 验证码 -->
            <dependency>
                <groupId>pro.fessional</groupId>
                <artifactId>kaptcha</artifactId>
                <version>${kaptcha.version}</version>
            </dependency>

            <!-- 定时任务-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-quartz</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- 代码生成-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-generator</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- 核心模块-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-framework</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- 系统模块-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-system</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- 通用工具-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-common</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- 工作流模块-->
            <dependency>
                <groupId>com.qilaike</groupId>
                <artifactId>qilaike-activiti</artifactId>
                <version>${qilaike.version}</version>
            </dependency>

            <!-- okhttp -->
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <modules>
        <module>qilaike-admin</module>
        <module>qilaike-framework</module>
        <module>qilaike-system</module>
        <module>qilaike-quartz</module>
        <module>qilaike-generator</module>
        <module>qilaike-common</module>
        <module>qilaike-activiti</module>
    </modules>
    <packaging>pom</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>public</id>
            <name>aliyun nexus</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>public</id>
            <name>aliyun nexus</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

4、子模块pom.xml ,这里把源作者没有用到的一些依赖都去掉了。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>qilaike</artifactId>
        <groupId>com.qilaike</groupId>
        <version>3.8.6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>qilaike-activiti</artifactId>

    <description>
        流程引擎 activiti flowable camunda 工作流
    </description>

    <properties>
        <mybatis-plus.vesion>3.5.1</mybatis-plus.vesion>
        <mybatis-plus.generator.vesion>3.4.1</mybatis-plus.generator.vesion>
        <mybatis-plus.dynamic.vesion>3.5.1</mybatis-plus.dynamic.vesion>
        <flowable.version>6.7.2</flowable.version>
        <hutool-all.version>5.8.0</hutool-all.version>
        <minio.version>8.4.0</minio.version>
        <lombok.version>1.18.20</lombok.version>
        <knife4j.version>4.1.0</knife4j.version>
        <commons-fileupload.version>1.4</commons-fileupload.version>
        <antisamy.varsion>1.6.4</antisamy.varsion>
    </properties>

    <dependencies>
        <!-- 核心模块-->
        <dependency>
            <groupId>com.qilaike</groupId>
            <artifactId>qilaike-framework</artifactId>
        </dependency>

        <!-- 通用工具-->
        <dependency>
            <groupId>com.qilaike</groupId>
            <artifactId>qilaike-common</artifactId>
        </dependency>

        <!-- Mysql驱动包 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>${hutool-all.version}</version>
        </dependency>

        <dependency>
            <groupId>io.minio</groupId>
            <artifactId>minio</artifactId>
            <version>${minio.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>

        <!-- flowable -->
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-spring-boot-starter</artifactId>
            <version>${flowable.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.flowable</groupId>
                    <artifactId>flowable-spring-boot-starter-app</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.flowable</groupId>
                    <artifactId>flowable-form-spring-configurator</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.flowable</groupId>
                    <artifactId>flowable-idm-spring-configurator</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>mybatis</artifactId>
                    <groupId>org.mybatis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-bpmn-model</artifactId>
            <version>${flowable.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-json-converter</artifactId>
            <version>${flowable.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-bpmn-converter</artifactId>
            <version>${flowable.version}</version>
            <scope>compile</scope>
        </dependency>

        <!--activiti modeler 5.22 end-->
        <!-- 自动布局jar 包-->
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-bpmn-layout</artifactId>
            <version>${flowable.version}</version>
        </dependency>

        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>1.6.6</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
            <version>${knife4j.version}</version>
        </dependency>

        <!-- mybatisplus -->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis-plus.vesion}</version>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.2.16</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>${commons-fileupload.version}</version>
        </dependency>

        <!--反之XSS注入-->
        <dependency>
            <groupId>org.owasp.antisamy</groupId>
            <artifactId>antisamy</artifactId>
            <version>${antisamy.varsion}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>

5、admin模块配置文件yml配置工作流数据源和flowable配置,数据源配置参考这位作者若依开源框架配置多数据源步骤

# 工作流数据源
activity:
	 enabled: true
	 url: jdbc:mysql://localhost:3306/dingding_mid?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
	 username: root
	 password: root
# flowable配置
flowable:
  dmn:
    enabled: false
  cmmn:
    enabled: false
  idm:
    enabled: false
  async-history-executor-activate: false
  async-executor-activate: false
  check-process-definitions: false
  content:
    enabled: false
  app:
    enabled: false
  eventregistry:
    enabled: false

6、更改工作流模块的数据源,config目录下面的ActivitiConfig

 	@Autowired
	@Qualifier("activityDataSource")
	private DataSource dataSource;
文章来源:https://blog.csdn.net/l2x1314258/article/details/135370547
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。