feat(REQ-3383) - 配合调整机器人节点的携带附件,并重写构造器

This commit is contained in:
wangli 2024-12-09 11:21:56 +08:00
parent e9ae50ecba
commit 67b521f41b
5 changed files with 27 additions and 29 deletions

View File

@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
@ -44,7 +45,7 @@ public class BpmnRobotTaskCompleteDTO {
/**
* 完成机器人节点的人信息
*
* @since 1.3.0 版本后不支持传人员信息
* @since 不支持传人员信息
*/
@ApiModelProperty(value = "当前审核人信息", notes = "可为空,则该任务不验证用户归属")
@Deprecated
@ -58,6 +59,7 @@ public class BpmnRobotTaskCompleteDTO {
* 图片附件
*/
@ApiModelProperty(value = "附件列表")
@Size(max = 11, message = "附件数量超过限制")
@AttachmentValidator(types = {
@AttachmentTypeValidator(type = AttachmentTypeEnum.image, max = 5),
@AttachmentTypeValidator(type = AttachmentTypeEnum.file, max = 5)}

View File

@ -33,11 +33,10 @@ public class BpmnRobotTaskCreateDTO {
/**
* 当前审核人信息
*
* @since 1.3.0 版本不支持传人员信息
* @since 不支持传人员信息
*/
@ApiModelProperty(value = "当前审核人信息", notes = "可为空,则该任务不验证用户归属", hidden = true)
// @Valid
// @NotNull(message = "审批人不能为空")
@Deprecated
private BpmnTaskDelegateAssigner approver;
/**

View File

@ -2,10 +2,10 @@ package cn.axzo.workflow.core.engine.cmd;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnRobotTaskCompleteDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
import cn.axzo.workflow.core.repository.entity.ExtAxProcessLog;
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
import cn.axzo.workflow.core.service.ExtAxProcessLogService;
import com.alibaba.fastjson.JSON;
@ -43,20 +43,24 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddA
public class CustomCompleteDummyTaskCmd extends AbstractCommand<Void> implements Serializable {
private final String processInstanceId;
private final String taskId;
private final String flowNodeName;
private final String operationDesc;
private String flowNodeName;
private String operationDesc;
private final List<AttachmentDTO> attachmentList;
private final BpmnTaskDelegateAssigner operator;
private final ExtAxHiTaskInstService extAxHiTaskInstService;
private final ExtAxProcessLogService extAxProcessLogService;
public CustomCompleteDummyTaskCmd(String processInstanceId, String taskId, String flowNodeName,
String operationDesc, List<AttachmentDTO> attachmentList,
public CustomCompleteDummyTaskCmd(BpmnRobotTaskCompleteDTO dto,
ExtAxHiTaskInstService extAxHiTaskInstService,
ExtAxProcessLogService extAxProcessLogService) {
this.processInstanceId = processInstanceId;
this.taskId = taskId;
this.flowNodeName = flowNodeName;
this.operationDesc = operationDesc;
this.attachmentList = attachmentList;
this.processInstanceId = dto.getProcessInstanceId();
this.taskId = dto.getTaskId();
if (Objects.nonNull(dto.getRobotNode())) {
this.flowNodeName = dto.getRobotNode().getFlowNodeName();
this.operationDesc = dto.getRobotNode().getOperationDesc();
}
this.attachmentList = dto.getAttachmentList();
this.operator = dto.getApprover();
this.extAxHiTaskInstService = extAxHiTaskInstService;
this.extAxProcessLogService = extAxProcessLogService;
}

View File

@ -1,6 +1,7 @@
package cn.axzo.workflow.core.engine.cmd;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnRobotTaskCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
@ -51,12 +52,11 @@ public class CustomCreateDummyTaskCmd extends AbstractCommand<String> implements
private final BpmnTaskDelegateAssigner operator;
private final ExtAxHiTaskInstService extAxHiTaskInstService;
public CustomCreateDummyTaskCmd(String processInstanceId, String flowNodeName, String operationDesc,
BpmnTaskDelegateAssigner operator, ExtAxHiTaskInstService extAxHiTaskInstService) {
this.processInstanceId = processInstanceId;
this.flowNodeName = flowNodeName;
this.operationDesc = operationDesc;
this.operator = operator;
public CustomCreateDummyTaskCmd(BpmnRobotTaskCreateDTO dto, ExtAxHiTaskInstService extAxHiTaskInstService) {
this.processInstanceId = dto.getProcessInstanceId();
this.flowNodeName = dto.getRobotNode().getFlowNodeName();
this.operationDesc = dto.getRobotNode().getOperationDesc();
this.operator = dto.getApprover();
this.extAxHiTaskInstService = extAxHiTaskInstService;
}

View File

@ -805,21 +805,14 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
@Transactional(rollbackFor = Exception.class)
public String createRobotTask(BpmnRobotTaskCreateDTO dto) {
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
return commandExecutor.execute(new CustomCreateDummyTaskCmd(dto.getProcessInstanceId(),
dto.getRobotNode().getFlowNodeName(), dto.getRobotNode().getOperationDesc(), dto.getApprover(),
extAxHiTaskInstService));
return commandExecutor.execute(new CustomCreateDummyTaskCmd(dto, extAxHiTaskInstService));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void completeRobotTask(BpmnRobotTaskCompleteDTO dto) {
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
commandExecutor.execute(new CustomCompleteDummyTaskCmd(dto.getProcessInstanceId(), dto.getTaskId(),
Objects.isNull(dto.getRobotNode()) ? null : dto.getRobotNode().getFlowNodeName(),
Objects.isNull(dto.getRobotNode()) ? null : dto.getRobotNode().getOperationDesc(),
dto.getAttachmentList(),
extAxHiTaskInstService,
extAxProcessLogService));
commandExecutor.execute(new CustomCompleteDummyTaskCmd(dto, extAxHiTaskInstService, extAxProcessLogService));
}
@Override