1
This commit is contained in:
parent
b82cf8ab00
commit
2515ab3d14
@ -68,7 +68,7 @@ public class WorkflowInstanceApiController extends BaseController<WorkflowInstan
|
|||||||
|
|
||||||
@Operation(summary = "分页查询历史实例")
|
@Operation(summary = "分页查询历史实例")
|
||||||
@GetMapping("/historical-instances")
|
@GetMapping("/historical-instances")
|
||||||
public Response<Page<WorkflowHistoricalInstancesDTO>> historicalInstances(@RequestBody WorkflowHistoricalInstancesQuery query) {
|
public Response<Page<WorkflowHistoricalInstancesDTO>> historicalInstances(WorkflowHistoricalInstancesQuery query) {
|
||||||
return Response.success(workflowInstanceService.historicalInstances(query));
|
return Response.success(workflowInstanceService.historicalInstances(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flowable配置类
|
* Flowable配置类
|
||||||
@ -45,6 +46,6 @@ public class FlowableConfig implements EngineConfigurationConfigurer<SpringProce
|
|||||||
// engineConfiguration.setEnableProcessDefinitionInfoCache(false);
|
// engineConfiguration.setEnableProcessDefinitionInfoCache(false);
|
||||||
|
|
||||||
// 添加事件监听器
|
// 添加事件监听器
|
||||||
engineConfiguration.setEventListeners(Arrays.asList(flowableEventDispatcher));
|
engineConfiguration.setEventListeners(Collections.singletonList(flowableEventDispatcher));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -220,7 +220,7 @@ public class WorkflowInstanceServiceImpl extends BaseServiceImpl<WorkflowInstanc
|
|||||||
Process process = bpmnModel.getMainProcess();
|
Process process = bpmnModel.getMainProcess();
|
||||||
//排序
|
//排序
|
||||||
List<FlowElement> flowElements = FlowableUtils.sortFlowElements(process);
|
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));
|
Map<String, WorkflowNodeInstance> nodeWorkflowNodeInstance = nodeInstances.stream().collect(Collectors.toMap(WorkflowNodeInstance::getNodeId, nodeInstance -> nodeInstance));
|
||||||
List<WorkflowNodeInstance> nodeResult = new ArrayList<>();
|
List<WorkflowNodeInstance> nodeResult = new ArrayList<>();
|
||||||
flowElements.forEach(v -> {
|
flowElements.forEach(v -> {
|
||||||
@ -229,7 +229,7 @@ public class WorkflowInstanceServiceImpl extends BaseServiceImpl<WorkflowInstanc
|
|||||||
WorkflowNodeInstance empty = new WorkflowNodeInstance();
|
WorkflowNodeInstance empty = new WorkflowNodeInstance();
|
||||||
empty.setStatus(WorkflowNodeInstanceStatusEnums.NOT_STARTED);
|
empty.setStatus(WorkflowNodeInstanceStatusEnums.NOT_STARTED);
|
||||||
empty.setNodeId(v.getId());
|
empty.setNodeId(v.getId());
|
||||||
empty.setNodeId(v.getName());
|
empty.setNodeName(v.getName());
|
||||||
nodeResult.add(empty);
|
nodeResult.add(empty);
|
||||||
} else {
|
} else {
|
||||||
nodeResult.add(workflowNodeInstance);
|
nodeResult.add(workflowNodeInstance);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user