Merge branch 'main' of http://192.168.65.198:3000/toolchaintechnologycenter/spdm-backend
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
package com.sdm.project.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.utils.PageUtils;
|
||||
import com.sdm.project.common.KeyResultTypeEnum;
|
||||
import com.sdm.project.model.entity.SimulationRunKeyResult;
|
||||
import com.sdm.project.model.req.KeyResultReq;
|
||||
import com.sdm.project.model.req.YA.*;
|
||||
import com.sdm.project.model.resp.YA.BosimKeyResultInfoRsp;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveNodeInfoRsp;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveProjectTaskRsp;
|
||||
import com.sdm.project.model.resp.YA.KeyResultNodeInfo;
|
||||
import com.sdm.project.service.INodeService;
|
||||
import com.sdm.project.service.ITaskService;
|
||||
import com.sdm.project.service.ISimulationRunService;
|
||||
@@ -18,12 +25,15 @@ 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.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dataManager/tree/node")
|
||||
@@ -170,6 +180,45 @@ public class YAModelController {
|
||||
return rsp;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/listKeyResultNodeInfo")
|
||||
public BosimKeyResultInfoRsp listKeyResultNodeInfo(@RequestBody SaveKeyResultNodeInfoReq req) {
|
||||
KeyResultReq keyResultReq = new KeyResultReq();
|
||||
keyResultReq.setRunId(req.getScenario());
|
||||
keyResultReq.setKeyResultType(req.getCode());
|
||||
keyResultReq.setCurrent(req.getCurrent());
|
||||
keyResultReq.setSize(req.getSize());
|
||||
PageDataResp<List<SimulationRunKeyResult>> response = runService.listSimulationKeyResult(keyResultReq).getData();
|
||||
List<KeyResultNodeInfo> resultNodeInfoList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(response.getData())) {
|
||||
List<SimulationRunKeyResult> runKeyResults = response.getData();
|
||||
for (SimulationRunKeyResult runKeyResult : runKeyResults) {
|
||||
KeyResultNodeInfo keyResultNodeInfo = new KeyResultNodeInfo();
|
||||
keyResultNodeInfo.setScenario(runKeyResult.getRunId());
|
||||
keyResultNodeInfo.setUuid(runKeyResult.getUuid());
|
||||
keyResultNodeInfo.setCode(runKeyResult.getKeyResultType());
|
||||
keyResultNodeInfo.setType(KeyResultTypeEnum.getDirNameByType(runKeyResult.getKeyResultType()));
|
||||
keyResultNodeInfo.setName(runKeyResult.getName());
|
||||
keyResultNodeInfo.setFileId(runKeyResult.getFileId());
|
||||
keyResultNodeInfo.setQuantityType(runKeyResult.getQuantityType());
|
||||
keyResultNodeInfo.setUnits(runKeyResult.getUnits());
|
||||
keyResultNodeInfo.setValue(runKeyResult.getValue());
|
||||
resultNodeInfoList.add(keyResultNodeInfo);
|
||||
}
|
||||
}
|
||||
PageInfo<KeyResultNodeInfo> page = new PageInfo<>(resultNodeInfoList);
|
||||
PageDataResp<List<KeyResultNodeInfo>> pageDataResp = new PageDataResp<>();
|
||||
pageDataResp.setData(resultNodeInfoList);
|
||||
pageDataResp.setTotal( page.getTotal());
|
||||
pageDataResp.setCurrentPage(page.getPageNum());
|
||||
pageDataResp.setPageSize(page.getPageSize());
|
||||
|
||||
BosimKeyResultInfoRsp rsp = new BosimKeyResultInfoRsp();
|
||||
rsp.setCode("200");
|
||||
rsp.setMessage("success");
|
||||
rsp.setData(pageDataResp);
|
||||
return rsp;
|
||||
}
|
||||
|
||||
@PostMapping("")
|
||||
public BosimSaveNodeInfoRsp deleteModelNodeInfo(DeleteModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
@@ -64,5 +64,11 @@ public class SaveKeyResultNodeInfoReq {
|
||||
@JSONField(serialize = false)
|
||||
private MultipartFile file;
|
||||
|
||||
@Schema(description = "分页参数,当前第几页")
|
||||
private int current;
|
||||
|
||||
@Schema(description = "分页参数,一页几条")
|
||||
private int size;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.project.model.resp.YA;
|
||||
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BosimKeyResultInfoRsp {
|
||||
|
||||
@Schema(description = "返回码")
|
||||
private String code ;
|
||||
|
||||
@Schema(description = "返回信息")
|
||||
private String message = "";
|
||||
|
||||
PageDataResp<List<KeyResultNodeInfo>> data;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.sdm.project.model.resp.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 KeyResultNodeInfo {
|
||||
|
||||
@Schema(description = "唯一uuid")
|
||||
private String uuid;
|
||||
|
||||
@Schema(description = "数据类型名称")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "数据名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据类型编号,参考KeyResultTypeEnum")
|
||||
private Integer 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 = "文件类型,参考FileBizTypeEnum")
|
||||
private Integer fileType;
|
||||
|
||||
@Schema(description = "数值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String units;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "物理量")
|
||||
private String quantityType;
|
||||
|
||||
@Schema(description = "文件id")
|
||||
private Long fileId;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user