YA项目接口实现,故障修复

This commit is contained in:
daiqy88
2025-11-28 10:06:23 +08:00
parent 56aa5b14e5
commit 60c287e803
17 changed files with 385 additions and 17 deletions

View File

@@ -0,0 +1,85 @@
package com.sdm.project.controller;
import com.sdm.common.common.SdmResponse;
import com.sdm.common.entity.req.data.UploadFilesReq;
import com.sdm.project.model.req.YA.GetModelNodeInfoReq;
import com.sdm.project.model.req.YA.SaveModelNodeInfoReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/dataManager/tree/node")
@Tag(name = "宜安项目数据归档", description = "宜安项目模型数据关了")
public class YAModelController {
/**
* 创建文件夹
*
* @param req
* @return
*/
@PostMapping(value = "/SaveModelNodeInfo", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@Operation(
summary = "上传模型",
description = "仿真模型归档,支持同时上传文件和附加参数",
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "模型文件上传请求",
required = true,
content = @Content(
mediaType = MediaType.MULTIPART_FORM_DATA_VALUE,
schema = @Schema(implementation = SaveModelNodeInfoReq.class)
)
)
)
public SdmResponse saveModelNodeInfo(@RequestBody @Validated SaveModelNodeInfoReq req)
{
UploadFilesReq fileReq = new UploadFilesReq();
fileReq.setFileName(req.getName());
fileReq.setProjectId(req.getProject());
fileReq.setFileType(1);
fileReq.setFile(req.getFile());
fileReq.setUuid(req.getScenario());
fileReq.setAnalysisDirectionId(req.getScenario());
return null;
}
@PostMapping("GetModelNodeInfoByIdAndType")
public void getModelNodeInfo(@RequestBody @Validated GetModelNodeInfoReq req)
{
}
@PostMapping("DeleteModelNodeByObjectIds")
public void DeleteModelNodeInfo(@RequestBody @Validated GetModelNodeInfoReq req)
{
}
@PostMapping("SyncProject")
public void syncCidProject()
{
}
@PostMapping("SyncCidTask")
public void syncCidTask()
{
}
}

View File

@@ -0,0 +1,20 @@
package com.sdm.project.model.req.YA;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "仿真模型删除参数")
public class DeleteModelNodeInfoReq {
@Schema(description = "数据类型名称")
private String type;
@Schema(description = "需要删除数据ObjectId")
private String objectId;
@Schema(description = "需要删除数据id")
private String id;
}

View File

@@ -0,0 +1,16 @@
package com.sdm.project.model.req.YA;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "获取仿真模型参数")
public class GetModelNodeInfoReq {
@Schema(description = "数据类型名称")
private String type;
@Schema(description = "需要删除数据ObjectId")
private String objectId;
}

View File

@@ -0,0 +1,12 @@
package com.sdm.project.model.req.YA;
import io.swagger.v3.oas.annotations.media.Schema;
public class ProjectTaskInfo {
@Schema(description = "任务名称")
private String taskName;
@Schema(description = "taskId")
private String taskId;
}

View File

@@ -0,0 +1,65 @@
package com.sdm.project.model.req.YA;
import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
@Data
@Schema(description = "仿真关键结果上传参数")
public class SaveKeyResultNodeInfoReq {
@Schema(description = "数据类型名称")
private String type;
@Schema(description = "数据名称")
private String name;
@Schema(description = "数据类型编号")
private String code;
@Schema(description = "仿真分析项")
private String scenario;
@Schema(description = "数据访问控制级别")
private String dataLevel;
@Schema(description = "所属项目ID")
private String project;
@Schema(description = "父级节点ID")
private String parent;
@Schema(description = "任务ID")
private String workRequest;
@Schema(description = "分析对象")
private String item;
@Schema(description = "轮次")
private String round;
@Schema(description = "方案Id")
private String version;
@Schema(description = "文件名称")
private String fileName;
@Schema(description = "数值")
private String value;
@Schema(description = "单位")
private String units;
@Schema(description = "状态")
private String status;
@Schema(description = "物理量")
private String quantityType;
@Schema(description = "文件传输对象")
@JSONField(serialize = false)
private MultipartFile file;
}

View File

@@ -0,0 +1,55 @@
package com.sdm.project.model.req.YA;
import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Data
@Schema(description = "仿真模型上传参数")
public class SaveModelNodeInfoReq {
@Schema(description = "数据类型名称")
private String type;
@Schema(description = "数据名称")
private String name;
@Schema(description = "数据类型编号")
private String code;
@Schema(description = "所属项目ID")
private String project;
@Schema(description = "父级节点ID")
private String parent;
@Schema(description = "仿真分析项")
private String scenario;
@Schema(description = "主负责人")
private String firstOwner;
@Schema(description = "从负责人")
private List<String> secondOwner;
@Schema(description = "起止日期")
private String startEndData;
@Schema(description = "学科")
private String disciplineClassification;
@Schema(description = "格式")
private String format;
@Schema(description = "分析对象")
private String item;
@Schema(description = "文件传输对象")
@JSONField(serialize = false)
private MultipartFile file;
}

View File

@@ -0,0 +1,38 @@
package com.sdm.project.model.req.YA;
import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
@Data
@Schema(description = "仿真报告上传参数")
public class SaveReportNodeInfoReq {
@Schema(description = "数据类型名称")
private String type;
@Schema(description = "数据名称")
private String name;
@Schema(description = "描述")
private String discription;
@Schema(description = "数据类型编号")
private String code;
@Schema(description = "所属项目ID")
private String project;
@Schema(description = "父级节点ID")
private String parent;
@Schema(description = "仿真分析项")
private String scenario;
@Schema(description = "文件传输对象")
@JSONField(serialize = false)
private MultipartFile file;
}

View File

@@ -0,0 +1,14 @@
package com.sdm.project.model.req.YA;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class SyncCidProjectReq {
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "项目Id")
private String projectId;
}

View File

@@ -0,0 +1,20 @@
package com.sdm.project.model.req.YA;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class SyncCidTaskReq {
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "项目Id")
private String projectId;
@Schema(description = "")
private List<ProjectTaskInfo> taskInfoList = new ArrayList<>();
}

View File

@@ -0,0 +1,13 @@
package com.sdm.project.model.resp.YA;
import io.swagger.v3.oas.annotations.media.Schema;
public class BosimErrorRespond {
@Schema(description = "错误码")
private int errorCode;
@Schema(description = "错误信息")
private String errorMsg;
}

View File

@@ -0,0 +1,17 @@
package com.sdm.project.model.resp.YA;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;
public class BosimSaveModelNodeRsp {
@Schema(description = "返回码")
private String code;
@Schema(description = "返回信息")
private String message;
private List<String> workRequest = new ArrayList<>();
}