update - 转交功能优化 OperationDesc 的处理逻辑
This commit is contained in:
parent
bc4b828763
commit
f432c76905
@ -7,7 +7,6 @@ import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
|
|||||||
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
|
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.flowable.common.engine.impl.identity.Authentication;
|
|
||||||
import org.flowable.common.engine.impl.interceptor.Command;
|
import org.flowable.common.engine.impl.interceptor.Command;
|
||||||
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
||||||
import org.flowable.engine.RuntimeService;
|
import org.flowable.engine.RuntimeService;
|
||||||
@ -16,15 +15,15 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
|||||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||||
import org.flowable.task.api.Task;
|
import org.flowable.task.api.Task;
|
||||||
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
|
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
|
||||||
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;
|
||||||
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.BpmnProcessInstanceResultEnum.COUNTERSIGN;
|
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.COUNTERSIGN;
|
||||||
|
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.addComment;
|
||||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddAttachment;
|
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddAttachment;
|
||||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVirtualTask;
|
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVirtualTask;
|
||||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.deleteMultiTask;
|
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.deleteMultiTask;
|
||||||
@ -161,15 +160,9 @@ public class CustomCountersignUserTaskCmd implements Command<Void>, Serializable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
message.append("等").append(targetTaskAssigneeList.size()).append("人进行审批");
|
message.append("等").append(targetTaskAssigneeList.size()).append("人进行审批");
|
||||||
createVirtualTask(commandContext, extAxHiTaskInstService, task.getProcessInstanceId(), task.getName(),
|
Task virtualTask = createVirtualTask(commandContext, extAxHiTaskInstService, task.getProcessInstanceId(), task.getName(),
|
||||||
task.getTaskDefinitionKey(), message.toString(),
|
task.getTaskDefinitionKey(), advice, originTaskAssignee, COUNTERSIGN.getStatus());
|
||||||
originTaskAssignee, COUNTERSIGN.getStatus());
|
addComment(commandContext, virtualTask, COMMENT_TYPE_OPERATION_DESC, message.toString());
|
||||||
|
|
||||||
Authentication.setAuthenticatedUserId(originTaskAssignee.buildAssigneeId());
|
|
||||||
if (StringUtils.hasLength(advice)) {
|
|
||||||
taskService.addComment(originTaskId, task.getProcessInstanceId(), COMMENT_TYPE_ADVICE, advice);
|
|
||||||
}
|
|
||||||
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList, originTaskAssignee);
|
batchAddAttachment(commandContext, task.getProcessInstanceId(), task.getId(), attachmentList, originTaskAssignee);
|
||||||
Authentication.setAuthenticatedUserId(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -248,7 +248,7 @@ public class CustomTaskHelper {
|
|||||||
.filter(i -> Objects.equals(i.getId(), task.getId())).findAny()
|
.filter(i -> Objects.equals(i.getId(), task.getId())).findAny()
|
||||||
.ifPresent(i -> i.setAssignee(assigner.buildAssigneeId()));
|
.ifPresent(i -> i.setAssignee(assigner.buildAssigneeId()));
|
||||||
|
|
||||||
// 添加"操作描述"
|
// 添加审批意见
|
||||||
addAdvice(commandContext, task, advice, assigner.buildAssigneeId());
|
addAdvice(commandContext, task, advice, assigner.buildAssigneeId());
|
||||||
|
|
||||||
CustomTaskHelper.createExtTaskInst(extAxHiTaskInstService, task.getProcessInstanceId(), task.getId(),
|
CustomTaskHelper.createExtTaskInst(extAxHiTaskInstService, task.getProcessInstanceId(), task.getId(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user