feat(REQ-6570) - 调整八大按钮操作逻辑中的附件处理逻辑,增加 fileKey 存储

This commit is contained in:
wangli 2025-11-26 14:49:01 +08:00
parent 84e2e890de
commit 8716ea808f
3 changed files with 12 additions and 9 deletions

View File

@ -52,9 +52,11 @@ public class AttachmentDTO implements Serializable {
/** /**
* 文件描述 * 文件描述
* 该数据无实际作用
*/ */
@ApiModelProperty(value = "文件描述") @ApiModelProperty(value = "文件描述")
@IndexField(exist = false) @IndexField(exist = false)
@Deprecated
private String description; private String description;
/** /**

View File

@ -1,10 +1,10 @@
package cn.axzo.workflow.core.engine.cmd.helper; package cn.axzo.workflow.core.engine.cmd.helper;
import cn.axzo.workflow.common.enums.BpmnFlowNodeType; import cn.axzo.workflow.common.enums.BpmnFlowNodeType;
import cn.axzo.workflow.common.exception.WorkflowEngineException;
import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO; import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner; import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnHistoricTaskInstanceVO; import cn.axzo.workflow.common.model.response.bpmn.task.BpmnHistoricTaskInstanceVO;
import cn.axzo.workflow.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper; import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
import cn.axzo.workflow.core.engine.model.AddComment; import cn.axzo.workflow.core.engine.model.AddComment;
import cn.axzo.workflow.core.repository.entity.ExtAxHiTaskInst; import cn.axzo.workflow.core.repository.entity.ExtAxHiTaskInst;
@ -51,6 +51,12 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ASSIGNEE_HAS_BEEN_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ASSIGNER_NUMBER_EXCEEDS_NUMBER_LIMIT;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_HAS_BEEN_COMPLETE;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_TYPE_MISMATCH;
import static cn.axzo.workflow.common.constant.BpmnConstants.APPROVAL_ASSIGNER_LIMIT_NUMBER; import static cn.axzo.workflow.common.constant.BpmnConstants.APPROVAL_ASSIGNER_LIMIT_NUMBER;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE; import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT; import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
@ -61,12 +67,6 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_ATTACHMENTS_VA
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE; import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EMPTY; import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EMPTY;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING; import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ASSIGNEE_HAS_BEEN_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ASSIGNER_NUMBER_EXCEEDS_NUMBER_LIMIT;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_HAS_BEEN_COMPLETE;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_TYPE_MISMATCH;
import static org.flowable.task.api.Task.DEFAULT_PRIORITY; import static org.flowable.task.api.Task.DEFAULT_PRIORITY;
/** /**
@ -263,7 +263,7 @@ public class CustomTaskHelper {
Authentication.setAuthenticatedUserId(assigner.buildAssigneeId()); Authentication.setAuthenticatedUserId(assigner.buildAssigneeId());
attachmentList.forEach(dto -> { attachmentList.forEach(dto -> {
Attachment attachment = taskService.createAttachment(dto.getType().getType(), task.getId(), processInstanceId, Attachment attachment = taskService.createAttachment(dto.getType().getType(), task.getId(), processInstanceId,
dto.getName(), dto.getDescription(), dto.getUrl()); dto.getName(), dto.getFileKey(), dto.getUrl());
taskService.saveAttachment(attachment); taskService.saveAttachment(attachment);
}); });
task.setTransientVariableLocal(TASK_ATTACHMENTS_VAR_NAME, attachmentList); task.setTransientVariableLocal(TASK_ATTACHMENTS_VAR_NAME, attachmentList);

View File

@ -1806,7 +1806,8 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
.id(e.getId()) .id(e.getId())
.type(type) .type(type)
.name(e.getName()) .name(e.getName())
.description(e.getDescription()) // .description(e.getDescription())
.fileKey(e.getDescription())
.url(e.getUrl()) .url(e.getUrl())
.build()) .build())
.collect(Collectors.toList()); .collect(Collectors.toList());