mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-25 12:46:40 +08:00
update 优化 后端发起流程增加扩展表对象
This commit is contained in:
parent
1977aabc9a
commit
df171097c3
@ -0,0 +1,45 @@
|
||||
package org.dromara.common.core.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 流程实例业务扩展对象
|
||||
*
|
||||
* @author may
|
||||
* @date 2025-08-05
|
||||
*/
|
||||
@Data
|
||||
public class FlowInstanceBizExtDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 流程实例ID
|
||||
*/
|
||||
private Long instanceId;
|
||||
|
||||
/**
|
||||
* 业务ID
|
||||
*/
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
private String businessCode;
|
||||
|
||||
/**
|
||||
* 业务标题
|
||||
*/
|
||||
private String businessTitle;
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.common.core.domain.dto;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -40,6 +41,11 @@ public class StartProcessDTO implements Serializable {
|
||||
*/
|
||||
private Map<String, Object> variables;
|
||||
|
||||
/**
|
||||
* 流程业务扩展信息
|
||||
*/
|
||||
private FlowInstanceBizExtDTO bizExt;
|
||||
|
||||
public Map<String, Object> getVariables() {
|
||||
if (variables == null) {
|
||||
return new HashMap<>(16);
|
||||
@ -47,4 +53,11 @@ public class StartProcessDTO implements Serializable {
|
||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||
return variables;
|
||||
}
|
||||
|
||||
public FlowInstanceBizExtDTO getBizExt() {
|
||||
if (ObjectUtil.isNull(bizExt)) {
|
||||
bizExt = new FlowInstanceBizExtDTO();
|
||||
}
|
||||
return bizExt;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.warm.flow.orm.entity.FlowInstance;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.common.enums.MessageTypeEnum;
|
||||
import org.dromara.workflow.domain.FlowInstanceBizExt;
|
||||
import org.dromara.workflow.domain.bo.CompleteTaskBo;
|
||||
import org.dromara.workflow.domain.bo.StartProcessBo;
|
||||
import org.dromara.workflow.service.IFlwDefinitionService;
|
||||
@ -166,6 +167,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
processBo.setFlowCode(startProcess.getFlowCode());
|
||||
processBo.setVariables(startProcess.getVariables());
|
||||
processBo.setHandler(startProcess.getHandler());
|
||||
processBo.setBizExt(BeanUtil.toBean(startProcess.getBizExt(), FlowInstanceBizExt.class));
|
||||
|
||||
StartProcessReturnDTO result = flwTaskService.startWorkFlow(processBo);
|
||||
CompleteTaskBo taskBo = new CompleteTaskBo();
|
||||
|
Loading…
Reference in New Issue
Block a user