feat:任务执行流程

This commit is contained in:
2025-12-01 20:33:16 +08:00
parent f4721f8150
commit 51c71182ca
2 changed files with 14 additions and 16 deletions

View File

@@ -979,28 +979,22 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
if (sdmResponse.getData() != null) {
List<FlowNodeDto> flowNodeDtoList = sdmResponse.getData();
SimulationRun simulationRun = this.lambdaQuery().eq(SimulationRun::getUuid, req.getRunId()).one();
if (simulationRun.getFlowInstanceId() != null) {
SdmResponse<ProcessInstanceDetailResponse> response = flowableFeignClient.getProcessAndNodeDetailByInstanceId(simulationRun.getFlowInstanceId());
if (response.getData() != null && CollectionUtils.isNotEmpty(response.getData().getNodes())) {
for (FlowNodeDto flowNodeDto : flowNodeDtoList) {
response.getData().getNodes().stream().filter(i -> StringUtils.equals(i.getId(), flowNodeDto.getNodeId())).findFirst().ifPresent(i -> {
flowNodeDto.setNodeStatus(i.getStatus());
});
}
SdmResponse<ProcessInstanceDetailResponse> response = flowableFeignClient.getProcessAndNodeDetailByInstanceId(simulationRun.getProcessDefinitionId(), simulationRun.getFlowInstanceId());
if (response.getData() != null && CollectionUtils.isNotEmpty(response.getData().getNodes())) {
for (FlowNodeDto flowNodeDto : flowNodeDtoList) {
response.getData().getNodes().stream().filter(i -> StringUtils.equals(i.getId(), flowNodeDto.getNodeId())).findFirst().ifPresent(i -> {
flowNodeDto.setNodeStatus(i.getStatus());
flowNodeDto.setUserParams(i.getUserParam());
});
}
} else {
}
if (simulationRun.getFlowInstanceId() == null) {
flowNodeDtoList.forEach(node -> {
node.setNodeStatus("pending");
});
}
List<NodeStructureInfo> nodeStructureInfoList = flowableFeignClient.listNodesByProcessDefinitionId(simulationRun.getProcessDefinitionId()).getData();
if (CollectionUtils.isNotEmpty(nodeStructureInfoList)) {
for (FlowNodeDto flowNodeDto : flowNodeDtoList) {
nodeStructureInfoList.stream().filter(i -> StringUtils.equals(i.getId(), flowNodeDto.getNodeId())).findFirst().ifPresent(i -> {
});
}
}
return SdmResponse.success(flowNodeDtoList);
}
return SdmResponse.success(new ArrayList<>());