优化数据总览

This commit is contained in:
2025-11-25 16:16:23 +08:00
parent 2a135df92f
commit dfc9647064
12 changed files with 161 additions and 46 deletions

View File

@@ -141,6 +141,24 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
return nodeService.getAllNodeByProjectIdAndType(uuid, nextNodeType);
}
/**
* 获取节点下的task列表
*/
@GetMapping("/getNodeTaskList")
@Operation(summary = "获取节点下的task列表", description = "获取节点下的task列表")
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(@RequestParam(value = "uuid") String uuid) {
return nodeService.getNodeTaskList(uuid);
}
/**
* 获取task下的run
*/
@GetMapping("/getNodeTaskRunList")
@Operation(summary = "获取task下的run", description = "获取task下的run")
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(@RequestParam(value = "uuid") String uuid) {
return nodeService.getTaskRunList(uuid);
}
/**
* 用户组项目统计

View File

@@ -11,6 +11,7 @@ import com.sdm.common.entity.resp.project.SimulationNodeResp;
import com.sdm.project.model.entity.SimulationNode;
import com.sdm.project.model.req.*;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@@ -35,6 +36,10 @@ public interface INodeService extends IService<SimulationNode> {
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(String uuid, String nextNodeType);
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(String uuid);
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(String uuid);
SdmResponse getUserGroupProjectStatistics(Long userGroupId, Long userId);
SdmResponse getUserGroupTaskCompleteStatistics(GetUserGroupTaskCompleteStatisticsReq req);

View File

@@ -756,6 +756,49 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
return SdmResponse.success(allNodeByProjectIdAndTypeRespList);
}
@Override
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(String uuid) {
if(ObjectUtils.isEmpty(uuid)){
return SdmResponse.success();
}
List<SimulationTask> simulationTasks = simulationTaskService.lambdaQuery().eq(SimulationTask::getNodeId, uuid).list();
if(CollectionUtils.isEmpty(simulationTasks)){
return SdmResponse.success();
}
List<AllNodeByProjectIdAndTypeResp> allNodeByProjectIdAndTypeRespList = new ArrayList<>();
simulationTasks.forEach(simulationTask -> {
AllNodeByProjectIdAndTypeResp allNodeByProjectIdAndTypeResp = new AllNodeByProjectIdAndTypeResp();
allNodeByProjectIdAndTypeResp.setId(simulationTask.getId().longValue());
allNodeByProjectIdAndTypeResp.setUuid(simulationTask.getUuid());
allNodeByProjectIdAndTypeResp.setNodeName(simulationTask.getTaskName());
allNodeByProjectIdAndTypeResp.setNodeType(NodeTypeEnum.TASK.getValue());
allNodeByProjectIdAndTypeRespList.add(allNodeByProjectIdAndTypeResp);
});
return SdmResponse.success(allNodeByProjectIdAndTypeRespList);
}
@Override
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(String uuid) {
if(ObjectUtils.isEmpty(uuid)){
return SdmResponse.success();
}
List<SimulationRun> simulationRunList = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, uuid).list();
if(CollectionUtils.isEmpty(simulationRunList)){
return SdmResponse.success();
}
List<AllNodeByProjectIdAndTypeResp> allNodeByProjectIdAndTypeRespList = new ArrayList<>();
simulationRunList.forEach(simulationRun -> {
AllNodeByProjectIdAndTypeResp allNodeByProjectIdAndTypeResp = new AllNodeByProjectIdAndTypeResp();
allNodeByProjectIdAndTypeResp.setId(simulationRun.getId().longValue());
allNodeByProjectIdAndTypeResp.setUuid(simulationRun.getUuid());
allNodeByProjectIdAndTypeResp.setNodeName(simulationRun.getRunName());
allNodeByProjectIdAndTypeResp.setNodeType(NodeTypeEnum.RUN.getValue());
allNodeByProjectIdAndTypeRespList.add(allNodeByProjectIdAndTypeResp);
});
return SdmResponse.success(allNodeByProjectIdAndTypeRespList);
}
public static void setTagProperty(Object obj, String propertyName, Object value) throws Exception {
Class<?> clazz = obj.getClass();
Field field = clazz.getDeclaredField(propertyName);