feat:YIAN关键结果接口
This commit is contained in:
@@ -2,14 +2,18 @@ package com.sdm.project.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.enums.NodeTypeEnum;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.project.model.req.KeyResultReq;
|
||||
import com.sdm.project.model.req.YA.*;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveNodeInfoRsp;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveProjectTaskRsp;
|
||||
import com.sdm.project.service.INodeService;
|
||||
import com.sdm.project.service.ITaskService;
|
||||
import com.sdm.project.service.ISimulationRunService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -34,6 +38,8 @@ public class YAModelController {
|
||||
|
||||
@Resource
|
||||
ITaskService taskService;
|
||||
@Resource
|
||||
ISimulationRunService runService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,9 +144,41 @@ public class YAModelController {
|
||||
)
|
||||
public BosimSaveNodeInfoRsp saveKeyResultNodeInfo(SaveKeyResultNodeInfoReq req)
|
||||
{
|
||||
return null;
|
||||
KeyResultReq addTaskRunReq = new KeyResultReq();
|
||||
addTaskRunReq.setFile(req.getFile());
|
||||
SdmResponse<FileMetadataInfoResp> fileMetadataInfoResp = dataFeignClient.queryFileMetadataInfo(req.getScenario(), NodeTypeEnum.TASK.getValue(), 0);
|
||||
if (fileMetadataInfoResp.getData() != null) {
|
||||
addTaskRunReq.setDirId(fileMetadataInfoResp.getData().getId());
|
||||
}
|
||||
addTaskRunReq.setFileName(req.getFileName());
|
||||
addTaskRunReq.setFileType(req.getFileType());
|
||||
addTaskRunReq.setRunId(req.getScenario());
|
||||
addTaskRunReq.setKeyResultType(req.getCode());
|
||||
addTaskRunReq.setName(req.getName());
|
||||
addTaskRunReq.setQuantityType(req.getQuantityType());
|
||||
addTaskRunReq.setValue(req.getValue());
|
||||
addTaskRunReq.setUnits(req.getUnits());
|
||||
SdmResponse addTaskRunResp = runService.addSimulationKeyResult(addTaskRunReq);
|
||||
|
||||
BosimSaveNodeInfoRsp rsp = new BosimSaveNodeInfoRsp();
|
||||
if(addTaskRunResp.isSuccess())
|
||||
{
|
||||
rsp.setCode("200");
|
||||
rsp.setMessage("success");
|
||||
rsp.getWorkRequest().add(String.valueOf(addTaskRunResp.getData()));
|
||||
}
|
||||
return rsp;
|
||||
}
|
||||
|
||||
@PostMapping("")
|
||||
public BosimSaveNodeInfoRsp deleteModelNodeInfo(DeleteModelNodeInfoReq req)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ public class SaveKeyResultNodeInfoReq {
|
||||
@Schema(description = "数据名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据类型编号")
|
||||
private String code;
|
||||
@Schema(description = "数据类型编号,参考KeyResultTypeEnum")
|
||||
private Integer code;
|
||||
|
||||
@Schema(description = "仿真分析项")
|
||||
private String scenario;
|
||||
@@ -45,6 +45,9 @@ public class SaveKeyResultNodeInfoReq {
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "文件类型,参考FileBizTypeEnum")
|
||||
private Integer fileType;
|
||||
|
||||
@Schema(description = "数值")
|
||||
private String value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user