Merge branch 'feature/REQ-5965' into dev

This commit is contained in:
wangli 2025-11-06 18:36:57 +08:00
commit 48feb8f46c
5 changed files with 23 additions and 3 deletions

View File

@ -106,7 +106,9 @@ public class BpmnTaskAuditDTO {
private String operationDesc; private String operationDesc;
/** /**
* 更新或新增流程变量 * 更新或新增流程变量,
* <p>
* 如果不修改则map value 设置为 null内部会自动过滤
*/ */
private Map<String, Object> variables; private Map<String, Object> variables;
} }

View File

@ -109,7 +109,7 @@ public class SupportRefreshProperties {
@Value("${workflow.ignoreMqAlterApplicationNames:}") @Value("${workflow.ignoreMqAlterApplicationNames:}")
private List<String> ignoreMqAlterApplicationNames; private List<String> ignoreMqAlterApplicationNames;
@Value("${workflow.processLogHtmlUrl:https://taskflow-web.axzo.cn/#/document/log?processInstanceId=%s&personId=%d}") @Value("${workflow.processLogHtmlUrl:https://taskflow-web.axzo.cn/#/document/log?processInstanceId=%s&personId=%s}")
private String processLogHtmlUrl; private String processLogHtmlUrl;
} }

View File

@ -67,7 +67,9 @@ public class CustomGetProcessInstanceVariablesCmd extends AbstractCommand<Map<St
HistoryService historyService = processEngineConfiguration.getHistoryService(); HistoryService historyService = processEngineConfiguration.getHistoryService();
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(processInstanceId).includeProcessVariables().singleResult(); .processInstanceId(processInstanceId).includeProcessVariables().singleResult();
if (Objects.isNull(instance)) {
return variables;
}
variables.put(PRINT_VAR_PROCESS_NAME, instance.getName()); variables.put(PRINT_VAR_PROCESS_NAME, instance.getName());
variables.put(PRINT_VAR_PROCESS_BELONG_TENANT_ID, instance.getTenantId()); variables.put(PRINT_VAR_PROCESS_BELONG_TENANT_ID, instance.getTenantId());
// 添加流程开始时间 // 添加流程开始时间

View File

@ -1,9 +1,13 @@
package cn.axzo.workflow.core.repository.mapper; package cn.axzo.workflow.core.repository.mapper;
import cn.axzo.workflow.core.conf.handler.ListAssigneeTypeHandler;
import cn.axzo.workflow.core.repository.entity.ExtAxProcessLog; import cn.axzo.workflow.core.repository.entity.ExtAxProcessLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;
@Mapper @Mapper
public interface ExtAxProcessLogMapper extends BaseMapperX<ExtAxProcessLog> { public interface ExtAxProcessLogMapper extends BaseMapperX<ExtAxProcessLog> {
@ -13,5 +17,8 @@ public interface ExtAxProcessLogMapper extends BaseMapperX<ExtAxProcessLog> {
@Select("select * from ext_ax_process_log WHERE process_instance_id = #{processInstanceId} and task_id = #{taskId}") @Select("select * from ext_ax_process_log WHERE process_instance_id = #{processInstanceId} and task_id = #{taskId}")
@Results({
@Result(column = "assignee_full", property = "assigneeFull", jdbcType = JdbcType.ARRAY, typeHandler = ListAssigneeTypeHandler.class)
})
ExtAxProcessLog findByProcessIdAndTaskIdWithDeleted(String processInstanceId, String taskId); ExtAxProcessLog findByProcessIdAndTaskIdWithDeleted(String processInstanceId, String taskId);
} }

View File

@ -54,6 +54,7 @@ import javax.validation.constraints.NotEmpty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_OPERATION_PARAM_INVALID; import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_OPERATION_PARAM_INVALID;
@ -112,6 +113,10 @@ public class BpmnProcessTaskController extends BasicPopulateAvatarController imp
if (!StringUtils.hasText(dto.getTaskId())) { if (!StringUtils.hasText(dto.getTaskId())) {
dto.setTaskId(bpmnProcessTaskService.findTaskIdByInstanceIdAndPersonId(dto.getProcessInstanceId(), dto.getApprover().getPersonId())); dto.setTaskId(bpmnProcessTaskService.findTaskIdByInstanceIdAndPersonId(dto.getProcessInstanceId(), dto.getApprover().getPersonId()));
} }
// 移除 variable value null key
dto.getVariables().entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
List<AttachmentDTO> tempAttachments = ListUtils.defaultIfNull(dto.getAttachmentList(), new ArrayList<>()); List<AttachmentDTO> tempAttachments = ListUtils.defaultIfNull(dto.getAttachmentList(), new ArrayList<>());
if (StringUtils.hasText(dto.getSignatureUrl())) { if (StringUtils.hasText(dto.getSignatureUrl())) {
AttachmentDTO signature = new AttachmentDTO(); AttachmentDTO signature = new AttachmentDTO();
@ -138,6 +143,10 @@ public class BpmnProcessTaskController extends BasicPopulateAvatarController imp
if (!StringUtils.hasText(dto.getTaskId())) { if (!StringUtils.hasText(dto.getTaskId())) {
dto.setTaskId(bpmnProcessTaskService.findTaskIdByInstanceIdAndPersonId(dto.getProcessInstanceId(), dto.getApprover().getPersonId())); dto.setTaskId(bpmnProcessTaskService.findTaskIdByInstanceIdAndPersonId(dto.getProcessInstanceId(), dto.getApprover().getPersonId()));
} }
// 移除 variable value null key
dto.getVariables().entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
List<AttachmentDTO> tempAttachments = ListUtils.defaultIfNull(dto.getAttachmentList(), new ArrayList<>()); List<AttachmentDTO> tempAttachments = ListUtils.defaultIfNull(dto.getAttachmentList(), new ArrayList<>());
if (StringUtils.hasText(dto.getSignatureUrl())) { if (StringUtils.hasText(dto.getSignatureUrl())) {
AttachmentDTO signature = new AttachmentDTO(); AttachmentDTO signature = new AttachmentDTO();