提交代码
This commit is contained in:
parent
532e296331
commit
616f9533d6
@ -8,12 +8,8 @@ import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.modules.experimentalData.domain.*;
|
||||
import com.yfd.platform.modules.experimentalData.service.ITsFilesService;
|
||||
import com.yfd.platform.modules.specialDocument.domain.Files;
|
||||
import com.yfd.platform.modules.specialDocument.service.IFilesService;
|
||||
import com.yfd.platform.modules.storage.model.result.FileItemResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -65,7 +61,6 @@ public class TsFilesController {
|
||||
return ResponseResult.successData(tsfilesPage);
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询实验数据管理文件夹
|
||||
* 参数说明 id 父级ID
|
||||
@ -126,7 +121,6 @@ public class TsFilesController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 修改试验数据管理-文档内容
|
||||
* 参数说明
|
||||
@ -164,7 +158,6 @@ public class TsFilesController {
|
||||
return ResponseResult.success(tsFilesService.deleteTsFilesByIds(dataset, type));
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 批量删除试验数据管理-文档内容
|
||||
* 参数说明 ids 文档内容id数组
|
||||
@ -185,7 +178,6 @@ public class TsFilesController {
|
||||
return ResponseResult.success(tsFilesService.deleteTsFilesByIds(dataset, type));
|
||||
}
|
||||
|
||||
|
||||
/**************************压缩 解压缩********************************/
|
||||
|
||||
/**********************************
|
||||
@ -214,7 +206,6 @@ public class TsFilesController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 解压缩接口
|
||||
* 参数说明 id 要解压的文件id
|
||||
@ -238,7 +229,6 @@ public class TsFilesController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 移动文件或文件夹
|
||||
* 参数说明 newPath 新路径
|
||||
@ -271,7 +261,6 @@ public class TsFilesController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 复制文件或文件夹
|
||||
* 参数说明 newPath 新路径
|
||||
@ -303,19 +292,17 @@ public class TsFilesController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对比两个目录的文件差异
|
||||
*
|
||||
* @param id 勾选的所有数据ID集合
|
||||
* @return 文件差异列表
|
||||
*/
|
||||
/**********************************
|
||||
* 用途说明: 对比本地和minio的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "对比本地和minio的文件差异!")
|
||||
@PostMapping("/compare")
|
||||
@ApiOperation("对比两个目录的文件差异")
|
||||
public ResponseResult compareDirectories( String id, String nodeId, String taskId) {
|
||||
|
||||
|
||||
@PostMapping("/compareMd5")
|
||||
@ApiOperation("对比本地和minio的文件差异")
|
||||
public ResponseResult compareMd5(String id, String nodeId, String taskId,Page<TsFiles> page) {
|
||||
try {
|
||||
List<String> dataset = new ArrayList<>();
|
||||
if (StrUtil.isNotEmpty(id)) {
|
||||
@ -323,13 +310,72 @@ public class TsFilesController {
|
||||
// 数组转集合
|
||||
dataset = Arrays.asList(splitIds);
|
||||
}
|
||||
TsFiles tsFiles = tsFilesService.compareDirectories(dataset, nodeId, taskId);
|
||||
return ResponseResult.successData(tsFiles);
|
||||
Page<TsFiles> tsfilesPage = tsFilesService.compareMd5(dataset, nodeId, taskId, page);
|
||||
|
||||
//List<TsFilesDTO> dtos = tsFilesService.compareMd5(dataset, nodeId, taskId);
|
||||
return ResponseResult.successData(tsfilesPage);
|
||||
} catch (Exception e) {
|
||||
return ResponseResult.error("对比失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 对比本地有minio没有的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "对比本地有minio没有的文件差异!")
|
||||
@PostMapping("/compareLocal")
|
||||
@ApiOperation("对比本地有minio没有的文件差异")
|
||||
public ResponseResult compareLocal(String id, String nodeId, String taskId,Page<TsFiles> page) {
|
||||
try {
|
||||
List<String> dataset = new ArrayList<>();
|
||||
if (StrUtil.isNotEmpty(id)) {
|
||||
String[] splitIds = id.split(",");
|
||||
// 数组转集合
|
||||
dataset = Arrays.asList(splitIds);
|
||||
}
|
||||
|
||||
Page<TsFiles> tsfilesPage = tsFilesService.compareLocal(dataset, nodeId, taskId, page);
|
||||
|
||||
// List<TsFilesDTO> dtos = tsFilesService.compareLocal(dataset, nodeId, taskId);
|
||||
// DualTreeResponse response = tsFilesService.compareLocal(dataset, nodeId, taskId);
|
||||
return ResponseResult.successData(tsfilesPage);
|
||||
} catch (Exception e) {
|
||||
return ResponseResult.error("对比失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 对比本地没有minio有的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "对比本地没有minio有的文件差异!")
|
||||
@PostMapping("/compareMinio")
|
||||
@ApiOperation("对比本地没有minio有的文件差异")
|
||||
public ResponseResult compareMinio(String id, String nodeId, String taskId,Page<TsFiles> page) {
|
||||
try {
|
||||
List<String> dataset = new ArrayList<>();
|
||||
if (StrUtil.isNotEmpty(id)) {
|
||||
String[] splitIds = id.split(",");
|
||||
// 数组转集合
|
||||
dataset = Arrays.asList(splitIds);
|
||||
}
|
||||
Page<TsFiles> tsfilesPage = tsFilesService.compareMinio(dataset, nodeId, taskId, page);
|
||||
|
||||
//DualTreeResponse response = tsFilesService.compareMinio(dataset, nodeId, taskId);
|
||||
return ResponseResult.successData(tsfilesPage);
|
||||
// List<TsFilesDTO> dtos = tsFilesService.compareMinio(dataset, nodeId, taskId);
|
||||
// return ResponseResult.successData(dtos);
|
||||
} catch (Exception e) {
|
||||
return ResponseResult.error("对比失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 将文件上传到备份空间
|
||||
@ -363,7 +409,6 @@ public class TsFilesController {
|
||||
@ApiOperation("从备份空间下载到工作空间")
|
||||
public ResponseResult downloadToLocal(@RequestBody Parameter parameter) {
|
||||
|
||||
|
||||
if (parameter == null) {
|
||||
return ResponseResult.error("参数为空");
|
||||
}
|
||||
@ -376,64 +421,38 @@ public class TsFilesController {
|
||||
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询本地和备份空间结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "查询本地和备份空间结构树!")
|
||||
@PostMapping("/listLocalAndBackup")
|
||||
@ApiOperation("查询本地和备份空间结构树")
|
||||
public ResponseResult listLocalAndBackup(String taskId, String nodeId) {
|
||||
|
||||
|
||||
if (StrUtil.isBlank(taskId) && StrUtil.isBlank(nodeId)) {
|
||||
return ResponseResult.error("参数为空");
|
||||
}
|
||||
//查询本地树和minio树
|
||||
DualTreeResponse response = tsFilesService.listLocalAndBackup(taskId, nodeId);
|
||||
return ResponseResult.successData(response);
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询本地结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件夹ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "查询本地结构树!")
|
||||
@PostMapping("/listLocalTree")
|
||||
@ApiOperation("查询本地结构树")
|
||||
public ResponseResult listLocalTree(String taskId, String nodeId,String id) {
|
||||
public ResponseResult listLocalTree(String taskId, String nodeId) {
|
||||
|
||||
//查询本地树和minio树
|
||||
DualTreeResponse response = tsFilesService.listLocalTree(taskId, nodeId,id);
|
||||
DualTreeResponse response = tsFilesService.listLocalTree(taskId, nodeId);
|
||||
return ResponseResult.successData(response);
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询备份空间结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件夹ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
@Log(module = "实验数据管理", value = "查询备份空间结构树!")
|
||||
@PostMapping("/listBackupTree")
|
||||
@ApiOperation("查询备份空间结构树")
|
||||
public ResponseResult listBackupTree(String taskId, String nodeId,String id) {
|
||||
public ResponseResult listBackupTree(String taskId, String nodeId) {
|
||||
|
||||
//查询本地树和minio树
|
||||
DualTreeResponse response = tsFilesService.listBackupTree(taskId, nodeId,id);
|
||||
DualTreeResponse response = tsFilesService.listBackupTree(taskId, nodeId);
|
||||
return ResponseResult.successData(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 文件自动备份
|
||||
* 参数说明 taskId 节点ID
|
||||
@ -452,7 +471,6 @@ public class TsFilesController {
|
||||
return ResponseResult.success(tsFilesService.automaticFileBackup(taskId, nodeId));
|
||||
}
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 实时获取轨迹数据
|
||||
* 参数说明 id 文件的ID
|
||||
@ -481,8 +499,6 @@ public class TsFilesController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询文件内容接口
|
||||
* 参数说明 id 文件的ID
|
||||
@ -539,8 +555,6 @@ public class TsFilesController {
|
||||
return ResponseResult.success("文件保存成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 获取文件url
|
||||
* 参数说明 id 文件夹ID
|
||||
|
@ -9,10 +9,13 @@ public class DualTreeResponse {
|
||||
|
||||
private List<TreeDTO> localTrees; // 本地树列表(workPath)
|
||||
private List<TreeDTO> minioTrees; // Minio 树列表(backupPath)
|
||||
// private List<TsFilesDTO> tsFilesDTOList;//对比的差异
|
||||
// 添加带参数的构造函数
|
||||
public DualTreeResponse(List<TreeDTO> localTrees, List<TreeDTO> minioTrees) {
|
||||
this.localTrees = localTrees;
|
||||
this.minioTrees = minioTrees;
|
||||
}
|
||||
|
||||
// public DualTreeResponse(List<TsFilesDTO> dtos) {
|
||||
// this.tsFilesDTOList = dtos;
|
||||
// }
|
||||
}
|
||||
|
@ -186,4 +186,9 @@ public class TsFiles implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private List<FileItemResult> md5MismatchedFiles;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String locatMd5;
|
||||
@TableField(exist = false)
|
||||
private String minioMd5;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.yfd.platform.modules.experimentalData.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
|
||||
@Data
|
||||
public class TsFilesDTO {
|
||||
|
||||
/**
|
||||
* 文档ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 上级节点:顶级:“00”
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 文件夹、文件区分
|
||||
*/
|
||||
private String isFile;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* M
|
||||
*/
|
||||
private String fileSize;
|
||||
|
||||
/**
|
||||
* 工作空间存储路径
|
||||
*/
|
||||
private String workPath;
|
||||
|
||||
/**
|
||||
* 备份空间存储路径
|
||||
*/
|
||||
private String backupPath;
|
||||
|
||||
/**
|
||||
* MD5值
|
||||
*/
|
||||
private String locatMd5;
|
||||
private String minioMd5;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Timestamp uploadTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private int number;
|
||||
}
|
@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -60,7 +61,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
String deleteTsFilesByIds(List<String> dataset, String type);
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 压缩文件夹接口
|
||||
* 参数说明 ids 文件id数组
|
||||
@ -73,7 +73,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
String compressFolder(String ids, String compressedFormat, String compressedName, String compressedPath, String covered, String parentId) throws FileNotFoundException;
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 解压缩接口
|
||||
* 参数说明 id 要解压的文件id
|
||||
@ -83,8 +82,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
String decompressionFolder(String id, String decompressionPath, String parentId);
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 将文件上传到备份空间
|
||||
* 参数说明 parameter 数据集合
|
||||
@ -99,8 +96,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
Boolean downloadToLocal(Parameter parameter);
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* 用途说明:新增试验数据管理-文件夹
|
||||
* 参数说明
|
||||
@ -117,8 +112,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
List<TsFiles> getsListTsFiles(String id, String path, String nodeId, String taskId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 移动文件或文件夹
|
||||
* 参数说明 newPath 新路径
|
||||
@ -141,24 +134,13 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
*/
|
||||
String copyFileFolder(MoveCopyFileFolderRequest request) throws IOException;
|
||||
|
||||
// /**********************************
|
||||
// * 用途说明: 查询本地和备份空间结构树
|
||||
// * 参数说明 taskId 节点ID
|
||||
// * 参数说明 nodeId 任务ID
|
||||
// * 参数说明 id 文件夹ID
|
||||
// * 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
// ***********************************/
|
||||
// DualTreeResponse listLocalAndBackup(String taskId, String nodeId,String id);
|
||||
|
||||
|
||||
/**
|
||||
* 对比两个目录的文件差异
|
||||
*
|
||||
* @param dataset 勾选的所有数据ID集合
|
||||
* @return 文件差异列表
|
||||
*/
|
||||
TsFiles compareDirectories(List<String> dataset,String nodeId , String taskId);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 实时获取轨迹数据
|
||||
* 参数说明 id 文件的ID
|
||||
* 参数说明 samTimes 时间
|
||||
* 参数说明 token SSE连接的token
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult
|
||||
***********************************/
|
||||
void batchSendNaviOutDataJob(String id, int samTimes, String token);
|
||||
|
||||
/**
|
||||
@ -184,7 +166,6 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
***********************************/
|
||||
void batchUpdateFile(String id, List<ModifyCommand> modifications) throws IOException;
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 文件自动备份
|
||||
* 参数说明 taskId 节点ID
|
||||
@ -192,30 +173,22 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
String automaticFileBackup(String taskId, String nodeId);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询本地结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件夹ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
DualTreeResponse listLocalTree(String taskId, String nodeId, String id);
|
||||
DualTreeResponse listLocalTree(String taskId, String nodeId);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询备份空间结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件夹ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
DualTreeResponse listBackupTree(String taskId, String nodeId, String id);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 查询本地和备份空间结构树
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
|
||||
***********************************/
|
||||
DualTreeResponse listLocalAndBackup(String taskId, String nodeId);
|
||||
DualTreeResponse listBackupTree(String taskId, String nodeId);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 获取文件url
|
||||
@ -223,4 +196,39 @@ public interface ITsFilesService extends IService<TsFiles> {
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回文件信息
|
||||
***********************************/
|
||||
FileItemResult obtainUrl(String id, String type);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 对比本地有minio没有的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
// DualTreeResponse compareLocal(List<String> dataset, String nodeId, String taskId);
|
||||
Page<TsFiles> compareLocal(List<String> dataset, String nodeId, String taskId, Page<TsFiles> page);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 对比本地没有minio有的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
// DualTreeResponse compareMinio(List<String> dataset, String nodeId, String taskId);
|
||||
Page<TsFiles> compareMinio(List<String> dataset, String nodeId, String taskId, Page<TsFiles> page);
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 对比本地和minio的文件差异
|
||||
* 参数说明 taskId 节点ID
|
||||
* 参数说明 nodeId 任务ID
|
||||
* 参数说明 id 文件id
|
||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
|
||||
***********************************/
|
||||
// Page<TsFiles> compareMd5(List<String> dataset, String nodeId, String taskId) throws IOException, NoSuchAlgorithmException;
|
||||
Page<TsFiles> compareMd5(List<String> dataset, String nodeId, String taskId, Page<TsFiles> page);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user