数据总览优化

优化文件检索
This commit is contained in:
2025-11-06 16:18:40 +08:00
parent 4f224f37ef
commit 76b132b580
31 changed files with 623 additions and 532 deletions

View File

@@ -50,8 +50,8 @@ public class Constants {
}
}
@Schema(description = "文件类型枚举")
public enum FileType {
@Schema(description = "文件业务类型枚举")
public enum FileBizType {
/**
* 模型文件
*/
@@ -81,21 +81,33 @@ public class Constants {
@Schema(description = "云图文件", example = "5")
CLOUD_FILE(5),
/**
* 网格文件
*/
@Schema(description = "网格文件", example = "6")
GRID_FILE(6),
/**
* 计算过程文件
*/
@Schema(description = "计算过程文件", example = "7")
COMPUTE_PROCESS_FILE(7),
/**
* 项目文件
*/
@Schema(description = "项目 文件", example = "6")
PROJECT_FILE(6),
PROJECT_FILE(101),
/**
* 学科文件
*/
@Schema(description = "学科 文件", example = "7")
DISCIPLINE_MAJOR_FILE(7);
DISCIPLINE_MAJOR_FILE(102);
int value;
FileType(int i) {
FileBizType(int i) {
value = i;
}
@@ -181,4 +193,18 @@ public class Constants {
return value;
}
}
public enum NodeTypeEnum {
TASK("task"),
RUN("run");
String value;
NodeTypeEnum(String i) {
value = i;
}
public String getValue() {
return value;
}
}
}

View File

@@ -1,6 +1,5 @@
package com.sdm.common.entity.req.data;
import com.sdm.common.common.Constants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -24,10 +23,14 @@ public class CreateDirReq {
private Integer type = 0;
// 当前节点id
@Schema(description = "当前节点id")
private Long nodeId;
@Schema(description = "当前待创建节点uuid")
private String uuId;
// 当前待创建节点uuid所属类型
@Schema(description = "当前待创建节点uuid所属类型:node,task,run,performance")
private String uuIdOwnType;
// 父节点id
@Schema(description = "当前父节点id")
private Long parentNodeId;
private String parentUuId;
}

View File

@@ -0,0 +1,13 @@
package com.sdm.common.entity.req.project;
import lombok.Data;
@Data
public class DelNodeReq {
private String uuid;
/**
* uuid所属类型例如project, task, run
*/
private String uuidOwnType;
}

View File

@@ -0,0 +1,15 @@
package com.sdm.common.entity.req.project;
import lombok.Data;
@Data
public class RenameNodeReq {
private String uuid;
/**
* uuid所属类型例如project, task, run
*/
private String uuidOwnType;
private String newName;
}

View File

@@ -1,8 +1,10 @@
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.RenameNodeReq;
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
import com.sdm.common.feign.inter.project.ISimuluationNodeFeignClient;
import com.sdm.common.feign.inter.project.ISimulationNodeFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -11,9 +13,9 @@ import java.util.List;
@Slf4j
@Component
public class SimuluationNodeFeignClientImpl implements ISimuluationNodeFeignClient {
public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient {
@Autowired
ISimuluationNodeFeignClient ISimuluationNodeFeignClient;
ISimulationNodeFeignClient ISimulationNodeFeignClient;
/**
* 根据节点类型和节点ID获取所有节点信息
@@ -22,10 +24,10 @@ public class SimuluationNodeFeignClientImpl implements ISimuluationNodeFeignClie
* @param nodeId 节点ID
* @return SdmResponse<List<AllNodeByProjectIdAndTypeResp>> key 为节点idvalue 为节点名称
*/
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByNodeType(Long nodeId,String nodeType){
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByNodeType(Long nodeId, String nodeType) {
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
try {
response = ISimuluationNodeFeignClient.getAllNodeByNodeType(nodeId,nodeType);
response = ISimulationNodeFeignClient.getAllNodeByNodeType(nodeId, nodeType);
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
return SdmResponse.failed("获取节点信息失败");
}
@@ -39,14 +41,14 @@ public class SimuluationNodeFeignClientImpl implements ISimuluationNodeFeignClie
/**
* 根据项目ID和节点类型获取所有节点信息
*
* @param chooseNodeId 项目ID
* @param uuid 项目ID
* @param nextNodeType 下一级节点类型
* @return SdmResponse<AllNodeByProjectIdAndTypeResp> 节点信息
*/
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(Long chooseNodeId, String nextNodeType){
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(String uuid, String nextNodeType) {
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
try {
response = ISimuluationNodeFeignClient.getAllNodeByProjectIdAndType(chooseNodeId,nextNodeType);
response = ISimulationNodeFeignClient.getAllNodeByProjectIdAndType(uuid, nextNodeType);
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
return SdmResponse.failed("获取节点信息失败");
}
@@ -58,4 +60,13 @@ public class SimuluationNodeFeignClientImpl implements ISimuluationNodeFeignClie
}
@Override
public SdmResponse renameNode(RenameNodeReq req) {
return ISimulationNodeFeignClient.renameNode(req);
}
@Override
public SdmResponse delteNode(DelNodeReq req) {
return ISimulationNodeFeignClient.delteNode(req);
}
}

View File

@@ -1,15 +1,20 @@
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.RenameNodeReq;
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "project")
public interface ISimuluationNodeFeignClient {
public interface ISimulationNodeFeignClient {
/**
* 根据节点类型获取所有节点
* @param nodeType 节点类型
@@ -21,11 +26,16 @@ public interface ISimuluationNodeFeignClient {
/**
* 根据项目ID和节点类型获取所有节点信息
*
* @param chooseNodeId 项目ID
* @param uuid 项目ID
* @param nextNodeType 下一级节点类型
* @return SdmResponse<List<AllNodeByProjectIdAndTypeResp>> 节点信息
*/
@GetMapping("/node/getAllNodeByProjectIdAndType")
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeId") Long chooseNodeId, @RequestParam(value = "nextNodeType") String nextNodeType);
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeId") String uuid, @RequestParam(value = "nextNodeType") String nextNodeType);
@PostMapping("/node/renameNode")
SdmResponse renameNode(@RequestBody RenameNodeReq req);
@PostMapping("/node/delteNode")
public SdmResponse delteNode(@RequestBody DelNodeReq req);
}