feat(REQ-3647) - 调整审批日志文档

This commit is contained in:
wangli 2025-06-09 15:37:06 +08:00
parent 7c8d00d934
commit f3b87976e0
7 changed files with 14 additions and 12 deletions

View File

@ -9,6 +9,7 @@ import java.util.Arrays;
* @since 2023/9/18 17:11
*/
public enum BpmnProcessTaskResultEnum {
HANDLING("HANDLING", "审批中"), // 修改这里
PENDING("PENDING", "待处理"),
PROCESSED("PROCESSED", "已处理"),
AUTO_SKIP("AUTO_SKIP", "任务自动跳过"),

View File

@ -52,7 +52,7 @@ public class CustomActivityTriggerCmd extends AbstractCommand<Void> implements S
if (Objects.isNull(task)) {
throw new WorkflowEngineException(ACTIVITY_TRIGGER_NOT_EXISTS, dto.getTriggerId());
}
addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, "已处理");
addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, "(已同意)");
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
runtimeService.trigger(dto.getTriggerId());
return null;

View File

@ -134,7 +134,7 @@ public class CustomCancelProcessInstanceCmd extends AbstractCommand<Void> implem
// 添加自定义的节点,用于展示最后的操作
TaskEntity task = createVirtualTask(commandContext, extAxHiTaskInstService, processInstanceId,
nodeName, NODE_CANCEL.getType(), reason, initiator, CANCELLED.getStatus(), new AddComment(CANCELLED.getDesc()));
nodeName, NODE_CANCEL.getType(), reason, initiator, CANCELLED.getStatus(), new AddComment("" + CANCELLED.getDesc() + ""));
batchAddAttachment(commandContext, processInstanceId, task, attachmentList, initiator);

View File

@ -46,7 +46,7 @@ import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.APPROVED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum.PENDING;
import static cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum.HANDLING;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getActivitySignature;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApprovalMethod;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getNodeType;
@ -93,7 +93,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
log.setNodeMode((isNodeStarter ? BpmnFlowNodeMode.GENERAL : getNodeMode(flowElement)).getType());
log.setTaskId(taskEntity.getId());
String operationDesc = taskEntity.getVariable(COMMENT_TYPE_OPERATION_DESC, String.class);
log.setOperationDesc(StringUtils.hasText(operationDesc) ? operationDesc : PENDING.getDesc());
log.setOperationDesc(StringUtils.hasText(operationDesc) ? operationDesc : "" + HANDLING.getDesc() + "");
log.setStartTime(taskEntity.getCreateTime());
log.setStatus(PROCESSING.getStatus());
log.setSignature(getActivitySignature(flowElement));
@ -143,7 +143,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
ExtAxProcessLog queryLog = new ExtAxProcessLog();
queryLog.setProcessInstanceId(taskEntity.getProcessInstanceId());
queryLog.setTaskId(taskEntity.getId());
queryLog.setOperationDesc(PENDING.getDesc());
queryLog.setOperationDesc("" + HANDLING.getDesc() + "");
ExtAxProcessLog update = new ExtAxProcessLog();
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();

View File

@ -41,6 +41,7 @@ import static org.flowable.common.engine.impl.interceptor.EngineConfigurationCon
public class AutoPassTransactionListener implements TransactionListener {
private final DelegateTask delegateTask;
private final String advice;
private final String operationDesc;
@Override
public void execute(CommandContext commandContext) {

View File

@ -1573,7 +1573,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
switch (e.getApprovalMethod()) {
case bizSpecify:
case nobody:
build.setOperationDesc("待处理");
build.setOperationDesc("");
break;
case autoPassed:
case autoRejection:
@ -1622,10 +1622,10 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
}
switch (i.getNodeMode()) {
case AND:
i.setOperationDesc(assigners.size() + "人会签,需要全部同意");
i.setOperationDesc(assigners.size() + "人会签,需要全部同意(审批中)");
break;
case OR:
i.setOperationDesc(assigners.size() + "人或签,仅一人同意即可");
i.setOperationDesc(assigners.size() + "人或签,仅一人同意即可(审批中)");
break;
default:
// 不修改操作描述
@ -1651,7 +1651,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
.nodeType(BpmnFlowNodeType.valueOfType(e.getNodeType()))
.nodeMode(BpmnFlowNodeMode.valueOfType(e.getNodeMode()))
.result(BpmnProcessInstanceResultEnum.valueOfStatus(e.getStatus()))
.operationDesc(e.getOperationDesc())
.operationDesc(Objects.equals(e.getStatus(), PROCESSING.getStatus()) ? e.getOperationDesc() + "(审批中)" : e.getOperationDesc())
.advice(e.getAdvice())
.commentExt("")
.buttonConf(e.getButtonConf())

View File

@ -197,9 +197,9 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
* @param delegateTask 自动操作的任务
* @param advice 添加自动操作任务时的额外意见
*/
private void autoPass(DelegateTask delegateTask, @Nullable String advice) {
private void autoPass(DelegateTask delegateTask, @Nullable String advice, @Nullable String operationDesc) {
Context.getTransactionContext().addTransactionListener(TransactionState.COMMITTED,
new AutoPassTransactionListener(delegateTask, advice));
new AutoPassTransactionListener(delegateTask, advice, operationDesc));
}
/**
@ -208,7 +208,7 @@ public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<Ta
* @param delegateTask 自动操作的任务
*/
private void autoPass(DelegateTask delegateTask) {
autoPass(delegateTask, null);
autoPass(delegateTask, null, null);
}
}