feat(REQ-3647) - 调整日志中,部分自动操作的具体文案

This commit is contained in:
wangli 2025-06-09 16:19:07 +08:00
parent f3b87976e0
commit 6a0800ba2d
5 changed files with 16 additions and 11 deletions

View File

@ -109,7 +109,7 @@ public class CustomApproveTaskCmd extends AbstractCommand<Void> implements Seria
if (Objects.nonNull(operationDesc)) {
this.operationDesc = operationDesc;
} else {
this.operationDesc = "已通过";
this.operationDesc = "已通过";
}
}

View File

@ -196,12 +196,12 @@ public class EngineExecutionStartListener implements ExecutionListener {
assigners.addAll(approverSelect(ApproverEmptyHandleTypeEnum.transferToAdmin.getType(), userTask,
execution, true));
finalEmptyAssigneeHandle(assigners, userTask, execution, "转交管理员失败,系统中止", "karma: " + (refreshProperties.getUseNewToAdminApi() ? "api/flow/listTaskAssignerAdmin/v2" : "api/flow/listTaskAssignerAdmin"));
finalEmptyAssigneeHandle(assigners, userTask, execution, "未找到审批人,转交管理员失败,审批自动中止", "karma: " + (refreshProperties.getUseNewToAdminApi() ? "api/flow/listTaskAssignerAdmin/v2" : "api/flow/listTaskAssignerAdmin"));
break;
case specifyAssignee:
assigners.addAll(approverSelect(ApproverEmptyHandleTypeEnum.specifyAssignee.getType(), userTask,
execution, true));
finalEmptyAssigneeHandle(assigners, userTask, execution, "转交指定人员失败,系统自动中止", "org-gateway: api/node-user/list");
finalEmptyAssigneeHandle(assigners, userTask, execution, "转交指定人员失败,审批自动中止", "org-gateway: api/node-user/list");
break;
default:
break;

View File

@ -60,7 +60,7 @@ public class AutoPassTransactionListener implements TransactionListener {
pass.setTaskId(delegateTask.getId());
pass.setAdvice(advice);
pass.setApprover(assigner);
pass.setOperationDesc("(自动通过)");
pass.setOperationDesc(operationDesc);
String jobId = commandExecutor.execute(commandConfig, new CustomApproveTaskAsyncCmd(pass));
// 重置任务因为上面的 cmd 和这个 cmd lock 对象不一致

View File

@ -33,6 +33,7 @@ import static org.flowable.common.engine.impl.interceptor.EngineConfigurationCon
@AllArgsConstructor
public class AutoRejectTransactionListener implements TransactionListener {
private final DelegateTask delegateTask;
private final String operationDesc;
@Override
public void execute(CommandContext commandContext) {
@ -47,7 +48,7 @@ public class AutoRejectTransactionListener implements TransactionListener {
BpmnTaskAuditDTO reject = new BpmnTaskAuditDTO();
reject.setTaskId(delegateTask.getId());
reject.setApprover(new BpmnTaskDelegateAssigner("系统", "system", delegateTask.getTenantId()));
reject.setOperationDesc("自动驳回");
reject.setOperationDesc(operationDesc);
String jobId = commandExecutor.execute(commandConfig, new CustomRejectionTaskAsyncCmd(reject));
// 重置任务因为上面的 cmd 和这个 cmd lock 对象不一致

View File

@ -83,7 +83,7 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
boolean exists = checkApproverService.checkApproverExists(delegateTask, userTask, mainProcess, getContext());
log.info("是否需要自动过程判断 exists:{},processInstId:{},taskDefinitionKey:{}", exists, delegateTask.getProcessInstanceId(), delegateTask.getTaskDefinitionKey());
if (exists) {
autoPass(delegateTask, "同一审批人,自动过审");
autoPass(delegateTask, "同一审批人,自动过审","");
}
}
// 检测节点自身配置是否有自动操作
@ -136,10 +136,10 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
.ifPresent(approverEmptyHandleTypeEnum -> {
switch (approverEmptyHandleTypeEnum) {
case autoPassed:
autoPass(delegateTask);
autoPass(delegateTask, "", "找不到审批人,自动同意");
break;
case autoRejection:
autoReject(delegateTask);
autoReject(delegateTask, "找不到审批人,自动驳回");
break;
case autoSkipped:
// autoReject(delegateTask);
@ -184,9 +184,13 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
*
* @param delegateTask 自动操作的任务
*/
private void autoReject(DelegateTask delegateTask) {
private void autoReject(DelegateTask delegateTask, @Nullable String operationDesc) {
Context.getTransactionContext().addTransactionListener(TransactionState.COMMITTED,
new AutoRejectTransactionListener(delegateTask));
new AutoRejectTransactionListener(delegateTask, operationDesc));
}
private void autoReject(DelegateTask delegateTask) {
autoReject(delegateTask,"无需审批人,自动驳回" );
}
/**
@ -208,7 +212,7 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
* @param delegateTask 自动操作的任务
*/
private void autoPass(DelegateTask delegateTask) {
autoPass(delegateTask, null, null);
autoPass(delegateTask, null, "无需审批人,自动同意");
}
}