1. 替换原始 code 签名

2. 服务与模块生成器,支持指定起始端口批量端口分配
This commit is contained in:
chenbowen
2025-09-02 10:15:16 +08:00
parent 287f4bbd7e
commit e99da38fd4
778 changed files with 876 additions and 801 deletions

View File

@@ -7,7 +7,7 @@ import org.springframework.context.ApplicationEvent;
/**
* 流程实例的状态(结果)发生变化的 Event
*
* @author 芋道源码
* @author ZT
*/
@SuppressWarnings("ALL")
@Data

View File

@@ -7,7 +7,7 @@ import java.util.List;
/**
* {@link BpmProcessInstanceStatusEvent} 的监听器
*
* @author 芋道源码
* @author ZT
*/
public abstract class BpmProcessInstanceStatusEventListener
implements ApplicationListener<BpmProcessInstanceStatusEvent> {

View File

@@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.enums.RpcConstants;
/**
* API 相关的枚举
*
* @author 芋道源码
* @author ZT
*/
public class ApiConstants {

View File

@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.bpm.enums;
/**
* BPM 字典类型的枚举类
*
* @author 芋道源码
* @author ZT
*/
public interface DictTypeConstants {

View File

@@ -9,7 +9,7 @@ import java.util.Arrays;
/**
* BPM 模型的表单类型的枚举
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -9,7 +9,7 @@ import java.util.Arrays;
/**
* BPM 模型的类型的枚举
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -6,7 +6,7 @@ import lombok.Getter;
/**
* BPM 流程监听器的类型
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -6,7 +6,7 @@ import lombok.Getter;
/**
* BPM 流程监听器的值类型
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -9,7 +9,7 @@ import java.util.Arrays;
/**
* 用户任务的审批类型枚举
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -9,7 +9,7 @@ import java.util.Arrays;
/**
* BPM 用户任务的审批人为空时,处理类型枚举
*
* @author 芋道源码
* @author ZT
*/
@RequiredArgsConstructor
@Getter

View File

@@ -9,7 +9,7 @@ import java.util.Arrays;
/**
* BPM 用户任务的审批人与发起人相同时,处理类型枚举
*
* @author 芋道源码
* @author ZT
*/
@RequiredArgsConstructor
@Getter

View File

@@ -6,7 +6,7 @@ import lombok.Getter;
/**
* Bpm 消息的枚举
*
* @author 芋道源码
* @author ZT
*/
@AllArgsConstructor
@Getter

View File

@@ -10,7 +10,7 @@ import java.util.Arrays;
/**
* 流程实例 ProcessInstance 的状态
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -7,7 +7,7 @@ import lombok.Getter;
/**
* 流程实例/任务的的处理原因枚举
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
* 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
*
* @author 芋道源码
* @author ZT
*/
@SpringBootApplication
public class BpmServerApplication {

View File

@@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* Flowable 流程实例 Api 实现类
*
* @author 芋道源码
* @author ZT
* @author jason
*/
@RestController

View File

@@ -23,7 +23,7 @@ import java.util.List;
* {@link cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO}
* 是一致的
*
* @author 芋道源码
* @author ZT
*/
@Data
public class BpmModelMetaInfoVO {

View File

@@ -24,7 +24,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
* OA 请假申请 Controller用于演示自己存储数据接入工作流的例子
*
* @author jason
* @author 芋道源码
* @author ZT
*/
@Tag(name = "管理后台 - OA 请假申请")
@RestController

View File

@@ -47,7 +47,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
/**
* 流程实例 Convert
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmProcessInstanceConvert {

View File

@@ -35,7 +35,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAnd
/**
* Bpm 任务 Convert
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmTaskConvert {

View File

@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
/**
* BPM 流程分类 DO
*
* @author 芋道源码
* @author ZT
*/
@TableName("bpm_category")
@KeySequence("bpm_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -14,7 +14,7 @@ import java.util.List;
* BPM 工作流的表单定义
* 用于工作流的申请表单,需要动态配置的场景
*
* @author 芋道源码
* @author ZT
*/
@TableName(value = "bpm_form", autoResultMap = true)
@KeySequence("bpm_form_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -22,7 +22,7 @@ import java.util.List;
* BPM 流程定义的拓信息
* 主要解决 Flowable {@link org.flowable.engine.repository.ProcessDefinition} 不支持拓展字段,所以新建该表
*
* @author 芋道源码
* @author ZT
*/
@TableName(value = "bpm_process_definition_info", autoResultMap = true)
@KeySequence("bpm_process_definition_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -10,7 +10,7 @@ import lombok.*;
/**
* BPM 流程表达式 DO
*
* @author 芋道源码
* @author ZT
*/
@TableName("bpm_process_expression")
@KeySequence("bpm_process_expression_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
*
* 目的:本质上它是流程监听器的模版,用于 BPMN 在设计时,直接选择这些模版
*
* @author 芋道源码
* @author ZT
*/
@TableName(value = "bpm_process_listener")
@KeySequence("bpm_process_listener_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -14,7 +14,7 @@ import java.util.Set;
/**
* BPM 用户组
*
* @author 芋道源码
* @author ZT
*/
@TableName(value = "bpm_user_group", autoResultMap = true)
@KeySequence("bpm_user_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
* {@link #day} 请假天数,目前先简单做。一般是分成请假上午和下午,可以是 1 整天,可以是 0.5 半天
*
* @author jason
* @author 芋道源码
* @author ZT
*/
@TableName("bpm_oa_leave")
@KeySequence("bpm_oa_leave_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。

View File

@@ -13,7 +13,7 @@ import java.util.List;
/**
* BPM 流程分类 Mapper
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmCategoryMapper extends BaseMapperX<BpmCategoryDO> {

View File

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
/**
* BPM 流程表达式 Mapper
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmProcessExpressionMapper extends BaseMapperX<BpmProcessExpressionDO> {

View File

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
/**
* BPM 流程监听器 Mapper
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmProcessListenerMapper extends BaseMapperX<BpmProcessListenerDO> {

View File

@@ -12,7 +12,7 @@ import java.util.List;
/**
* 用户组 Mapper
*
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmUserGroupMapper extends BaseMapperX<BpmUserGroupDO> {

View File

@@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
* 请假申请 Mapper
*
* @author jason
* @author 芋道源码
* @author ZT
*/
@Mapper
public interface BpmOALeaveMapper extends BaseMapperX<BpmOALeaveDO> {

View File

@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.bpm.dal.redis;
/**
* BPM Redis Key 枚举类
*
* @author 芋道源码
* @author ZT
*/
public interface RedisKeyConstants {

View File

@@ -14,7 +14,7 @@ import org.flowable.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFacto
* 自定义的 ActivityBehaviorFactory 实现类,目的如下:
* 1. 自定义 {@link #createUserTaskActivityBehavior(UserTask)}:实现自定义的流程任务的 assignee 负责人的分配
*
* @author 芋道源码
* @author ZT
*/
@Setter
public class BpmActivityBehaviorFactory extends DefaultActivityBehaviorFactory {

View File

@@ -24,7 +24,7 @@ import java.util.Set;
*
* 本质上,实现和 {@link BpmParallelMultiInstanceBehavior} 一样,只是继承的类不一样
*
* @author 芋道源码
* @author ZT
*/
@Setter
public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceBehavior {

View File

@@ -26,7 +26,7 @@ import java.util.Set;
* 第一步,基于分配规则,计算出分配任务的【单个】候选人。如果找不到,则直接报业务异常,不继续执行后续的流程;
* 第二步,随机选择一个候选人,则选择作为 assignee 负责人。
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class BpmUserTaskActivityBehavior extends UserTaskActivityBehavior {

View File

@@ -33,7 +33,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.MODEL_DEPLOY_
/**
* {@link BpmTaskCandidateStrategy} 的调用者,用于调用对应的策略,实现任务的候选人的计算
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class BpmTaskCandidateInvoker {

View File

@@ -12,7 +12,7 @@ import java.util.Set;
* <p>
* 例如说:分配审批人
*
* @author 芋道源码
* @author ZT
*/
public interface BpmTaskCandidateStrategy {

View File

@@ -22,7 +22,7 @@ import static java.util.Collections.emptySet;
* 分配给发起人的 Leader 审批的 Expression 流程表达式
* 目前 Leader 的定义是,发起人所在部门的 Leader
*
* @author 芋道源码
* @author ZT
*/
@Component
public class BpmTaskAssignLeaderExpression {

View File

@@ -13,7 +13,7 @@ import java.util.Set;
/**
* 分配给发起人审批的 Expression 流程表达式
*
* @author 芋道源码
* @author ZT
*/
@Component
public class BpmTaskAssignStartUserExpression {

View File

@@ -21,7 +21,7 @@ import java.util.Map;
/**
* 发起人自选 {@link BpmTaskCandidateUserStrategy} 实现类
*
* @author 芋道源码
* @author ZT
*/
@Component
public class BpmTaskCandidateStartUserSelectStrategy extends AbstractBpmTaskCandidateDeptLeaderStrategy {

View File

@@ -18,7 +18,7 @@ import java.util.Set;
/**
* 流程表达式 {@link BpmTaskCandidateStrategy} 实现类
*
* @author 芋道源码
* @author ZT
*/
@Component
@Slf4j

View File

@@ -12,7 +12,7 @@ import java.util.Arrays;
*
* 例如说:分配给指定人审批
*
* @author 芋道源码
* @author ZT
*/
@Getter
@AllArgsConstructor

View File

@@ -5,7 +5,7 @@ import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelTypeEnum;
/**
* BPMN XML 常量信息
*
* @author 芋道源码
* @author ZT
*/
public interface BpmnModelConstants {

View File

@@ -5,7 +5,7 @@ import org.flowable.engine.runtime.ProcessInstance;
/**
* BPM Variable 通用常量
*
* @author 芋道源码
* @author ZT
*/
public class BpmnVariableConstants {

View File

@@ -9,7 +9,7 @@ import org.springframework.validation.annotation.Validated;
/**
* {@link BpmProcessInstanceStatusEvent} 的生产者
*
* @author 芋道源码
* @author ZT
*/
@AllArgsConstructor
@Validated

View File

@@ -7,7 +7,7 @@ import org.flowable.engine.delegate.JavaDelegate;
/**
* 类型为 class 的 ExecutionListener 监听器示例
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class DemoDelegateClassExecutionListener implements JavaDelegate {

View File

@@ -7,7 +7,7 @@ import org.flowable.task.service.delegate.DelegateTask;
/**
* 类型为 class 的 TaskListener 监听器示例
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class DemoDelegateClassTaskListener implements TaskListener {

View File

@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
/**
* 类型为 delegateExpression 的 TaskListener 监听器示例
*
* @author 芋道源码
* @author ZT
*/
@Component
@Slf4j

View File

@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
/**
* 类型为 expression 的 TaskListener 监听器示例
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
@Component

View File

@@ -31,7 +31,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_INSTA
/**
* 工作流发起 HTTP 请求工具类
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class BpmHttpRequestUtils {

View File

@@ -38,7 +38,7 @@ import static org.flowable.bpmn.constants.BpmnXMLConstants.FLOWABLE_EXTENSIONS_P
* 3. BPMN 复杂遍历相关的方法
* 4. BPMN 流程预测相关的方法
*
* @author 芋道源码
* @author ZT
*/
@Slf4j
public class BpmnModelUtils {

View File

@@ -37,7 +37,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
/**
* Flowable 相关的工具方法
*
* @author 芋道源码
* @author ZT
*/
public class FlowableUtils {

View File

@@ -1,6 +1,6 @@
/**
* 属于 bpm 模块的 framework 封装
*
* @author 芋道源码
* @author ZT
*/
package cn.iocoder.yudao.module.bpm.framework;

View File

@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
/**
* bpm 模块的 web 组件的 Configuration
*
* @author 芋道源码
* @author ZT
*/
@Configuration(proxyBeanMethods = false)
public class BpmWebConfiguration {

View File

@@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
/**
* BPM 流程分类 Service 接口
*
* @author 芋道源码
* @author ZT
*/
public interface BpmCategoryService {

View File

@@ -25,7 +25,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
/**
* BPM 流程分类 Service 实现类
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -51,7 +51,7 @@ import static cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModel
* 流程模型实现:主要进行 Flowable {@link Model} 的维护
*
* @author yunlongn
* @author 芋道源码
* @author ZT
* @author jason
*/
@Service

View File

@@ -22,7 +22,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
*
* @author yunlong.li
* @author ZJQ
* @author 芋道源码
* @author ZT
*/
public interface BpmProcessDefinitionService {

View File

@@ -40,7 +40,7 @@ import static java.util.Collections.emptyList;
*
* @author yunlongn
* @author ZJQ
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -9,7 +9,7 @@ import jakarta.validation.Valid;
/**
* BPM 流程表达式 Service 接口
*
* @author 芋道源码
* @author ZT
*/
public interface BpmProcessExpressionService {

View File

@@ -16,7 +16,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_EXPRE
/**
* BPM 流程表达式 Service 实现类
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -9,7 +9,7 @@ import jakarta.validation.Valid;
/**
* BPM 流程监听器 Service 接口
*
* @author 芋道源码
* @author ZT
*/
public interface BpmProcessListenerService {

View File

@@ -21,7 +21,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
/**
* BPM 流程监听器 Service 实现类
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -12,7 +12,7 @@ import java.util.List;
/**
* 用户组 Service 接口
*
* @author 芋道源码
* @author ZT
*/
public interface BpmUserGroupService {

View File

@@ -24,7 +24,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NO
/**
* 用户组 Service 实现类
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -7,7 +7,7 @@ import lombok.Data;
* Bpm 表单的 Field 表单项 Response DTO
* 字段的定义,可见 https://github.com/JakHuang/form-generator/issues/46 文档
*
* @author 芋道源码
* @author ZT
*/
@Data
public class BpmFormFieldRespDTO {

View File

@@ -9,7 +9,7 @@ import lombok.Data;
*
* 最终,它的字段和 {@link cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO} 是一致的
*
* @author 芋道源码
* @author ZT
*/
@Data
public class BpmModelMetaInfoRespDTO {

View File

@@ -11,7 +11,7 @@ import jakarta.validation.Valid;
*
* TODO 芋艿:未来支持消息的可配置;不同的流程,在什么场景下,需要发送什么消息,消息的内容是什么;
*
* @author 芋道源码
* @author ZT
*/
public interface BpmMessageService {

View File

@@ -19,7 +19,7 @@ import java.util.Map;
/**
* BPM 消息 Service 实现类
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -11,7 +11,7 @@ import jakarta.validation.Valid;
* 请假申请 Service 接口
*
* @author jason
* @author 芋道源码
* @author ZT
*/
public interface BpmOALeaveService {

View File

@@ -25,7 +25,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_LEAVE_NOT_
* OA 请假申请 Service 实现类
*
* @author jason
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -12,7 +12,7 @@ import java.util.List;
/**
* OA 请假单的结果的监听器实现类
*
* @author 芋道源码
* @author ZT
*/
@Component
public class BpmOALeaveStatusListener extends BpmProcessInstanceStatusEventListener {

View File

@@ -17,7 +17,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
/**
* 流程实例 Service 接口
*
* @author 芋道源码
* @author ZT
*/
public interface BpmProcessInstanceService {

View File

@@ -87,7 +87,7 @@ import static org.flowable.bpmn.constants.BpmnXMLConstants.*;
* <p>
* 简单来说,前者 = 历史 + 运行中的流程实例,后者仅是运行中的流程实例
*
* @author 芋道源码
* @author ZT
*/
@Service
@Validated

View File

@@ -19,7 +19,7 @@ import java.util.Map;
* 流程任务实例 Service 接口
*
* @author jason
* @author 芋道源码
* @author ZT
*/
public interface BpmTaskService {

View File

@@ -76,7 +76,7 @@ import static cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModel
/**
* 流程任务实例 Service 实现类
*
* @author 芋道源码
* @author ZT
* @author jason
*/
@Slf4j

View File

@@ -40,7 +40,7 @@ import static org.mockito.Mockito.*;
/**
* {@link BpmTaskCandidateInvoker} 的单元测试
*
* @author 芋道源码
* @author ZT
*/
public class BpmTaskCandidateInvokerTest extends BaseMockitoUnitTest {

View File

@@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* {@link BpmCategoryServiceImpl} 的单元测试类
*
* @author 芋道源码
* @author ZT
*/
@Import(BpmCategoryServiceImpl.class)
public class BpmCategoryServiceImplTest extends BaseDbUnitTest {

View File

@@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*;
/**
* {@link BpmFormServiceImpl} 的单元测试类
*
* @author 芋道源码
* @author ZT
*/
@Import(BpmFormServiceImpl.class)
public class BpmFormServiceTest extends BaseDbUnitTest {

View File

@@ -24,7 +24,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NO
/**
* {@link BpmUserGroupServiceImpl} 的单元测试类
*
* @author 芋道源码
* @author ZT
*/
@Import(BpmUserGroupServiceImpl.class)
public class BpmUserGroupServiceTest extends BaseDbUnitTest {