This commit is contained in:
asp_ly 2024-12-17 21:02:03 +08:00
parent b82cf8ab00
commit 2515ab3d14
3 changed files with 5 additions and 4 deletions

View File

@ -68,7 +68,7 @@ public class WorkflowInstanceApiController extends BaseController<WorkflowInstan
@Operation(summary = "分页查询历史实例")
@GetMapping("/historical-instances")
public Response<Page<WorkflowHistoricalInstancesDTO>> historicalInstances(@RequestBody WorkflowHistoricalInstancesQuery query) {
public Response<Page<WorkflowHistoricalInstancesDTO>> historicalInstances(WorkflowHistoricalInstancesQuery query) {
return Response.success(workflowInstanceService.historicalInstances(query));
}

View File

@ -7,6 +7,7 @@ import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
import java.util.Collections;
/**
* Flowable配置类
@ -45,6 +46,6 @@ public class FlowableConfig implements EngineConfigurationConfigurer<SpringProce
// engineConfiguration.setEnableProcessDefinitionInfoCache(false);
// 添加事件监听器
engineConfiguration.setEventListeners(Arrays.asList(flowableEventDispatcher));
engineConfiguration.setEventListeners(Collections.singletonList(flowableEventDispatcher));
}
}

View File

@ -220,7 +220,7 @@ public class WorkflowInstanceServiceImpl extends BaseServiceImpl<WorkflowInstanc
Process process = bpmnModel.getMainProcess();
//排序
List<FlowElement> flowElements = FlowableUtils.sortFlowElements(process);
List<WorkflowNodeInstance> nodeInstances = workflowNodeInstanceRepository.findByWorkflowInstanceId(41L);
List<WorkflowNodeInstance> nodeInstances = workflowNodeInstanceRepository.findByWorkflowInstanceId(workflowInstance.getId());
Map<String, WorkflowNodeInstance> nodeWorkflowNodeInstance = nodeInstances.stream().collect(Collectors.toMap(WorkflowNodeInstance::getNodeId, nodeInstance -> nodeInstance));
List<WorkflowNodeInstance> nodeResult = new ArrayList<>();
flowElements.forEach(v -> {
@ -229,7 +229,7 @@ public class WorkflowInstanceServiceImpl extends BaseServiceImpl<WorkflowInstanc
WorkflowNodeInstance empty = new WorkflowNodeInstance();
empty.setStatus(WorkflowNodeInstanceStatusEnums.NOT_STARTED);
empty.setNodeId(v.getId());
empty.setNodeId(v.getName());
empty.setNodeName(v.getName());
nodeResult.add(empty);
} else {
nodeResult.add(workflowNodeInstance);