优化创建节点同时创建文件夹,记录节点的ownRootNodeUuid
This commit is contained in:
@@ -4,6 +4,7 @@ import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.DelDirReq;
|
||||
import com.sdm.common.entity.req.data.RenameDirReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.data.model.req.RenameFileReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
@@ -122,7 +123,7 @@ public class DataFileController implements IDataFeignClient {
|
||||
*/
|
||||
@PostMapping("/queryDir")
|
||||
@Operation(summary = "获取文件夹下子文件夹和文件内容信息", description = "查询指定文件夹的内容信息")
|
||||
public SdmResponse queryDir(@RequestBody @Validated QueryDirReq req) {
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfo>>> queryDir(@RequestBody @Validated QueryDirReq req) {
|
||||
return IDataFileService.queryDir(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -23,159 +24,159 @@ import java.time.LocalDateTime;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("file_metadata_info")
|
||||
@ApiModel(value="FileMetadataInfo对象", description="文件元数据信息表(存储MinIO文件的元数据及层级关系)")
|
||||
@Schema(description="文件元数据信息表(存储MinIO文件的元数据及层级关系)")
|
||||
public class FileMetadataInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID,自增")
|
||||
@Schema(description = "主键ID,自增")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "simulation_node关联的节点id")
|
||||
@Schema(description= "simulation_node关联的节点id")
|
||||
@TableField("relatedResourceUuid")
|
||||
private String relatedResourceUuid;
|
||||
|
||||
@ApiModelProperty(value = "关联对象类型(node,task,run,performance)")
|
||||
@Schema(description= "关联对象类型(node,task,run,performance)")
|
||||
@TableField("relatedResourceUuidOwnType")
|
||||
private String relatedResourceUuidOwnType;
|
||||
|
||||
@ApiModelProperty(value = "逻辑文件组ID(同一文件的所有版本共享一个ID)")
|
||||
@Schema(description= "逻辑文件组ID(同一文件的所有版本共享一个ID)")
|
||||
@TableField("fileGroupId")
|
||||
private Long fileGroupId;
|
||||
|
||||
@ApiModelProperty(value = "版本号(从1开始递增)")
|
||||
@Schema(description= "版本号(从1开始递增)")
|
||||
@TableField("versionNo")
|
||||
private Long versionNo;
|
||||
|
||||
@ApiModelProperty(value = "是否最新版本:1-是,0-否")
|
||||
@Schema(description= "是否最新版本:1-是,0-否")
|
||||
@TableField("isLatest")
|
||||
private Boolean isLatest;
|
||||
|
||||
@ApiModelProperty(value = "MinIO的存储桶名称")
|
||||
@Schema(description= "MinIO的存储桶名称")
|
||||
@TableField("bucketName")
|
||||
private String bucketName;
|
||||
|
||||
@ApiModelProperty(value = "MinIO的文件object_key(与业务层绝对路径abs_path一致)")
|
||||
@Schema(description= "MinIO的文件object_key(与业务层绝对路径abs_path一致)")
|
||||
@TableField("objectKey")
|
||||
private String objectKey;
|
||||
|
||||
@ApiModelProperty(value = "文件原始名称")
|
||||
@Schema(description= "文件原始名称")
|
||||
@TableField("originalName")
|
||||
private String originalName;
|
||||
|
||||
@ApiModelProperty(value = "文件夹数据类型(仅文件夹有效,data_type=2时非空) 1 知识库文件夹,2 项目节点文件夹,3 头像库文件夹,4 仿真参数库文件夹,5 训练模型文件夹")
|
||||
@Schema(description= "文件夹数据类型(仅文件夹有效,data_type=2时非空) 1 知识库文件夹,2 项目节点文件夹,3 头像库文件夹,4 仿真参数库文件夹,5 训练模型文件夹")
|
||||
@TableField("dirType")
|
||||
private Integer dirType;
|
||||
|
||||
@ApiModelProperty(value = "文件夹数据状态(仅文件夹有效,data_type=2时非空)")
|
||||
@Schema(description= "文件夹数据状态(仅文件夹有效,data_type=2时非空)")
|
||||
@TableField("dirStatus")
|
||||
private Integer dirStatus;
|
||||
|
||||
@ApiModelProperty(value = "文件数据状态(仅文件有效,data_type=1时非空)")
|
||||
@Schema(description= "文件数据状态(仅文件有效,data_type=1时非空)")
|
||||
@TableField("fileStatus")
|
||||
private Integer fileStatus;
|
||||
|
||||
@ApiModelProperty(value = "文件数据类型(仅文件有效,data_type=1时非空,标识模型文件/仿真报告/计算文件/结果曲线/结果云图)")
|
||||
@Schema(description= "文件数据类型(仅文件有效,data_type=1时非空,标识模型文件/仿真报告/计算文件/结果曲线/结果云图)")
|
||||
@TableField("fileType")
|
||||
private Integer fileType;
|
||||
|
||||
@ApiModelProperty(value = "数据类型:1-文件夹,2-文件")
|
||||
@Schema(description= "数据类型:1-文件夹,2-文件")
|
||||
@TableField("dataType")
|
||||
private Integer dataType;
|
||||
|
||||
@ApiModelProperty(value = "是否根目录:1-是,0-不是")
|
||||
@Schema(description= "是否根目录:1-是,0-不是")
|
||||
@TableField("isRoot")
|
||||
private Boolean isRoot;
|
||||
|
||||
@ApiModelProperty(value = "父文件ID(根目录时为NULL,非根目录时非空)")
|
||||
@Schema(description= "父文件ID(根目录时为NULL,非根目录时非空)")
|
||||
@TableField("parentId")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "创建者ID")
|
||||
@Schema(description= "创建者ID")
|
||||
@TableField("creatorId")
|
||||
private Long creatorId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description= "创建时间")
|
||||
@TableField("createTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新者ID")
|
||||
@Schema(description= "更新者ID")
|
||||
@TableField("updaterId")
|
||||
private Long updaterId;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description= "修改时间")
|
||||
@TableField("updateTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "所属项目ID(关联的项目uuid)")
|
||||
@Schema(description= "所属项目ID(关联的项目uuid)")
|
||||
@TableField("projectId")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value = "分析方向ID(关联的分析项目id)")
|
||||
@Schema(description= "分析方向ID(关联的分析项目id)")
|
||||
@TableField("analysisDirectionId")
|
||||
private String analysisDirectionId;
|
||||
|
||||
@ApiModelProperty(value = "备注信息")
|
||||
@Schema(description= "备注信息")
|
||||
@TableField("remarks")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "文件大小(单位:字节,仅文件有效,data_type=1时非空)")
|
||||
@Schema(description= "文件大小(单位:字节,仅文件有效,data_type=1时非空)")
|
||||
@TableField("fileSize")
|
||||
private Long fileSize;
|
||||
|
||||
@ApiModelProperty(value = "tag1")
|
||||
@Schema(description= "tag1")
|
||||
@TableField("tag1")
|
||||
private String tag1;
|
||||
|
||||
@ApiModelProperty(value = "tag2")
|
||||
@Schema(description= "tag2")
|
||||
@TableField("tag2")
|
||||
private String tag2;
|
||||
|
||||
@ApiModelProperty(value = "tag3")
|
||||
@Schema(description= "tag3")
|
||||
@TableField("tag3")
|
||||
private String tag3;
|
||||
|
||||
@ApiModelProperty(value = "tag4")
|
||||
@Schema(description= "tag4")
|
||||
@TableField("tag4")
|
||||
private String tag4;
|
||||
|
||||
@ApiModelProperty(value = "tag5")
|
||||
@Schema(description= "tag5")
|
||||
@TableField("tag5")
|
||||
private String tag5;
|
||||
|
||||
@ApiModelProperty(value = "tag6")
|
||||
@Schema(description= "tag6")
|
||||
@TableField("tag6")
|
||||
private String tag6;
|
||||
|
||||
@ApiModelProperty(value = "tag7")
|
||||
@Schema(description= "tag7")
|
||||
@TableField("tag7")
|
||||
private String tag7;
|
||||
|
||||
@ApiModelProperty(value = "tag8")
|
||||
@Schema(description= "tag8")
|
||||
@TableField("tag8")
|
||||
private String tag8;
|
||||
|
||||
@ApiModelProperty(value = "tag9")
|
||||
@Schema(description= "tag9")
|
||||
@TableField("tag9")
|
||||
private String tag9;
|
||||
|
||||
@ApiModelProperty(value = "tag10")
|
||||
@Schema(description= "tag10")
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
@ApiModelProperty(value = "approvalStatus")
|
||||
@Schema(description= "approvalStatus")
|
||||
@TableField(value = "approvalStatus", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String approvalStatus;
|
||||
|
||||
// 返回前端 approveType 非0的,前端禁止下载、编辑、删除
|
||||
@ApiModelProperty(value = "审核类型:0-审核完成,1-文件上传审核中,2-文件修改审核中,3-文件删除审核中")
|
||||
@Schema(description= "审核类型:0-审核完成,1-文件上传审核中,2-文件修改审核中,3-文件删除审核中")
|
||||
@TableField("approveType")
|
||||
private Integer approveType;
|
||||
|
||||
@ApiModelProperty(value = "tempMetadata")
|
||||
@Schema(description= "tempMetadata")
|
||||
@TableField(value = "tempMetadata", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String tempMetadata;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.DelDirReq;
|
||||
import com.sdm.common.entity.req.data.RenameDirReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.data.model.entity.FileMetadataInfo;
|
||||
import com.sdm.data.model.req.RenameFileReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
@@ -46,7 +48,7 @@ public interface IDataFileService {
|
||||
* @param req 查询目录请求参数
|
||||
* @return 目录信息响应
|
||||
*/
|
||||
SdmResponse queryDir(QueryDirReq req);
|
||||
SdmResponse<PageDataResp<List<FileMetadataInfo>>> queryDir(QueryDirReq req);
|
||||
|
||||
/**
|
||||
* 当前目录下的下一层级目录树查询
|
||||
|
||||
@@ -570,7 +570,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
fileMetadataInfo = fileMetadataInfoService.getById(minioFileSearchReq.getParentDirId());
|
||||
}
|
||||
|
||||
if (fileMetadataInfo != null) {
|
||||
if (ObjectUtils.isEmpty(fileMetadataInfo)) {
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryDir(QueryDirReq req) {
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfo>>> queryDir(QueryDirReq req) {
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
Long parentId;
|
||||
if (ObjectUtils.isNotEmpty(req.getFileId())) {
|
||||
@@ -985,6 +985,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
// 需要保存文件的历史版本记录,同一文件的所有版本共享一个ID,
|
||||
fileInfo.setFileGroupId(fileInfo.getId());
|
||||
fileMetadataInfoService.updateById(fileInfo);
|
||||
|
||||
// 调用审批流,开启审批; 上面先入库拿到主键id,审批流创建失败后再回退数据
|
||||
// String templateId, String templateName,String approveContents,int approveAction:1:新增 2:修改 3:删除
|
||||
String approveContents = getApproveContents(fileInfo.getId(), "知识库文件新增", NumberConstants.ONE, fileInfo, null);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class ExecuteFLowNodeThread implements Runnable {
|
||||
if (uploadSuccess) {
|
||||
PbsService pbsService = (PbsService) SpringUtils.getBean("pbsServiceImpl");
|
||||
log.info("flowNode:{}开始提交计算:{}", flowNode.getId(), JSONObject.toJSONString(submitJobReq));
|
||||
SdmResponse response = pbsService.submitJob(submitJobReq, flowNode.getCreator());
|
||||
SdmResponse response = pbsService.submitJob(submitJobReq, flowNode.getCreator().toString());
|
||||
if (isBatch) {
|
||||
// 批量
|
||||
if (response.getCode() == 200) {
|
||||
|
||||
@@ -12,12 +12,12 @@ import java.io.InputStreamReader;
|
||||
public class RunThread implements Runnable {
|
||||
|
||||
private final InputStream is;
|
||||
private final String idCode;
|
||||
private final Long idCode;
|
||||
private final String name;
|
||||
private final boolean isError;
|
||||
private final String runPath;
|
||||
|
||||
public RunThread(InputStream is, String idCode, String name, String runPath, boolean isError) {
|
||||
public RunThread(InputStream is, Long idCode, String name, String runPath, boolean isError) {
|
||||
this.is = is;
|
||||
this.idCode = idCode;
|
||||
this.name = name;
|
||||
|
||||
@@ -1319,6 +1319,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
response = SdmResponse.failed("添加节点失败");
|
||||
return response;
|
||||
}
|
||||
log.info("添加节点成功,项目根节点:ownRootNodeUuid:{}",ownRootNodeUuid);
|
||||
projectNodeMap = projectNodeList.stream().collect(Collectors.groupingBy(
|
||||
TaskNode::getUuid,
|
||||
Collectors.collectingAndThen(
|
||||
|
||||
Reference in New Issue
Block a user