知识库关联工况
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.sdm.data.model.req;
|
package com.sdm.common.entity.req.data;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -73,6 +73,24 @@ public class UploadFilesReq {
|
|||||||
@Schema(description = "关联项目id")
|
@Schema(description = "关联项目id")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工况库id
|
||||||
|
*/
|
||||||
|
@Schema(description = "所属工况库id")
|
||||||
|
private Integer simulationPoolId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工况库版本
|
||||||
|
*/
|
||||||
|
@Schema(description = "工况库版本")
|
||||||
|
private String simulationPoolVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工况
|
||||||
|
*/
|
||||||
|
@Schema(description = "关联工况")
|
||||||
|
private List<String> simulationPoolTaskIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联分析项目id
|
* 关联分析项目id
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -95,6 +95,19 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SdmResponse getFileBaseInfo(GetFileBaseInfoReq req) {
|
||||||
|
SdmResponse response;
|
||||||
|
try {
|
||||||
|
response = dataClient.getFileBaseInfo(req);
|
||||||
|
log.info("查询文件基本信息响应:"+ response);
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询文件基本信息失败", e);
|
||||||
|
return SdmResponse.failed("查询文件基本信息失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SdmResponse approveDataFile(LaunchApproveReq req) {
|
public SdmResponse approveDataFile(LaunchApproveReq req) {
|
||||||
SdmResponse response;
|
SdmResponse response;
|
||||||
|
|||||||
@@ -40,6 +40,15 @@ public interface IDataFeignClient {
|
|||||||
@PostMapping("/data/delFile")
|
@PostMapping("/data/delFile")
|
||||||
SdmResponse delFile(@RequestBody @Validated DelFileReq req);
|
SdmResponse delFile(@RequestBody @Validated DelFileReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件的基本信息
|
||||||
|
*
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("data/getFileBaseInfo")
|
||||||
|
SdmResponse getFileBaseInfo(@RequestBody @Validated GetFileBaseInfoReq req);
|
||||||
|
|
||||||
@PostMapping("/data/approveDataFile")
|
@PostMapping("/data/approveDataFile")
|
||||||
SdmResponse approveDataFile(@RequestBody LaunchApproveReq req);
|
SdmResponse approveDataFile(@RequestBody LaunchApproveReq req);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -125,6 +126,27 @@ public class FileMetadataInfo implements Serializable {
|
|||||||
@TableField("remarks")
|
@TableField("remarks")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工况库id
|
||||||
|
*/
|
||||||
|
@Schema(description = "所属工况库id")
|
||||||
|
@TableField("simulationPoolId")
|
||||||
|
private Integer simulationPoolId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工况库版本
|
||||||
|
*/
|
||||||
|
@Schema(description = "工况库版本")
|
||||||
|
@TableField("simulationPoolVersion")
|
||||||
|
private String simulationPoolVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工况
|
||||||
|
*/
|
||||||
|
@Schema(description = "关联工况")
|
||||||
|
@TableField("simulationPoolTaskIds")
|
||||||
|
private String simulationPoolTaskIds;
|
||||||
|
|
||||||
@Schema(description= "文件大小(单位:字节,仅文件有效,data_type=1时非空)")
|
@Schema(description= "文件大小(单位:字节,仅文件有效,data_type=1时非空)")
|
||||||
@TableField("fileSize")
|
@TableField("fileSize")
|
||||||
private Long fileSize;
|
private Long fileSize;
|
||||||
|
|||||||
@@ -44,6 +44,24 @@ public class UpdateFileReq {
|
|||||||
@Schema(description = "备注信息")
|
@Schema(description = "备注信息")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工况库id
|
||||||
|
*/
|
||||||
|
@Schema(description = "所属工况库id")
|
||||||
|
private Integer simulationPoolId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工况库版本
|
||||||
|
*/
|
||||||
|
@Schema(description = "工况库版本")
|
||||||
|
private String simulationPoolVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工况
|
||||||
|
*/
|
||||||
|
@Schema(description = "关联工况")
|
||||||
|
private List<String> simulationPoolTaskIds;
|
||||||
|
|
||||||
@Schema(description = "知识库文件审批模板id")
|
@Schema(description = "知识库文件审批模板id")
|
||||||
private String templateId;
|
private String templateId;
|
||||||
|
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
if (dirMetadataInfo == null) {
|
if (dirMetadataInfo == null) {
|
||||||
return SdmResponse.failed("目录不存在");
|
return SdmResponse.failed("目录不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(req.getSourceFiles())) {
|
if (CollectionUtils.isNotEmpty(req.getSourceFiles())) {
|
||||||
List<BatchAddFileInfoResp> addFileInfoRespList = new ArrayList<>();
|
List<BatchAddFileInfoResp> addFileInfoRespList = new ArrayList<>();
|
||||||
for (UploadFilesReq fileReq : req.getSourceFiles()) {
|
for (UploadFilesReq fileReq : req.getSourceFiles()) {
|
||||||
@@ -334,7 +334,8 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
try {
|
try {
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(fileMinioObjectKey, fileReq.getFileName(), fileReq.getFileType(),
|
FileMetadataInfo fileInfo = createFileMetadata(fileMinioObjectKey, fileReq.getFileName(), fileReq.getFileType(),
|
||||||
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), dirMetadataInfo.getId(), fileReq.getSize());
|
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), dirMetadataInfo.getId(), fileReq.getSize()
|
||||||
|
,req.getSimulationPoolId(),req.getSimulationPoolVersion(),req.getSimulationPoolTaskIds());
|
||||||
fileInfo.setUploadTaskId(req.getUploadTaskId());
|
fileInfo.setUploadTaskId(req.getUploadTaskId());
|
||||||
fileInfo.setTemplateId(req.getTemplateId());
|
fileInfo.setTemplateId(req.getTemplateId());
|
||||||
fileInfo.setTemplateName(req.getTemplateName());
|
fileInfo.setTemplateName(req.getTemplateName());
|
||||||
@@ -651,10 +652,16 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
* @param analysisDirectionId 分析方向ID
|
* @param analysisDirectionId 分析方向ID
|
||||||
* @param remarks 备注信息
|
* @param remarks 备注信息
|
||||||
* @param parentId 父目录ID
|
* @param parentId 父目录ID
|
||||||
* @param fileSize
|
* @param fileSize 文件大小
|
||||||
|
* @param simulationPoolId 所属工况库id
|
||||||
|
* @param simulationPoolVersion 工况库版本
|
||||||
|
* @param simulationPoolTaskIds 关联工况id
|
||||||
* @return 创建后的文件元数据信息
|
* @return 创建后的文件元数据信息
|
||||||
*/
|
*/
|
||||||
private FileMetadataInfo createFileMetadata(String filePath, String fileName, Integer fileType, String projectId, String analysisDirectionId, String remarks, Long parentId, Long fileSize) {
|
private FileMetadataInfo createFileMetadata(String filePath, String fileName, Integer fileType
|
||||||
|
, String projectId, String analysisDirectionId, String remarks, Long parentId, Long fileSize
|
||||||
|
, Integer simulationPoolId, String simulationPoolVersion,List<String> simulationPoolTaskIds
|
||||||
|
) {
|
||||||
FileMetadataInfo fileInfo = new FileMetadataInfo();
|
FileMetadataInfo fileInfo = new FileMetadataInfo();
|
||||||
fileInfo.setObjectKey(filePath);
|
fileInfo.setObjectKey(filePath);
|
||||||
fileInfo.setBucketName(minioService.getBucketName());
|
fileInfo.setBucketName(minioService.getBucketName());
|
||||||
@@ -662,6 +669,11 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
fileInfo.setProjectId(projectId);
|
fileInfo.setProjectId(projectId);
|
||||||
fileInfo.setAnalysisDirectionId(analysisDirectionId);
|
fileInfo.setAnalysisDirectionId(analysisDirectionId);
|
||||||
fileInfo.setRemarks(remarks);
|
fileInfo.setRemarks(remarks);
|
||||||
|
fileInfo.setSimulationPoolId(simulationPoolId);
|
||||||
|
fileInfo.setSimulationPoolVersion(simulationPoolVersion);
|
||||||
|
fileInfo.setSimulationPoolTaskIds(CollectionUtils.isEmpty(simulationPoolTaskIds) ? null :
|
||||||
|
String.join(";", simulationPoolTaskIds));
|
||||||
|
|
||||||
fileInfo.setDataType(DataTypeEnum.FILE.getValue());
|
fileInfo.setDataType(DataTypeEnum.FILE.getValue());
|
||||||
fileInfo.setFileType(fileType);
|
fileInfo.setFileType(fileType);
|
||||||
fileInfo.setParentId(parentId);
|
fileInfo.setParentId(parentId);
|
||||||
@@ -1260,7 +1272,8 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
|
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(fileMinioObjectKey, req.getFileName(), req.getFileType(),
|
FileMetadataInfo fileInfo = createFileMetadata(fileMinioObjectKey, req.getFileName(), req.getFileType(),
|
||||||
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), dirMetadataInfo.getId(), req.getFile().getSize());
|
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), dirMetadataInfo.getId(), req.getFile().getSize(),
|
||||||
|
req.getSimulationPoolId(),req.getSimulationPoolVersion(),req.getSimulationPoolTaskIds());
|
||||||
// 只有知识库的文件需要审核
|
// 只有知识库的文件需要审核
|
||||||
// 1 知识库文件夹
|
// 1 知识库文件夹
|
||||||
boolean isknowledge = Objects.equals(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue(), dirMetadataInfo.getDirType());
|
boolean isknowledge = Objects.equals(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||||
@@ -1437,6 +1450,10 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
tempFileMetadataInfo.setProjectId(req.getProjectId());
|
tempFileMetadataInfo.setProjectId(req.getProjectId());
|
||||||
tempFileMetadataInfo.setAnalysisDirectionId(req.getAnalysisDirectionId());
|
tempFileMetadataInfo.setAnalysisDirectionId(req.getAnalysisDirectionId());
|
||||||
tempFileMetadataInfo.setRemarks(req.getRemarks());
|
tempFileMetadataInfo.setRemarks(req.getRemarks());
|
||||||
|
tempFileMetadataInfo.setSimulationPoolId(req.getSimulationPoolId());
|
||||||
|
tempFileMetadataInfo.setSimulationPoolVersion(req.getSimulationPoolVersion());
|
||||||
|
tempFileMetadataInfo.setSimulationPoolTaskIds(CollectionUtils.isEmpty(req.getSimulationPoolTaskIds()) ? null :
|
||||||
|
String.join(";", req.getSimulationPoolTaskIds()));
|
||||||
|
|
||||||
fileMetadataInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getKey());
|
fileMetadataInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getKey());
|
||||||
fileMetadataInfo.setApproveType(ApproveFileDataTypeEnum.MODIFY_METADATA_REVIEWING.getCode());
|
fileMetadataInfo.setApproveType(ApproveFileDataTypeEnum.MODIFY_METADATA_REVIEWING.getCode());
|
||||||
@@ -1460,6 +1477,10 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
fileMetadataInfo.setProjectId(req.getProjectId());
|
fileMetadataInfo.setProjectId(req.getProjectId());
|
||||||
fileMetadataInfo.setAnalysisDirectionId(req.getAnalysisDirectionId());
|
fileMetadataInfo.setAnalysisDirectionId(req.getAnalysisDirectionId());
|
||||||
fileMetadataInfo.setRemarks(req.getRemarks());
|
fileMetadataInfo.setRemarks(req.getRemarks());
|
||||||
|
fileMetadataInfo.setSimulationPoolId(req.getSimulationPoolId());
|
||||||
|
fileMetadataInfo.setSimulationPoolVersion(req.getSimulationPoolVersion());
|
||||||
|
fileMetadataInfo.setSimulationPoolTaskIds(CollectionUtils.isEmpty(req.getSimulationPoolTaskIds()) ? null :
|
||||||
|
String.join(";", req.getSimulationPoolTaskIds()));
|
||||||
}
|
}
|
||||||
|
|
||||||
fileMetadataInfoService.updateById(fileMetadataInfo);
|
fileMetadataInfoService.updateById(fileMetadataInfo);
|
||||||
@@ -1494,7 +1515,8 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
minioService.uploadFile(req.getFile(), newFileMinioObjectKey, null);
|
minioService.uploadFile(req.getFile(), newFileMinioObjectKey, null);
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(newFileMinioObjectKey, req.getFileName(), req.getFileType(),
|
FileMetadataInfo fileInfo = createFileMetadata(newFileMinioObjectKey, req.getFileName(), req.getFileType(),
|
||||||
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), fileMetadataInfo.getParentId(), req.getFile().getSize());
|
req.getProjectId(), req.getAnalysisDirectionId(), req.getRemarks(), fileMetadataInfo.getParentId(), req.getFile().getSize(),
|
||||||
|
req.getSimulationPoolId(),req.getSimulationPoolVersion(),req.getSimulationPoolTaskIds());
|
||||||
fileInfo.setFileGroupId(fileGroupId);
|
fileInfo.setFileGroupId(fileGroupId);
|
||||||
fileInfo.setVersionNo(versionNo + 1);
|
fileInfo.setVersionNo(versionNo + 1);
|
||||||
// 知识库修改
|
// 知识库修改
|
||||||
@@ -1603,7 +1625,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
|
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(avatarMinioObjectKey, newFilename, null,
|
FileMetadataInfo fileInfo = createFileMetadata(avatarMinioObjectKey, newFilename, null,
|
||||||
null, null, null, parAvatarDirId, avatar.getSize());
|
null, null, null, parAvatarDirId, avatar.getSize(),null,null,null);
|
||||||
fileMetadataInfoService.save(fileInfo);
|
fileMetadataInfoService.save(fileInfo);
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("avatarId", fileInfo.getId());
|
jsonObject.put("avatarId", fileInfo.getId());
|
||||||
@@ -1664,7 +1686,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
|
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(simulationParamMinioObjectKey, newFilename, null,
|
FileMetadataInfo fileInfo = createFileMetadata(simulationParamMinioObjectKey, newFilename, null,
|
||||||
null, null, null, parSimulationParamDirId, paramFile.getSize());
|
null, null, null, parSimulationParamDirId, paramFile.getSize(),null,null,null);
|
||||||
// 设置文件状态为审批中 暂不可见
|
// 设置文件状态为审批中 暂不可见
|
||||||
fileInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getKey());
|
fileInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getKey());
|
||||||
fileInfo.setApproveType(ApproveFileDataTypeEnum.UPLOAD_REVIEWING.getCode());
|
fileInfo.setApproveType(ApproveFileDataTypeEnum.UPLOAD_REVIEWING.getCode());
|
||||||
@@ -1713,7 +1735,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
|
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(trainingMinioObjectKey, originalFilename, null,
|
FileMetadataInfo fileInfo = createFileMetadata(trainingMinioObjectKey, originalFilename, null,
|
||||||
null, null, null, parTrainModelDirId, trainModelFile.getSize());
|
null, null, null, parTrainModelDirId, trainModelFile.getSize(),null,null,null);
|
||||||
fileMetadataInfoService.save(fileInfo);
|
fileMetadataInfoService.save(fileInfo);
|
||||||
return SdmResponse.success(fileInfo.getId());
|
return SdmResponse.success(fileInfo.getId());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1758,7 +1780,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
|||||||
|
|
||||||
// 创建目录元数据并保存到数据库
|
// 创建目录元数据并保存到数据库
|
||||||
FileMetadataInfo fileInfo = createFileMetadata(scriptFileMinioObjectKey, originalFilename, null,
|
FileMetadataInfo fileInfo = createFileMetadata(scriptFileMinioObjectKey, originalFilename, null,
|
||||||
null, null, null, parScriptDirId, scriptFile.getSize());
|
null, null, null, parScriptDirId, scriptFile.getSize(),null,null,null);
|
||||||
fileMetadataInfoService.save(fileInfo);
|
fileMetadataInfoService.save(fileInfo);
|
||||||
return SdmResponse.success(fileInfo.getId());
|
return SdmResponse.success(fileInfo.getId());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -7,7 +7,13 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CompleteTaskReq {
|
public class CompleteTaskReq {
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
/**
|
||||||
|
* 流程节点id
|
||||||
|
*/
|
||||||
private String taskDefinitionKey;
|
private String taskDefinitionKey;
|
||||||
private Map<String, Object> variables = new HashMap<>();
|
private Map<String, Object> variables = new HashMap<>();
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user