From 35b0fe5e40179714928ac65be77abfd0370bf5b0 Mon Sep 17 00:00:00 2001 From: yangqicheng Date: Fri, 13 Sep 2024 15:22:55 +0800 Subject: [PATCH] =?UTF-8?q?REQ-2924-=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=99=84=E4=BB=B6=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/engine/cmd/CustomCommentTaskCmd.java | 17 ++++++++--------- .../src/main/resources/sql/upgrade_to_1.4.2.sql | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) 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 '按钮配置',