数据总览作业模式展示算力
This commit is contained in:
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.sdm.common.entity.resp.BaseResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -118,6 +119,10 @@ public class FileMetadataInfoResp extends BaseResp implements Serializable {
|
||||
@Schema(description = "权限值")
|
||||
private Integer permissionValue;
|
||||
|
||||
|
||||
@Schema(description = "算列信息")
|
||||
private SimulationRunResp simulationRunResp;
|
||||
|
||||
private String approvalStatus;
|
||||
private String approveType;
|
||||
private String tempMetadata;
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.sdm.common.entity.resp.project;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
public class SimulationRunResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String uuid;
|
||||
|
||||
private String runName;
|
||||
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String taskId;
|
||||
|
||||
@Schema(description= "流程模板id")
|
||||
private String flowTemplate;
|
||||
|
||||
@Schema(description= "Run状态 0:未执行 1:执行中 2:完成 3:失败")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description= "Run总共的流程步骤")
|
||||
private Integer totalStep;
|
||||
|
||||
@Schema(description= "当前的流程步骤")
|
||||
private Integer currentStep;
|
||||
|
||||
@Schema(description= "当前的流程步骤名称")
|
||||
private String currentStepName;
|
||||
|
||||
@Schema(description= "Run执行结果 0:gray 1:red 2:yellow 3:green")
|
||||
private Integer achieveStatus;
|
||||
|
||||
@Schema(description= "run描述信息")
|
||||
private String description;
|
||||
|
||||
@Schema(description= "Run对应在文件系统中的路径")
|
||||
private Long folderId;
|
||||
|
||||
@Schema(description= "计算父版本Id")
|
||||
private String parentId;
|
||||
|
||||
private Integer isPersonalTemplate;
|
||||
|
||||
@Schema(description= "租户id")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description= "英文名")
|
||||
private Long englishName;
|
||||
|
||||
@Schema(description= "创建者ID")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description= "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description= "更新者ID")
|
||||
private Long updater;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "flowable流程完成部署后的流程定义id,根据这个发起流程实例")
|
||||
public String processDefinitionId;
|
||||
|
||||
@Schema(description= "流程实例id(流程引擎返回的)")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description= "完成时间")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
}
|
||||
@@ -3,9 +3,11 @@ package com.sdm.common.feign.impl.project;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunInfoListReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationNodeFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -17,7 +19,7 @@ import java.util.List;
|
||||
@Component
|
||||
public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient {
|
||||
@Autowired
|
||||
ISimulationNodeFeignClient ISimulationNodeFeignClient;
|
||||
ISimulationNodeFeignClient simulationNodeFeignClient;
|
||||
|
||||
/**
|
||||
* 根据节点类型和节点ID获取所有节点信息
|
||||
@@ -30,7 +32,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("根据节点类型和节点ID获取所有节点信息请求参数:nodeId={}, nodeType={}", nodeId, nodeType);
|
||||
response = ISimulationNodeFeignClient.getAllNodeByNodeType(nodeId, nodeType);
|
||||
response = simulationNodeFeignClient.getAllNodeByNodeType(nodeId, nodeType);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取节点信息失败");
|
||||
}
|
||||
@@ -52,7 +54,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("根据项目ID和节点类型获取所有节点信息请求参数:uuid={}, nextNodeType={}", uuids, nextNodeType);
|
||||
response = ISimulationNodeFeignClient.getAllNodeByProjectIdAndType(uuids, nextNodeType);
|
||||
response = simulationNodeFeignClient.getAllNodeByProjectIdAndType(uuids, nextNodeType);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取节点信息失败");
|
||||
}
|
||||
@@ -70,7 +72,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("获取节点下的task列表请求参数:uuid={}", uuids);
|
||||
response = ISimulationNodeFeignClient.getNodeTaskList(uuids);
|
||||
response = simulationNodeFeignClient.getNodeTaskList(uuids);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取节点下的task列表失败");
|
||||
}
|
||||
@@ -86,7 +88,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("获取task下的run请求参数:uuid={}", uuids);
|
||||
response = ISimulationNodeFeignClient.getTaskRunList(uuids);
|
||||
response = simulationNodeFeignClient.getTaskRunList(uuids);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取task下的run失败");
|
||||
}
|
||||
@@ -103,7 +105,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
SdmResponse response;
|
||||
try {
|
||||
log.info("删除节点请求参数:{}", req);
|
||||
response = ISimulationNodeFeignClient.delteNode(req);
|
||||
response = simulationNodeFeignClient.delteNode(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("删除节点失败");
|
||||
}
|
||||
@@ -118,7 +120,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
public SdmResponse list(SpdmNodeListReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = ISimulationNodeFeignClient.list(req);
|
||||
response = simulationNodeFeignClient.list(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
@@ -133,7 +135,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
public SdmResponse<List<SimulationNodeResp>> querySimulationNodeByUuids(List<String> uuids) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = ISimulationNodeFeignClient.querySimulationNodeByUuids(uuids);
|
||||
response = simulationNodeFeignClient.querySimulationNodeByUuids(uuids);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
@@ -147,7 +149,7 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
@Override
|
||||
public SdmResponse<List<String>> getRunListByNodeId(SpdmQueryRunListReq req) {
|
||||
try {
|
||||
SdmResponse<List<String>> runListByNodeId = ISimulationNodeFeignClient.getRunListByNodeId(req);
|
||||
SdmResponse<List<String>> runListByNodeId = simulationNodeFeignClient.getRunListByNodeId(req);
|
||||
if (!runListByNodeId.isSuccess()){
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
@@ -157,4 +159,18 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<SimulationRunResp>> getRunListByRunIdList(SpdmQueryRunInfoListReq req) {
|
||||
try {
|
||||
SdmResponse<List<SimulationRunResp>> runListByRunIdList = simulationNodeFeignClient.getRunListByRunIdList(req);
|
||||
if (!runListByRunIdList.isSuccess()){
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
return runListByRunIdList;
|
||||
} catch (Exception e) {
|
||||
log.error("查询失败", e);
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.sdm.common.feign.inter.project;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunInfoListReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -69,5 +71,13 @@ public interface ISimulationNodeFeignClient {
|
||||
@PostMapping("/getRunListByNodeId")
|
||||
SdmResponse<List<String>> getRunListByNodeId(@RequestBody SpdmQueryRunListReq req);
|
||||
|
||||
/**
|
||||
* 根据算列id查询所有算例详情
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getRunListByRunIdList")
|
||||
SdmResponse<List<SimulationRunResp>> getRunListByRunIdList(@RequestBody SpdmQueryRunInfoListReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sdm.data.model.dto;
|
||||
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -13,11 +13,13 @@ import com.sdm.common.entity.req.data.DelDirReq;
|
||||
import com.sdm.common.entity.req.data.DelFileReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunInfoListReq;
|
||||
import com.sdm.common.entity.req.project.SpdmQueryRunListReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.project.SimulationNodeFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
@@ -426,7 +428,34 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
return processAndPageResults(runFileInfos, req);
|
||||
SdmResponse<PageDataResp<List<FileMetadataChildrenDTO>>> pageDataRespSdmResponse = processAndPageResults(runFileInfos, req);
|
||||
// 设置算列信息
|
||||
dealRunInfo(pageDataRespSdmResponse);
|
||||
|
||||
return pageDataRespSdmResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询并设置算列信息
|
||||
* @param pageDataRespSdmResponse
|
||||
*/
|
||||
private void dealRunInfo(SdmResponse<PageDataResp<List<FileMetadataChildrenDTO>>> pageDataRespSdmResponse) {
|
||||
List<FileMetadataChildrenDTO> runInfo = pageDataRespSdmResponse.getData().getData();
|
||||
List<String> runUUids = runInfo.stream()
|
||||
.flatMap(fileMetadataChildrenDTO -> fileMetadataChildrenDTO.getMergeSameNameChildren().stream())
|
||||
.map(FileMetadataInfoResp::getRelatedResourceUuid).toList();
|
||||
SpdmQueryRunInfoListReq spdmQueryRunInfoListReq = new SpdmQueryRunInfoListReq();
|
||||
spdmQueryRunInfoListReq.setRunIdList(runUUids);
|
||||
SdmResponse<List<SimulationRunResp>> runListByRunIdList = simuluationNodeFeignClient.getRunListByRunIdList(spdmQueryRunInfoListReq);
|
||||
if(runListByRunIdList.isSuccess()){
|
||||
Map<String, SimulationRunResp> runUUId2RunInfoMap = runListByRunIdList.getData().stream().collect(Collectors.toMap(SimulationRunResp::getUuid, t -> t));
|
||||
for (FileMetadataChildrenDTO fileMetadataChildrenDTO : runInfo) {
|
||||
fileMetadataChildrenDTO.setSimulationRunResp(runUUId2RunInfoMap.get(fileMetadataChildrenDTO.getRelatedResourceUuid()));
|
||||
for (FileMetadataInfoResp mergeSameNameChild : fileMetadataChildrenDTO.getMergeSameNameChildren()) {
|
||||
mergeSameNameChild.setSimulationRunResp(runUUId2RunInfoMap.get(mergeSameNameChild.getRelatedResourceUuid()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SdmResponse<PageDataResp<List<FileMetadataChildrenDTO>>> handleRootDirectory(ListSimulationNodeTreeReq req, Long tenantId) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.project.*;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationNodeFeignClient;
|
||||
import com.sdm.common.log.annotation.SysLog;
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
@@ -342,7 +343,7 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
|
||||
*/
|
||||
@PostMapping("/getRunListByRunIdList")
|
||||
@Operation(summary = "根据节点id查询所有算例", description = "根据节点id查询所有算例")
|
||||
public SdmResponse<List<SimulationRun>> getRunListByRunIdList(@RequestBody @Validated SpdmQueryRunInfoListReq req) {
|
||||
public SdmResponse<List<SimulationRunResp>> getRunListByRunIdList(@RequestBody @Validated SpdmQueryRunInfoListReq req) {
|
||||
return nodeService.getRunListByRunIdList(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.project.*;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import com.sdm.project.model.entity.SimulationNode;
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.sdm.project.model.req.*;
|
||||
@@ -79,6 +80,6 @@ public interface INodeService extends IService<SimulationNode> {
|
||||
|
||||
SdmResponse<List<String>> getRunListByNodeId(SpdmQueryRunListReq req);
|
||||
|
||||
SdmResponse<List<SimulationRun>> getRunListByRunIdList(SpdmQueryRunInfoListReq req);
|
||||
SdmResponse<List<SimulationRunResp>> getRunListByRunIdList(SpdmQueryRunInfoListReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.sdm.common.entity.req.system.QueryGroupDetailReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationRunResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.entity.resp.system.SysUserGroupDetailResp;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
@@ -2383,8 +2384,17 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<SimulationRun>> getRunListByRunIdList(SpdmQueryRunInfoListReq req) {
|
||||
return SdmResponse.success(simulationRunService.lambdaQuery().in(SimulationRun::getUuid, req.getRunIdList()).list());
|
||||
public SdmResponse<List<SimulationRunResp>> getRunListByRunIdList(SpdmQueryRunInfoListReq req) {
|
||||
List<SimulationRun> list = simulationRunService.lambdaQuery().in(SimulationRun::getUuid, req.getRunIdList()).list();
|
||||
if(CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(emptyList());
|
||||
}
|
||||
List<SimulationRunResp> simulationRunResps = list.stream().map(simulationRun -> {
|
||||
SimulationRunResp simulationRunResp = new SimulationRunResp();
|
||||
BeanUtils.copyProperties(simulationRun, simulationRunResp);
|
||||
return simulationRunResp;
|
||||
}).toList();
|
||||
return SdmResponse.success(simulationRunResps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user