feat:YIAN关键结果查询接口
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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user