feat:任务执行流程
This commit is contained in:
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class FlowNodeDto {
|
||||
@@ -37,6 +38,9 @@ public class FlowNodeDto {
|
||||
@Schema(description = "节点状态:finished/active/pending")
|
||||
private String nodeStatus;
|
||||
|
||||
@Schema(description = "用户输入参数")
|
||||
private Map<String, Object> userParams;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private Long creator;
|
||||
|
||||
|
||||
@@ -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<>());
|
||||
|
||||
Reference in New Issue
Block a user