add 新增异常处理器和工作流封装包
This commit is contained in:
parent
b5ba8de7b7
commit
0a31cd0b94
@ -34,6 +34,7 @@
|
|||||||
<module>ruoyi-common-tenant</module>
|
<module>ruoyi-common-tenant</module>
|
||||||
<module>ruoyi-common-websocket</module>
|
<module>ruoyi-common-websocket</module>
|
||||||
<module>ruoyi-common-sse</module>
|
<module>ruoyi-common-sse</module>
|
||||||
|
<module>ruoyi-common-workflow</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
@ -179,6 +179,13 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- workflow模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-workflow</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
47
ruoyi-common/ruoyi-common-workflow/pom.xml
Normal file
47
ruoyi-common/ruoyi-common-workflow/pom.xml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>ruoyi-common</artifactId>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-common-workflow</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
ruoyi-common-workflow Warm-Flow国产工作流引擎
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<!-- 官方文档地址 -->
|
||||||
|
<url>http://warm-flow.cn/ </url>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- RuoYi Common Core-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Warm-Flow国产工作流引擎-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.minliuhua</groupId>
|
||||||
|
<artifactId>warm-flow-mybatis-plus-sb-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.minliuhua</groupId>
|
||||||
|
<artifactId>warm-flow-plugin-spel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.minliuhua</groupId>
|
||||||
|
<artifactId>warm-flow-plugin-ui-sb-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,28 @@
|
|||||||
|
package org.dromara.common.workflow.config;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.factory.YmlPropertySourceFactory;
|
||||||
|
import org.dromara.common.workflow.handler.WorkflowExceptionHandler;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.PropertySource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* workflow 配置属性
|
||||||
|
*
|
||||||
|
* @author AprilWind
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@AutoConfiguration
|
||||||
|
@PropertySource(value = "classpath:common-workflow.yml", factory = YmlPropertySourceFactory.class)
|
||||||
|
public class WorkflowConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* workflow 异常处理器
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public WorkflowExceptionHandler workflowExceptionHandler() {
|
||||||
|
return new WorkflowExceptionHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package org.dromara.workflow.common.enums;
|
package org.dromara.common.workflow.enums;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -81,7 +81,7 @@ public enum TaskAssigneeEnum {
|
|||||||
/**
|
/**
|
||||||
* 获取所有办理人类型的描述列表
|
* 获取所有办理人类型的描述列表
|
||||||
* <p>
|
* <p>
|
||||||
* 获取当前枚举类所有项的描述字段列表,通常用于展示选择项。
|
* 获取当前枚举类所有项的描述字段列表,通常用于展示选择项
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return List<String> 返回所有办理人类型的描述列表
|
* @return List<String> 返回所有办理人类型的描述列表
|
||||||
@ -95,7 +95,7 @@ public enum TaskAssigneeEnum {
|
|||||||
/**
|
/**
|
||||||
* 获取所有办理人类型的代码列表
|
* 获取所有办理人类型的代码列表
|
||||||
* <p>
|
* <p>
|
||||||
* 获取当前枚举类所有项的代码字段列表,通常用于程序内部逻辑的判断。
|
* 获取当前枚举类所有项的代码字段列表,通常用于程序内部逻辑的判断
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return List<String> 返回所有办理人类型的代码列表
|
* @return List<String> 返回所有办理人类型的代码列表
|
@ -0,0 +1,30 @@
|
|||||||
|
package org.dromara.common.workflow.handler;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpStatus;
|
||||||
|
import com.warm.flow.core.exception.FlowException;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workflow 异常处理器
|
||||||
|
*
|
||||||
|
* @author AprilWind
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class WorkflowExceptionHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(FlowException.class)
|
||||||
|
public R<Void> handleForestException(FlowException e, HttpServletRequest request) {
|
||||||
|
String requestURI = request.getRequestURI();
|
||||||
|
log.error("请求地址'{}',流程异常.{}", requestURI, e.getMessage());
|
||||||
|
return R.fail(HttpStatus.HTTP_UNAVAILABLE, e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
org.dromara.common.workflow.config.WorkflowConfiguration
|
@ -0,0 +1,8 @@
|
|||||||
|
# warm-flow工作流配置
|
||||||
|
warm-flow:
|
||||||
|
# 是否开启工作流,默认true
|
||||||
|
enabled: true
|
||||||
|
# 是否显示banner图,默认是
|
||||||
|
banner: true
|
||||||
|
# 是否开启设计器ui,默认true
|
||||||
|
ui: true
|
@ -37,46 +37,45 @@
|
|||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-mybatis</artifactId>
|
<artifactId>ruoyi-common-mybatis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-web</artifactId>
|
<artifactId>ruoyi-common-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-log</artifactId>
|
<artifactId>ruoyi-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-idempotent</artifactId>
|
<artifactId>ruoyi-common-idempotent</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-excel</artifactId>
|
<artifactId>ruoyi-common-excel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-translation</artifactId>
|
<artifactId>ruoyi-common-translation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-tenant</artifactId>
|
<artifactId>ruoyi-common-tenant</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.minliuhua</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>warm-flow-mybatis-plus-sb-starter</artifactId>
|
<artifactId>ruoyi-common-workflow</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.minliuhua</groupId>
|
|
||||||
<artifactId>warm-flow-plugin-spel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.minliuhua</groupId>
|
|
||||||
<artifactId>warm-flow-plugin-ui-sb-web</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
package org.dromara.workflow.config;
|
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* warmFlow配置
|
|
||||||
*
|
|
||||||
* @author may
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class WarmFlowConfig {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -20,7 +20,7 @@ import org.dromara.common.core.service.RoleService;
|
|||||||
import org.dromara.common.core.service.UserService;
|
import org.dromara.common.core.service.UserService;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.workflow.common.enums.TaskAssigneeEnum;
|
import org.dromara.common.workflow.enums.TaskAssigneeEnum;
|
||||||
import org.dromara.workflow.service.IWfTaskAssigneeService;
|
import org.dromara.workflow.service.IWfTaskAssigneeService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import org.dromara.common.core.domain.dto.UserDTO;
|
|||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.workflow.common.enums.TaskAssigneeEnum;
|
import org.dromara.common.workflow.enums.TaskAssigneeEnum;
|
||||||
import org.dromara.workflow.service.IWfTaskAssigneeService;
|
import org.dromara.workflow.service.IWfTaskAssigneeService;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user