feat:Bosim标准接口适配V2
This commit is contained in:
@@ -9,12 +9,9 @@ import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.entity.enums.FileBizTypeEnum;
|
||||
import com.sdm.common.entity.enums.FileDictTagEnum;
|
||||
import com.sdm.common.entity.enums.NodeTypeEnum;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import com.sdm.common.entity.req.data.TagReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.constants.CommonConstants;
|
||||
import com.sdm.common.entity.enums.*;
|
||||
import com.sdm.common.entity.req.data.*;
|
||||
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
@@ -25,12 +22,15 @@ import com.sdm.common.feign.impl.data.DataAnalysisFeignClientImpl;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.utils.DateUtils;
|
||||
import com.sdm.common.utils.HttpUtil;
|
||||
import com.sdm.common.utils.RandomUtil;
|
||||
import com.sdm.common.utils.SystemOperate;
|
||||
import com.sdm.project.YA.Service.IBosimKeyResultService;
|
||||
import com.sdm.project.YA.Service.IBosimModelService;
|
||||
import com.sdm.project.YA.Service.IBosimReportService;
|
||||
import com.sdm.project.YA.Service.IBosimWorkTaskService;
|
||||
import com.sdm.project.YA.model.SimulationKeyResult;
|
||||
import com.sdm.project.YA.model.SimulationModel;
|
||||
import com.sdm.project.YA.model.SimulationReport;
|
||||
import com.sdm.project.YA.req.*;
|
||||
import com.sdm.project.YA.resp.*;
|
||||
import com.sdm.project.common.KeyResultTypeEnum;
|
||||
@@ -55,6 +55,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.security.PrivateKey;
|
||||
@@ -133,7 +134,7 @@ public class YAModelController {
|
||||
)
|
||||
)
|
||||
)
|
||||
public BosimSaveNodeInfoRsp SaveModelNodeInfo(@RequestHeader("Authorization") String authorization,SaveModelNodeInfoReq req)
|
||||
public BosimSaveNodeInfoRsp saveModelNodeInfoYA(@RequestHeader("Authorization") String authorization,SaveModelNodeInfoReq req)
|
||||
{
|
||||
if(!verifyBackEndJwt(authorization)) {
|
||||
BosimSaveNodeInfoRsp rsp = new BosimSaveNodeInfoRsp();
|
||||
@@ -193,7 +194,7 @@ public class YAModelController {
|
||||
)
|
||||
)
|
||||
)
|
||||
public BosimSaveNodeInfoRsp saveReportNodeInfo(@RequestHeader("Authorization") String authorization,SaveReportNodeInfoReq req)
|
||||
public BosimSaveNodeInfoRsp saveReportNodeInfoYA(@RequestHeader("Authorization") String authorization,SaveReportNodeInfoReq req)
|
||||
{
|
||||
if(!verifyBackEndJwt(authorization)) {
|
||||
BosimSaveNodeInfoRsp rsp = new BosimSaveNodeInfoRsp();
|
||||
@@ -278,7 +279,7 @@ public class YAModelController {
|
||||
addTaskRunReq.setFileName(req.getFileName());
|
||||
addTaskRunReq.setFileType(req.getFileType());
|
||||
addTaskRunReq.setRunId(req.getScenario());
|
||||
addTaskRunReq.setKeyResultType(req.getCode());
|
||||
addTaskRunReq.setKeyResultType(Integer.valueOf(req.getCode()));
|
||||
addTaskRunReq.setName(req.getName());
|
||||
addTaskRunReq.setQuantityType(req.getQuantityType());
|
||||
addTaskRunReq.setValue(req.getValue());
|
||||
@@ -311,7 +312,7 @@ public class YAModelController {
|
||||
adaptContext();
|
||||
KeyResultReq keyResultReq = new KeyResultReq();
|
||||
keyResultReq.setRunId(req.getScenario());
|
||||
keyResultReq.setKeyResultType(req.getCode());
|
||||
keyResultReq.setKeyResultType(Integer.valueOf(req.getCode()));
|
||||
keyResultReq.setCurrent(req.getCurrent());
|
||||
keyResultReq.setSize(req.getSize());
|
||||
PageDataResp<List<SimulationRunKeyResult>> response = runService.listSimulationKeyResult(keyResultReq).getData();
|
||||
@@ -346,49 +347,6 @@ public class YAModelController {
|
||||
return rsp;
|
||||
}
|
||||
|
||||
@PostMapping("")
|
||||
public BosimSaveNodeInfoRsp deleteModelNodeInfo(@RequestHeader("Authorization") String authorization, DeleteModelNodeInfoReq req)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("GetModelNodeInfoByIdAndType")
|
||||
public void getModelNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("DeleteModelNodeByObjectIds")
|
||||
public void DeleteModelNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("GetReportNodeInfoByIdAndType")
|
||||
public void getReportNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("DeleteReportNodeByObjectIds")
|
||||
public void DeleteReportNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("GetKeyResultNodeInfoByIdAndType")
|
||||
public void getKeyResultNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("DeleteKeyResultNodeByObjectIds")
|
||||
public void DeleteKeyResultNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody @Validated GetModelNodeInfoReq req)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取Task下模型文件信息
|
||||
@@ -462,11 +420,14 @@ public class YAModelController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存仿真活动任务
|
||||
*/
|
||||
@PostMapping("saveTaskNodeInfo")
|
||||
public BosimResponse saveTaskNodeInfo(@RequestHeader("Authorization") String authorization,@RequestBody SaveTaskNodeInfoReq req)
|
||||
{
|
||||
SimulationWorkTask simulationWorkTask = new SimulationWorkTask();
|
||||
simulationWorkTask.setID(generateUuid());
|
||||
simulationWorkTask.setID(RandomUtil.generateString(32));
|
||||
simulationWorkTask.setNumber(req.getScenario());
|
||||
simulationWorkTask.setName(req.getName());
|
||||
simulationWorkTask.setProject(req.getProject());
|
||||
@@ -495,6 +456,9 @@ public class YAModelController {
|
||||
return BosimResponse.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存仿真模型
|
||||
*/
|
||||
@PostMapping(value = "/saveModelNodeInfo", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@Operation(
|
||||
summary = "上传模型",
|
||||
@@ -511,39 +475,28 @@ public class YAModelController {
|
||||
public BosimResponse saveModelNodeInfo(@RequestHeader("Authorization") String authorization, SaveModelNodeInfoReq req)
|
||||
{
|
||||
adaptContext();
|
||||
UploadFilesReq fileReq = new UploadFilesReq();
|
||||
fileReq.setFileName(req.getFileName());
|
||||
fileReq.setProjectId(req.getProject());
|
||||
fileReq.setFile(req.getFile());
|
||||
fileReq.setUuid(req.getWorkTask());
|
||||
fileReq.setIsConverSameNameFile(true);
|
||||
|
||||
fileReq.setFileTypeDictValue(String.valueOf(FileBizTypeEnum.MODEL_FILE.getValue()));
|
||||
fileReq.setFileTypeDictClass(FileDictTagEnum.FILE_TYPE.getDictClass());
|
||||
fileReq.setDictTags(Arrays.asList(FileDictTagEnum.FILE_TYPE.getDictClassFieldName(), FileDictTagEnum.FILE_TYPE.getDictValueFieldName()));
|
||||
|
||||
TagReq tagReq = new TagReq();
|
||||
tagReq.setTag1(req.getProject());
|
||||
tagReq.setTaskId(req.getWorkTask());
|
||||
fileReq.setTagReq(tagReq);
|
||||
|
||||
if (fileReq.getTagReq() != null) {
|
||||
fileReq.setTagReqStr(JSON.toJSONString(fileReq.getTagReq()));
|
||||
}
|
||||
SdmResponse uploadRespond = dataFeignClient.uploadFiles(fileReq);
|
||||
// 建模型文件文件夹
|
||||
Long parentDirId = getParentDirId(req.getWorkTask(), "仿真模型", tagReq);
|
||||
|
||||
BosimResponse uploadRespond = uploadFile(req.getFileName(), req.getProject(), req.getFile(), parentDirId, tagReq, FileBizTypeEnum.MODEL_FILE.getValue());
|
||||
if (!uploadRespond.isSuccess()) {
|
||||
return BosimResponse.failed(uploadRespond.getMessage());
|
||||
}
|
||||
|
||||
SimulationModel simulationModel = new SimulationModel();
|
||||
simulationModel.setID(generateUuid());
|
||||
simulationModel.setID(RandomUtil.generateString(32));
|
||||
simulationModel.setNumber(generateSimpleUuid());
|
||||
simulationModel.setName(req.getName());
|
||||
simulationModel.setProject(req.getProject());
|
||||
simulationModel.setScenario(req.getWorkTask());
|
||||
simulationModel.setScenario(req.getScenario());
|
||||
simulationModel.setWorkTask(req.getWorkTask());
|
||||
simulationModel.setDescription(req.getDescription());
|
||||
simulationModel.setFormatType(req.getFormatType());
|
||||
simulationModel.setFormatType(req.getFormat());
|
||||
simulationModel.setFile(String.valueOf(uploadRespond.getData()));
|
||||
|
||||
simulationModel.setEdition(generateSimpleUuid());
|
||||
@@ -564,6 +517,249 @@ public class YAModelController {
|
||||
return BosimResponse.success(data);
|
||||
}
|
||||
|
||||
private BosimResponse uploadFile(String fileName, String projectId, MultipartFile file, Long parentDirId, TagReq tagReq, int fileType) {
|
||||
UploadFilesReq fileReq = new UploadFilesReq();
|
||||
fileReq.setFileName(fileName);
|
||||
fileReq.setProjectId(projectId);
|
||||
fileReq.setFile(file);
|
||||
fileReq.setDirId(parentDirId);
|
||||
fileReq.setIsConverSameNameFile(true);
|
||||
|
||||
fileReq.setFileTypeDictValue(String.valueOf(fileType));
|
||||
fileReq.setFileTypeDictClass(FileDictTagEnum.FILE_TYPE.getDictClass());
|
||||
fileReq.setDictTags(Arrays.asList(FileDictTagEnum.FILE_TYPE.getDictClassFieldName(), FileDictTagEnum.FILE_TYPE.getDictValueFieldName()));
|
||||
|
||||
fileReq.setTagReq(tagReq);
|
||||
|
||||
if (fileReq.getTagReq() != null) {
|
||||
fileReq.setTagReqStr(JSON.toJSONString(fileReq.getTagReq()));
|
||||
}
|
||||
SdmResponse uploadRespond = dataFeignClient.uploadFiles(fileReq);
|
||||
if (!uploadRespond.isSuccess()) {
|
||||
return BosimResponse.failed(uploadRespond.getMessage());
|
||||
}
|
||||
return BosimResponse.success(uploadRespond.getData());
|
||||
}
|
||||
|
||||
private Long getParentDirId(String taskId, String fileName, TagReq tagReq) {
|
||||
Long parentDirId = null;
|
||||
QueryDirReq queryDirReq = new QueryDirReq();
|
||||
queryDirReq.setUuid(taskId);
|
||||
queryDirReq.setQueryTarget(DataTypeEnum.DIRECTORY.getValue());
|
||||
queryDirReq.setFileName(fileName);
|
||||
queryDirReq.setCurrent(1);
|
||||
queryDirReq.setSize(10);
|
||||
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> response = dataFeignClient.queryDir(queryDirReq);
|
||||
// 建过交付物文件夹直接取id
|
||||
if (response.getData() != null && CollectionUtils.isNotEmpty(response.getData().getData())) {
|
||||
FileMetadataInfoResp dirFileMetadataInfo = response.getData().getData().get(0);
|
||||
parentDirId = dirFileMetadataInfo.getId();
|
||||
} else {
|
||||
CreateDirReq createDirReq = new CreateDirReq();
|
||||
createDirReq.setParentUuId(taskId);
|
||||
createDirReq.setDirName(fileName);
|
||||
createDirReq.setDirType(DirTypeEnum.PROJECT_NODE_DIR.getValue());
|
||||
createDirReq.setTagReq(tagReq);
|
||||
SdmResponse createResp = dataFeignClient.createDir(createDirReq);
|
||||
if (createResp.isSuccess()) {
|
||||
parentDirId = Long.parseLong(createResp.getData().toString());
|
||||
}
|
||||
}
|
||||
return parentDirId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仿真模型
|
||||
*/
|
||||
@GetMapping("/getModelNodeInfoByIdAndType")
|
||||
public BosimResponse getModelNodeInfoByIdAndType(@RequestHeader("Authorization") String authorization, @RequestParam String type, @RequestParam String objectId) {
|
||||
SimulationModel simulationModel = bosimModelService.lambdaQuery().eq(SimulationModel::getNumber, objectId).one();
|
||||
if (simulationModel == null) {
|
||||
return BosimResponse.failed("查询不到模型文件");
|
||||
} else {
|
||||
|
||||
return BosimResponse.success(simulationModel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仿真模型
|
||||
*/
|
||||
@PostMapping("/deleteModelNodeByObjectIds")
|
||||
public BosimResponse deleteModelNodeByObjectIds(@RequestHeader("Authorization") String authorization, @RequestBody @Validated List<GetModelNodeInfoReq> req)
|
||||
{
|
||||
bosimModelService.lambdaUpdate().in(SimulationModel::getNumber, req.stream().map(GetModelNodeInfoReq::getObjectId).toList()).remove();
|
||||
return BosimResponse.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存仿真关键结果
|
||||
*/
|
||||
@PostMapping(value = "/saveNodeInfo", 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 = SaveReportNodeInfoReq.class)
|
||||
)
|
||||
)
|
||||
)
|
||||
public BosimResponse saveNodeInfo(@RequestHeader("Authorization") String authorization, SaveKeyResultNodeInfoReq req)
|
||||
{
|
||||
adaptContext();
|
||||
|
||||
// 建关键结果文件夹
|
||||
TagReq tagReq = new TagReq();
|
||||
tagReq.setTag1(req.getProject());
|
||||
tagReq.setTaskId(req.getWorkRequest());
|
||||
|
||||
Long parentDirId = getParentDirId(req.getWorkRequest(), "关键结果", tagReq);
|
||||
|
||||
BosimResponse uploadRespond = uploadFile(req.getFileName(), req.getProject(), req.getFile(), parentDirId, tagReq, KeyResultTypeEnum.getFileTypeByKeyResultType(Integer.parseInt(req.getCode())));
|
||||
if (!uploadRespond.isSuccess()) {
|
||||
return BosimResponse.failed(uploadRespond.getMessage());
|
||||
}
|
||||
|
||||
SimulationKeyResult simulationKeyResult = new SimulationKeyResult();
|
||||
simulationKeyResult.setID(RandomUtil.generateString(32));
|
||||
simulationKeyResult.setNumber(generateSimpleUuid());
|
||||
simulationKeyResult.setName(req.getName());
|
||||
simulationKeyResult.setKeyResultType(req.getCode());
|
||||
simulationKeyResult.setProject(req.getProject());
|
||||
simulationKeyResult.setWorkTask(req.getWorkRequest());
|
||||
simulationKeyResult.setScenario(req.getScenario());
|
||||
simulationKeyResult.setQuantityType(req.getQuantityType());
|
||||
simulationKeyResult.setUnits(req.getUnits());
|
||||
simulationKeyResult.setKeyResultValue(req.getValue());
|
||||
simulationKeyResult.setFile(String.valueOf(uploadRespond.getData()));
|
||||
|
||||
simulationKeyResult.setEdition(generateSimpleUuid());
|
||||
simulationKeyResult.setResult(generateSimpleUuid());
|
||||
simulationKeyResult.setModel(generateSimpleUuid());
|
||||
simulationKeyResult.setFormatType(req.getFormat());
|
||||
simulationKeyResult.setLevelType("Edit");
|
||||
simulationKeyResult.setStatusType("Start");
|
||||
simulationKeyResult.setVersion(simulationKeyResult.getNumber());
|
||||
simulationKeyResult.setOwner(req.getFirstOwner());
|
||||
simulationKeyResult.setCreator(req.getFirstOwner());
|
||||
simulationKeyResult.setModifier(req.getFirstOwner());
|
||||
simulationKeyResult.setCreateTime(new Date());
|
||||
simulationKeyResult.setLastUpdateTime(new Date());
|
||||
bosimKeyResultService.save(simulationKeyResult);
|
||||
|
||||
KeyResultData data = new KeyResultData();
|
||||
data.setKeyResult(List.of(simulationKeyResult.getNumber()));
|
||||
return BosimResponse.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仿真关键结果
|
||||
*/
|
||||
@GetMapping(value = "/getKeyResultNodeInfoByIdAndType")
|
||||
public BosimResponse getKeyResultNodeInfoByIdAndType(@RequestHeader("Authorization") String authorization, @RequestParam String type, @RequestParam String objectId) {
|
||||
SimulationKeyResult simulationKeyResult = bosimKeyResultService.lambdaQuery().eq(SimulationKeyResult::getNumber, objectId).one();
|
||||
if (simulationKeyResult == null) {
|
||||
return BosimResponse.failed("查询不到关键结果");
|
||||
} else {
|
||||
|
||||
return BosimResponse.success(simulationKeyResult);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仿真关键结果
|
||||
*/
|
||||
@PostMapping("/deleteKeyResultNodeByObjectIds")
|
||||
public BosimResponse deleteKeyResultNodeByObjectIds(@RequestHeader("Authorization") String authorization, @RequestBody @Validated List<GetModelNodeInfoReq> req)
|
||||
{
|
||||
bosimKeyResultService.lambdaUpdate().in(SimulationKeyResult::getNumber, req.stream().map(GetModelNodeInfoReq::getObjectId).toList()).remove();
|
||||
return BosimResponse.success(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存仿真报告
|
||||
*/
|
||||
@PostMapping(value = "/saveReportNodeInfo", 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 BosimResponse saveReportNodeInfo(@RequestHeader("Authorization") String authorization, SaveReportNodeInfoReq req) {
|
||||
adaptContext();
|
||||
|
||||
TagReq tagReq = new TagReq();
|
||||
tagReq.setTag1(req.getProject());
|
||||
tagReq.setTaskId(req.getParent());
|
||||
|
||||
// 建模型文件文件夹
|
||||
Long parentDirId = getParentDirId(req.getParent(), "仿真报告", tagReq);
|
||||
|
||||
BosimResponse uploadRespond = uploadFile(req.getFileName(), req.getProject(), req.getFile(), parentDirId, tagReq, FileBizTypeEnum.REPORT_FILE.getValue());
|
||||
if (!uploadRespond.isSuccess()) {
|
||||
return BosimResponse.failed(uploadRespond.getMessage());
|
||||
}
|
||||
|
||||
SimulationReport simulationReport = new SimulationReport();
|
||||
simulationReport.setID(RandomUtil.generateString(32));
|
||||
simulationReport.setNumber(generateSimpleUuid());
|
||||
simulationReport.setName(req.getName());
|
||||
|
||||
simulationReport.setFile(String.valueOf(uploadRespond.getData()));
|
||||
|
||||
simulationReport.setDocTemplate(generateSimpleUuid());
|
||||
simulationReport.setDocument(generateSimpleUuid());
|
||||
simulationReport.setSimulationEdition(generateSimpleUuid());
|
||||
simulationReport.setSimulationResult(generateSimpleUuid());
|
||||
|
||||
simulationReport.setOwner(req.getFirstOwner());
|
||||
simulationReport.setCreator(req.getFirstOwner());
|
||||
simulationReport.setModifier(req.getFirstOwner());
|
||||
simulationReport.setCreateTime(new Date());
|
||||
simulationReport.setLastUpdateTime(new Date());
|
||||
bosimReportService.save(simulationReport);
|
||||
|
||||
ModelData data = new ModelData();
|
||||
data.setModel(List.of(simulationReport.getNumber()));
|
||||
return BosimResponse.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仿真报告
|
||||
*/
|
||||
@GetMapping("/getReportNodeInfoByIdAndType")
|
||||
public BosimResponse getReportNodeInfo(@RequestHeader("Authorization") String authorization, @RequestParam String type, @RequestParam String objectId)
|
||||
{
|
||||
SimulationReport simulationReport = bosimReportService.lambdaQuery().eq(SimulationReport::getNumber, objectId).one();
|
||||
if (simulationReport == null) {
|
||||
return BosimResponse.failed("查询不到仿真报告");
|
||||
} else {
|
||||
return BosimResponse.success(simulationReport);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仿真报告
|
||||
*/
|
||||
@PostMapping("/deleteReportNodeByObjectIds")
|
||||
public BosimResponse deleteReportNodeInfo(@RequestHeader("Authorization") String authorization, @RequestBody @Validated List<GetModelNodeInfoReq> req)
|
||||
{
|
||||
bosimReportService.lambdaUpdate().in(SimulationReport::getNumber, req.stream().map(GetModelNodeInfoReq::getObjectId).toList()).remove();
|
||||
return BosimResponse.success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.project.YA.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -50,10 +51,16 @@ public class SimulationKeyResult implements Serializable {
|
||||
private String Edition;
|
||||
|
||||
/**
|
||||
* 父节点编码
|
||||
* 关联仿真模型ID
|
||||
*/
|
||||
@TableField("Parent")
|
||||
private String Parent;
|
||||
@TableField("Model")
|
||||
private String Model;
|
||||
|
||||
/**
|
||||
* 关联仿真结果ID
|
||||
*/
|
||||
@TableField("Result")
|
||||
private String Result;
|
||||
|
||||
/**
|
||||
* 关联仿真分析项编码
|
||||
@@ -67,6 +74,12 @@ public class SimulationKeyResult implements Serializable {
|
||||
@TableField("WorkTask")
|
||||
private String WorkTask;
|
||||
|
||||
/**
|
||||
* 关键结果类型
|
||||
*/
|
||||
@TableField("KeyResultType")
|
||||
private String KeyResultType;
|
||||
|
||||
/**
|
||||
* 主文件ID
|
||||
*/
|
||||
@@ -80,34 +93,52 @@ public class SimulationKeyResult implements Serializable {
|
||||
private String Folder;
|
||||
|
||||
/**
|
||||
* 关联仿真模型定义ID
|
||||
* 关键结果值
|
||||
*/
|
||||
@TableField("ModelDefinition")
|
||||
private String ModelDefinition;
|
||||
@TableField("KeyResultValue")
|
||||
private String KeyResultValue;
|
||||
|
||||
/**
|
||||
* 分析类型
|
||||
* 结果单位
|
||||
*/
|
||||
@TableField("AnalysisType")
|
||||
private Byte AnalysisType;
|
||||
@TableField("Units")
|
||||
private String Units;
|
||||
|
||||
/**
|
||||
* 物理量类型
|
||||
*/
|
||||
@TableField("QuantityType")
|
||||
private String QuantityType;
|
||||
|
||||
/**
|
||||
* 关联仿真目标
|
||||
*/
|
||||
@TableField("Target")
|
||||
private String Target;
|
||||
|
||||
/**
|
||||
* 对比结果
|
||||
*/
|
||||
@TableField("CompareType")
|
||||
private String CompareType;
|
||||
|
||||
/**
|
||||
* 格式类型
|
||||
*/
|
||||
@TableField("FormatType")
|
||||
private Byte FormatType;
|
||||
private String FormatType;
|
||||
|
||||
/**
|
||||
* 安全等级
|
||||
*/
|
||||
@TableField("LevelType")
|
||||
private Byte LevelType;
|
||||
private String LevelType;
|
||||
|
||||
/**
|
||||
* 可用状态
|
||||
*/
|
||||
@TableField("StatusType")
|
||||
private Byte StatusType;
|
||||
private String StatusType;
|
||||
|
||||
/**
|
||||
* 修订版本
|
||||
@@ -136,12 +167,14 @@ public class SimulationKeyResult implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.sdm.project.YA.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -137,11 +138,13 @@ public class SimulationModel implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CreateTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@TableField("LastUpdateTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.project.YA.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -25,6 +26,12 @@ public class SimulationReport implements Serializable {
|
||||
@TableField("Number")
|
||||
private String Number;
|
||||
|
||||
/**
|
||||
* 仿真报告名称
|
||||
*/
|
||||
@TableField("Name")
|
||||
private String Name;
|
||||
|
||||
/**
|
||||
* 关联文档对象编码
|
||||
*/
|
||||
@@ -37,12 +44,6 @@ public class SimulationReport implements Serializable {
|
||||
@TableField("DocTemplate")
|
||||
private String DocTemplate;
|
||||
|
||||
/**
|
||||
* 作业任务
|
||||
*/
|
||||
@TableField("SimulationJob")
|
||||
private String SimulationJob;
|
||||
|
||||
/**
|
||||
* 仿真报告文件
|
||||
*/
|
||||
@@ -82,12 +83,14 @@ public class SimulationReport implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.sdm.project.YA.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -130,12 +131,14 @@ public class SimulationWorkTask implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import lombok.Data;
|
||||
@Data
|
||||
@Schema(description = "获取仿真模型参数")
|
||||
public class GetModelNodeInfoReq {
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "数据类型名称")
|
||||
private String type;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class SaveKeyResultNodeInfoReq {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据类型编号,参考KeyResultTypeEnum")
|
||||
private Integer code;
|
||||
private String code;
|
||||
|
||||
@Schema(description = "仿真分析项")
|
||||
private String scenario;
|
||||
@@ -64,6 +64,12 @@ public class SaveKeyResultNodeInfoReq {
|
||||
@JSONField(serialize = false)
|
||||
private MultipartFile file;
|
||||
|
||||
@Schema(description = "主负责人")
|
||||
private String firstOwner;
|
||||
|
||||
@Schema(description = "格式")
|
||||
private String format;
|
||||
|
||||
@Schema(description = "分页参数,当前第几页")
|
||||
private int current;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SaveModelNodeInfoReq {
|
||||
private String disciplineClassification;
|
||||
|
||||
@Schema(description = "格式")
|
||||
private String formatType;
|
||||
private String format;
|
||||
|
||||
@Schema(description = "分析对象")
|
||||
private String item;
|
||||
|
||||
@@ -34,5 +34,11 @@ public class SaveReportNodeInfoReq {
|
||||
@JSONField(serialize = false)
|
||||
private MultipartFile file;
|
||||
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "主负责人")
|
||||
private String firstOwner;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.sdm.project.YA.req;
|
||||
|
||||
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;
|
||||
|
||||
@@ -47,5 +49,9 @@ public class SaveTaskNodeInfoReq {
|
||||
@Schema(description = "上游任务")
|
||||
public List<String> sourceWorkRequest;
|
||||
|
||||
@Schema(description = "文件传输对象")
|
||||
@JSONField(serialize = false)
|
||||
private MultipartFile file;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,19 +7,21 @@ import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
public enum KeyResultTypeEnum {
|
||||
IMAGE("图片/动画", 1, "图片结果"),
|
||||
CURVE("曲线", 2, "曲线结果"),
|
||||
DOCUMENT("报告", 3, "仿真报告"),
|
||||
VALUE("数值", 4, "数值结果");
|
||||
IMAGE("图片/动画", 1, "图片结果", 5),
|
||||
CURVE("曲线", 2, "曲线结果", 4),
|
||||
DOCUMENT("报告", 3, "仿真报告", 2),
|
||||
VALUE("数值", 4, "数值结果", 0);
|
||||
|
||||
private final String name;
|
||||
private final Integer keyResultType;
|
||||
private final String dirName;
|
||||
private final Integer fileType;
|
||||
|
||||
KeyResultTypeEnum(String name, Integer keyResultType, String dirName) {
|
||||
KeyResultTypeEnum(String name, Integer keyResultType, String dirName, Integer fileType) {
|
||||
this.name = name;
|
||||
this.keyResultType = keyResultType;
|
||||
this.dirName = dirName;
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public static String getDirNameByType(Integer keyResultType) {
|
||||
@@ -30,4 +32,13 @@ public enum KeyResultTypeEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer getFileTypeByKeyResultType(Integer keyResultType) {
|
||||
for (KeyResultTypeEnum status : values()) {
|
||||
if (Objects.equals(status.getKeyResultType(), keyResultType)) {
|
||||
return status.getFileType();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -971,7 +971,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
return response;
|
||||
}
|
||||
|
||||
private SdmResponse createDir(String uuid, Long parentDirId, String dirName, Integer dirType, String uuidOwnType) {
|
||||
private SdmResponse createExpDir(String uuid, Long parentDirId, String dirName, Integer dirType, String uuidOwnType) {
|
||||
CreateDirReq createDirReq = new CreateDirReq();
|
||||
createDirReq.setUuId(uuid);
|
||||
createDirReq.setParDirId(parentDirId);
|
||||
@@ -2719,7 +2719,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
parentId = expFileMetadataInfo.getId();
|
||||
} else {
|
||||
// 再建试验结果文件夹
|
||||
SdmResponse expResultResponse = createDir(null, parentDirId, dirName, DirTypeEnum.PROJECT_NODE_DIR.getValue(), null);
|
||||
SdmResponse expResultResponse = createExpDir(null, parentDirId, dirName, DirTypeEnum.PROJECT_NODE_DIR.getValue(), null);
|
||||
if (!expResultResponse.isSuccess()) {
|
||||
throw new RuntimeException(expResultResponse.getMessage());
|
||||
}
|
||||
@@ -2733,7 +2733,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
}
|
||||
Long parentDirId = Long.parseLong(deliverableDirResponse.getData().toString());
|
||||
// 再建试验结果文件夹
|
||||
SdmResponse expResultResponse = createDir(null, parentDirId, dirName, DirTypeEnum.PROJECT_NODE_DIR.getValue(), null);
|
||||
SdmResponse expResultResponse = createExpDir(null, parentDirId, dirName, DirTypeEnum.PROJECT_NODE_DIR.getValue(), null);
|
||||
if (!expResultResponse.isSuccess()) {
|
||||
throw new RuntimeException(expResultResponse.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user