mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-23 02:48:34 +08:00
update 优化 后端发起流程增加扩展表对象
This commit is contained in:
@@ -85,4 +85,22 @@ public interface RemoteWorkflowService {
|
|||||||
*/
|
*/
|
||||||
boolean completeTask(RemoteCompleteTask completeTask);
|
boolean completeTask(RemoteCompleteTask completeTask);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理任务
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @param message 办理意见
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean completeTask(Long taskId, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程并办理第一个任务
|
||||||
|
*
|
||||||
|
* @param startProcess 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean startCompleteTask(RemoteStartProcess startProcess);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package org.dromara.workflow.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例业务扩展对象
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2025-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RemoteFlowInstanceBizExt 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.workflow.api.domain;
|
package org.dromara.workflow.api.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@@ -40,6 +41,11 @@ public class RemoteStartProcess implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程业务扩展信息
|
||||||
|
*/
|
||||||
|
private RemoteFlowInstanceBizExt bizExt;
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
public Map<String, Object> getVariables() {
|
||||||
if (variables == null) {
|
if (variables == null) {
|
||||||
return new HashMap<>(16);
|
return new HashMap<>(16);
|
||||||
@@ -47,4 +53,12 @@ public class RemoteStartProcess implements Serializable {
|
|||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RemoteFlowInstanceBizExt getBizExt() {
|
||||||
|
if (ObjectUtil.isNull(bizExt)) {
|
||||||
|
bizExt = new RemoteFlowInstanceBizExt();
|
||||||
|
}
|
||||||
|
return bizExt;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,28 @@ public class RemoteWorkflowServiceImpl implements RemoteWorkflowService {
|
|||||||
return workflowService.completeTask(completeTask);
|
return workflowService.completeTask(completeTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理任务
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @param message 办理意见
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean completeTask(Long taskId, String message) {
|
||||||
|
return workflowService.completeTask(taskId, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程并办理第一个任务
|
||||||
|
*
|
||||||
|
* @param startProcess 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean startCompleteTask(RemoteStartProcess startProcess) {
|
||||||
|
return workflowService.startCompleteTask(startProcess);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.dromara.workflow.api.domain.RemoteStartProcess;
|
|||||||
import org.dromara.workflow.api.domain.RemoteStartProcessReturn;
|
import org.dromara.workflow.api.domain.RemoteStartProcessReturn;
|
||||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||||
import org.dromara.workflow.common.enums.MessageTypeEnum;
|
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.CompleteTaskBo;
|
||||||
import org.dromara.workflow.domain.bo.StartProcessBo;
|
import org.dromara.workflow.domain.bo.StartProcessBo;
|
||||||
import org.dromara.workflow.service.IFlwDefinitionService;
|
import org.dromara.workflow.service.IFlwDefinitionService;
|
||||||
@@ -164,6 +165,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
|||||||
processBo.setFlowCode(startProcess.getFlowCode());
|
processBo.setFlowCode(startProcess.getFlowCode());
|
||||||
processBo.setVariables(startProcess.getVariables());
|
processBo.setVariables(startProcess.getVariables());
|
||||||
processBo.setHandler(startProcess.getHandler());
|
processBo.setHandler(startProcess.getHandler());
|
||||||
|
processBo.setBizExt(BeanUtil.toBean(startProcess.getBizExt(), FlowInstanceBizExt.class));
|
||||||
|
|
||||||
RemoteStartProcessReturn result = flwTaskService.startWorkFlow(processBo);
|
RemoteStartProcessReturn result = flwTaskService.startWorkFlow(processBo);
|
||||||
CompleteTaskBo taskBo = new CompleteTaskBo();
|
CompleteTaskBo taskBo = new CompleteTaskBo();
|
||||||
|
|||||||
Reference in New Issue
Block a user