update - 处理流程已结束后添加评论的逻辑

This commit is contained in:
wangli 2024-01-10 19:15:46 +08:00
parent 86cf230fcc
commit 12ea405ba2
4 changed files with 5 additions and 18 deletions

View File

@ -11,7 +11,6 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.task.api.Task;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
@ -65,9 +64,7 @@ public class CustomApproveTaskCmd implements Command<Void>, Serializable {
Authentication.setAuthenticatedUserId(null);
}
if (!CollectionUtils.isEmpty(attachmentList)) {
batchAddAttachment(commandContext, task.getProcessInstanceId(), taskId, attachmentList, approver);
}
batchAddAttachment(commandContext, task.getProcessInstanceId(), taskId, attachmentList, approver);
Authentication.setAuthenticatedUserId(approver.buildAssigneeId());
addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, "已通过");

View File

@ -33,7 +33,6 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_COMMEN
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_COMMENT;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.COMMENTED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static org.flowable.task.api.Task.DEFAULT_PRIORITY;
/**
@ -103,10 +102,7 @@ public class CustomCommentTaskCmd implements Command<Void>, Serializable {
Authentication.setAuthenticatedUserId(null);
// 处理附件
CustomTaskHelper.batchAddAttachment(commandContext,
Objects.equals(PROCESSING.getStatus(), processInstance.getBusinessStatus()) ? processInstanceId : null,
task.getId(), attachmentList,
operator);
CustomTaskHelper.batchAddAttachment(commandContext, processInstanceId, task.getId(), attachmentList, operator);
CustomTaskHelper.createExtTaskInst(extAxHiTaskInstService, processInstanceId,
task.getId(), task.getTaskDefinitionKey(), operator, COMMENTED.getStatus());

View File

@ -15,7 +15,6 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.task.api.Task;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
@ -77,10 +76,8 @@ public class CustomCountersignUserTaskCmd implements Command<Void>, Serializable
resolveOriginTask(taskService, task);
if (!CollectionUtils.isEmpty(attachmentList)) {
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList,
originTaskAssignee);
}
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList,
originTaskAssignee);
switch (countersignType) {
case FORWARD_COUNTERSIGN:

View File

@ -13,7 +13,6 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.task.api.Task;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
@ -74,10 +73,8 @@ public class CustomTransferUserTaskCmd implements Command<Void>, Serializable {
resolveOriginTask(commandContext, taskService, task);
if (!CollectionUtils.isEmpty(attachmentList)) {
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList,
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList,
originTaskAssignee);
}
addMultiTask(commandContext, (TaskEntity) task, targetTaskAssignee);
((TaskEntity) task).setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + task.getId(), TRANSFER.getStatus());