diff --git a/workflow-engine-core/src/main/java/cn/axzo/workflow/core/engine/cmd/CustomCommentTaskCmd.java b/workflow-engine-core/src/main/java/cn/axzo/workflow/core/engine/cmd/CustomCommentTaskCmd.java index 020348eb5..793db2453 100644 --- a/workflow-engine-core/src/main/java/cn/axzo/workflow/core/engine/cmd/CustomCommentTaskCmd.java +++ b/workflow-engine-core/src/main/java/cn/axzo/workflow/core/engine/cmd/CustomCommentTaskCmd.java @@ -112,15 +112,6 @@ public class CustomCommentTaskCmd extends AbstractCommand implements Seria .filter(i -> Objects.equals(i.getId(), task.getId())).findAny() .ifPresent(i -> i.setAssignee(operator.buildAssigneeId())); - // 新增评论 - Authentication.setAuthenticatedUserId(operator.buildAssigneeId()); - addComment(commandContext, task, COMMENT_TYPE_ADVICE, comment); - addComment(commandContext, task, COMMENT_TYPE_COMMENT_EXT, JSONUtil.toJsonStr(commentExt)); - Authentication.setAuthenticatedUserId(null); - - // 处理附件 - batchAddAttachment(commandContext, processInstanceId, task.getId(), attachmentList, operator); - createExtTaskInst(extAxHiTaskInstService, processInstanceId, task.getId(), task.getTaskDefinitionKey(), operator, COMMENTED.getStatus()); task.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + task.getId(), COMMENTED.getStatus()); @@ -128,6 +119,14 @@ public class CustomCommentTaskCmd extends AbstractCommand implements Seria // 保存临时节点 taskService.saveTask(task); + // 新增评论 + Authentication.setAuthenticatedUserId(operator.buildAssigneeId()); + addComment(commandContext, task, COMMENT_TYPE_ADVICE, comment); + addComment(commandContext, task, COMMENT_TYPE_COMMENT_EXT, JSONUtil.toJsonStr(commentExt)); + Authentication.setAuthenticatedUserId(null); + // 处理附件 + batchAddAttachment(commandContext, processInstanceId, task.getId(), attachmentList, operator); + // 设置快照信息 task.setTransientVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + task.getId(), operator.toJson()); diff --git a/workflow-engine-core/src/main/resources/sql/upgrade_to_1.4.2.sql b/workflow-engine-core/src/main/resources/sql/upgrade_to_1.4.2.sql index 4e31c7f9a..68126ece0 100644 --- a/workflow-engine-core/src/main/resources/sql/upgrade_to_1.4.2.sql +++ b/workflow-engine-core/src/main/resources/sql/upgrade_to_1.4.2.sql @@ -16,7 +16,7 @@ create table `workflow-engine`.ext_ax_process_log assignee_id bigint default 0 not null comment '审批人标识(axzo=personId)', assignee_tenant_id varchar(255) default '' not null comment '审批人归属租户', assignee_name varchar(255) default '' not null comment '审批人姓名', - assignee_ou_id bigint default 0 not null comment '审批人归属单位', + assignee_ou_id varchar(64) default '' not null comment '审批人归属单位', start_time datetime(3) default CURRENT_TIMESTAMP(3) not null comment '任务开始时间', end_time datetime(3) null comment '任务结束时间', button_conf json null comment '按钮配置',