diff --git a/java/src/main/java/com/yfd/platform/config/SwaggerConfig.java b/java/src/main/java/com/yfd/platform/config/SwaggerConfig.java
index 8b7e6df..0a12ec5 100644
--- a/java/src/main/java/com/yfd/platform/config/SwaggerConfig.java
+++ b/java/src/main/java/com/yfd/platform/config/SwaggerConfig.java
@@ -53,6 +53,34 @@ public class SwaggerConfig {
.enable(swaggerEnabled);
}
+ @Bean
+ public Docket createSpecialDocumentApi() {
+ return new Docket(DocumentationType.OAS_30)
+ .apiInfo(apiInfo())
+// .globalRequestParameters(generateRequestParameters())
+ .groupName("3. 专项文档管理")
+ .select()
+ .apis(RequestHandlerSelectors.basePackage("com.yfd.platform.modules.specialDocument.controller"))
+ .paths(PathSelectors.any())
+ .build()
+ .pathMapping("/")
+ .enable(swaggerEnabled);
+ }
+
+
+ @Bean
+ public Docket createExperimentalDataApi() {
+ return new Docket(DocumentationType.OAS_30)
+ .apiInfo(apiInfo())
+// .globalRequestParameters(generateRequestParameters())
+ .groupName("4. 试验数据管理")
+ .select()
+ .apis(RequestHandlerSelectors.basePackage("com.yfd.platform.modules.experimentalData.controller"))
+ .paths(PathSelectors.any())
+ .build()
+ .pathMapping("/")
+ .enable(swaggerEnabled);
+ }
/**
* 获取通用的全局参数
diff --git a/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsFilesController.java b/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsFilesController.java
new file mode 100644
index 0000000..3fbb501
--- /dev/null
+++ b/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsFilesController.java
@@ -0,0 +1,398 @@
+package com.yfd.platform.modules.experimentalData.controller;
+
+
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yfd.platform.annotation.Log;
+import com.yfd.platform.config.ResponseResult;
+import com.yfd.platform.modules.experimentalData.domain.DualTreeResponse;
+import com.yfd.platform.modules.experimentalData.domain.FileCompareResult;
+import com.yfd.platform.modules.experimentalData.domain.MoveCopyFileFolderRequest;
+import com.yfd.platform.modules.experimentalData.domain.TsFiles;
+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 io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ *
+ * 试验任务文档表 前端控制器
+ *
+ *
+ * @author LiMengNan
+ * @since 2025-01-21
+ */
+@RestController
+@RequestMapping("/experimentalData/ts-files")
+public class TsFilesController {
+
+ //实验任务文档表
+ @Resource
+ private ITsFilesService tsFilesService;
+
+ /**********************************
+ * 用途说明: 分页查询试验数据管理-文档内容
+ * 参数说明
+ * id id
+ * fileName 文件名称
+ * startDate (开始日期)
+ * endDate (结束日期)
+ * keywords 关键字
+ *nodeId 节点ID
+ *taskId 任务ID
+ *isFile 文件夹、文件区分
+ * pageNum 当前页
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
+ ***********************************/
+ @GetMapping("/page")
+ @ApiOperation("分页查询实验数据管理文档内容")
+ @PreAuthorize("@el.check('select:tsfiles')")
+ public ResponseResult getTsFilesPage(String id, String fileName, String startDate, String endDate, String keywords, String nodeId, String taskId, String childNode, Page page) throws Exception {
+ //分页查询
+ Page tsfilesPage = tsFilesService.getTsFilesPage(id, fileName, startDate, endDate, keywords, nodeId, taskId, fileName, childNode, page);
+ return ResponseResult.successData(tsfilesPage);
+ }
+
+
+ /**********************************
+ * 用途说明: 查询实验数据管理文件夹
+ * 参数说明
+ * pageNum 当前页
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
+ ***********************************/
+ @GetMapping("/listTsFiles")
+ @ApiOperation("查询实验数据管理文件夹")
+ @PreAuthorize("@el.check('select:tsfiles')")
+ public ResponseResult getsListTsFiles(String id, String path) throws Exception {
+ //分页查询
+ List tsfiles = tsFilesService.getsListTsFiles(id, path);
+ return ResponseResult.successData(tsfiles);
+ }
+
+ /***********************************
+ * 用途说明:新增试验数据管理-文档内容
+ * 参数说明
+ * TsFiles 文档内容
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回新增成功或者失败
+ ***********************************/
+ @Log(module = "实验数据管理", value = "新增试验数据管理文档内容!", type = "1")
+ @PostMapping("/addTsFiles")
+ @ApiOperation("新增试验数据管理文档内容")
+ @ResponseBody
+ @PreAuthorize("@el.check('add:tsFiles')")
+ public ResponseResult addTsFiles(@RequestBody TsFiles tsFiles) {
+ //对象不能为空
+ if (ObjUtil.isEmpty(tsFiles)) {
+ return ResponseResult.error("参数为空");
+ }
+ Boolean isOk = tsFilesService.addTsFiles(tsFiles);
+ if (isOk) {
+ return ResponseResult.success();
+ } else {
+ return ResponseResult.error();
+ }
+ }
+
+ /***********************************
+ * 用途说明:新增试验数据管理-文件夹
+ * 参数说明
+ * TsFiles 文档内容
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回新增成功或者失败
+ ***********************************/
+ @Log(module = "实验数据管理", value = "新增试验数据管理文件夹", type = "1")
+ @PostMapping("/addTsFile")
+ @ApiOperation("新增试验数据管理文件夹")
+ @ResponseBody
+ @PreAuthorize("@el.check('add:tsFiles')")
+ public ResponseResult addTsFile(@RequestBody TsFiles tsFiles) {
+ //对象不能为空
+ if (ObjUtil.isEmpty(tsFiles)) {
+ return ResponseResult.error("参数为空");
+ }
+ return tsFilesService.addTsFile(tsFiles);
+
+ }
+
+
+ /**********************************
+ * 用途说明: 修改试验数据管理-文档内容
+ * 参数说明
+ * TsFiles 文档内容
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
+ ***********************************/
+ @Log(module = "试验数据管理", value = "修改试验数据管理文档内容", type = "1")
+ @PostMapping("/updateTsFiles")
+ @ApiOperation("修改试验数据管理文档内容")
+ @PreAuthorize("@el.check('update:tsFiles')")
+ public ResponseResult updateTsFiles(@RequestBody TsFiles tsFiles) {
+ //对象不能为空
+ if (ObjUtil.isEmpty(tsFiles) && StrUtil.isBlank(tsFiles.getId())) {
+ return ResponseResult.error("参数为空");
+ }
+ return tsFilesService.updateTsFiles(tsFiles);
+
+ }
+
+ /**********************************
+ * 用途说明: 根据ID删除试验数据管理-文档内容
+ * 参数说明 id 文档内容ID
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
+ ***********************************/
+ @Log(module = "试验数据管理", value = "根据ID删除试验数据管理文档内容", type = "1")
+ @PostMapping("/deleteTsFilesById")
+ @ApiOperation("根据ID删除试验数据管理文档内容")
+ @PreAuthorize("@el.check('del:tsFiles')")
+ public ResponseResult deleteTsFilesById(@RequestParam String id) {
+ if (StrUtil.isBlank(id)) {
+ return ResponseResult.error("参数为空");
+ }
+ List dataset = Arrays.asList(id);
+ return ResponseResult.success(tsFilesService.deleteTsFilesByIds(dataset));
+ }
+
+
+ /**********************************
+ * 用途说明: 批量删除试验数据管理-文档内容
+ * 参数说明 ids 文档内容id数组
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回批量删除成功或失败
+ ***********************************/
+ @Log(module = "专项文档管理", value = "批量删除试验数据管理文档内容", type = "1")
+ @PostMapping("/deleteTsFilesByIds")
+ @ApiOperation("批量删除试验数据管理文档内容")
+ @PreAuthorize("@el.check('del:tsFiles')")
+ public ResponseResult deleteTsFilesByIds(@RequestParam String ids) {
+ if (StrUtil.isBlank(ids)) {
+ return ResponseResult.error("参数为空");
+ }
+ String[] splitIds = ids.split(",");
+ // 数组转集合
+ List dataset = Arrays.asList(splitIds);
+ return ResponseResult.success(tsFilesService.deleteTsFilesByIds(dataset));
+ }
+
+
+ /**************************压缩 解压缩********************************/
+
+ /**********************************
+ * 用途说明: 压缩文件夹接口
+ * 参数说明 ids 文件id数组
+ * 参数说明 compressedFormat 压缩文件格式
+ * 参数说明 compressedName 压缩文件名称
+ * 参数说明 compressedPath 压缩文件路径
+ * 参数说明 covered 是否覆盖 0 覆盖更新updateTime时间 1提示文件存在
+ * 参数说明 parentId 父ID
+ * 返回值说明: com.yfd.platform.config.ResponseResult
+ ***********************************/
+ @PostMapping("/compress")
+ @ApiOperation("压缩文件夹接口")
+ public ResponseResult compressFolder(String ids, String compressedFormat, String compressedName, String compressedPath, String covered, String parentId) {
+ try {
+ if (StrUtil.isBlank(ids) && StrUtil.isBlank(compressedFormat) && StrUtil.isBlank(compressedName) && StrUtil.isBlank(compressedPath)) {
+ return ResponseResult.error("参数为空");
+ }
+
+ return ResponseResult.success(tsFilesService.compressFolder(ids, compressedFormat, compressedName, compressedPath, covered, parentId));
+ } catch (Exception e) {
+ System.out.print("压缩异常原因" + e);
+ return ResponseResult.error("压缩失败");
+ }
+ }
+
+
+ /**********************************
+ * 用途说明: 解压缩接口
+ * 参数说明 id 要解压的文件id
+ * 参数说明 decompressionPath 解压缩路径
+ * 参数说明 parentId 父ID
+ * 返回值说明: com.yfd.platform.config.ResponseResult
+ ***********************************/
+ @PostMapping("/decompression")
+ @ApiOperation("解压缩接口")
+ public ResponseResult decompressionFolder(String id, String decompressionPath, String parentId) {
+ try {
+ if (StrUtil.isBlank(id)) {
+ return ResponseResult.error("参数为空");
+ }
+
+ return ResponseResult.success(tsFilesService.decompressionFolder(id, decompressionPath, parentId));
+ } catch (Exception e) {
+ System.out.print("解压缩异常原因" + e);
+ return ResponseResult.error("解压缩失败");
+ }
+ }
+
+
+
+ /**
+ * 移动文件或文件夹
+ * 参数说明 newPath 新路径
+ * 参数说明 oldpaths 原路径
+ * 参数说明 ParentId 父ID
+ * 参数说明 newFileName 勾选的所有文件名称
+ * 参数说明 Rename 重命名的文件名称
+ * 参数说明 type 覆盖还是重命名 0 1
+ */
+ @PostMapping("/moveFileFolder")
+ @ApiOperation("移动")
+ public ResponseResult moveFileFolder(@RequestBody MoveCopyFileFolderRequest request) throws IOException {
+
+ try {
+ if (request == null) {
+ throw new IllegalArgumentException("请求参数不能为空");
+ }
+ if (request.getNewFileName() == null || request.getNewFileName().isEmpty()) {
+ throw new IllegalArgumentException("newFileName 不能为空");
+ }
+ if (request.getNewPath() == null || request.getOldpaths() == null) {
+ throw new IllegalArgumentException("路径参数不能为空");
+ }
+
+ return ResponseResult.success(tsFilesService.moveFileFolder(request));
+ } catch (Exception e) {
+ System.out.print("移动异常原因" + e);
+ return ResponseResult.error("移动失败");
+ }
+ }
+
+
+ /**
+ * 复制文件或文件夹
+ * 参数说明 newPath 新路径
+ * 参数说明 oldpaths 原路径
+ * 参数说明 ParentId 父ID
+ * 参数说明 newFileName 勾选的所有文件名称
+ * 参数说明 Rename 重命名的文件名称
+ * 参数说明 type 覆盖还是重命名 0 1
+ */
+ @PostMapping("/copyFileFolder")
+ @ApiOperation("复制")
+ public ResponseResult copyFileFolder(@RequestBody MoveCopyFileFolderRequest request) throws IOException {
+
+ try {
+ if (request == null) {
+ throw new IllegalArgumentException("请求参数不能为空");
+ }
+ if (request.getNewFileName() == null || request.getNewFileName().isEmpty()) {
+ throw new IllegalArgumentException("newFileName 不能为空");
+ }
+ if (request.getNewPath() == null || request.getOldpaths() == null) {
+ throw new IllegalArgumentException("路径参数不能为空");
+ }
+ return ResponseResult.success(tsFilesService.copyFileFolder(request));
+ } catch (Exception e) {
+ System.out.print("复制异常原因" + e);
+ return ResponseResult.error("复制失败");
+ }
+ }
+
+
+
+
+ /**
+ * 对比两个目录的文件差异
+ *
+ * @param localPath 本地目录的相对路径(相对于E:\yun\qqq)
+ * @param minioPath MinIO目录的相对路径(相对于test-bucket/qqq)
+ * @return 文件差异列表
+ */
+ @PostMapping("/compare")
+ @ApiOperation("对比两个目录的文件差异")
+ public ResponseResult compareDirectories(@RequestParam String localPath, @RequestParam String minioPath) {
+
+ try {
+ if (StrUtil.isBlank(localPath) && StrUtil.isBlank(minioPath)) {
+ return ResponseResult.error("参数为空");
+ }
+ TsFiles tsFiles = tsFilesService.compareDirectories(localPath, minioPath);
+ return ResponseResult.successData(tsFiles);
+ } catch (Exception e) {
+ return ResponseResult.error("对比失败");
+ }
+ }
+
+
+ /**********************************
+ * 用途说明: 将文件上传到备份空间
+ * 参数说明 paths 路径集合
+ * 参数说明 names 文件名集合
+ * 参数说明 sizes 文件大小集合
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
+ ***********************************/
+ @PostMapping("/uploadToBackup")
+ @ApiOperation("将文件上传到备份空间")
+ public ResponseResult uploadToBackup(@RequestParam String paths, @RequestParam String names, @RequestParam String sizes) {
+
+
+ if (StrUtil.isBlank(paths) && StrUtil.isBlank(names)) {
+ return ResponseResult.error("参数为空");
+ }
+ Boolean isOk = tsFilesService.uploadToBackup(paths, names, sizes);
+ if (isOk) {
+ return ResponseResult.success();
+ } else {
+ return ResponseResult.error();
+ }
+
+ }
+
+ /**********************************
+ * 用途说明: 从备份空间下载到工作空间
+ * 参数说明 paths 路径集合
+ * 参数说明 names 文件名集合
+ * 参数说明 sizes 文件大小集合
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回成功或者失败
+ ***********************************/
+ @PostMapping("/downloadToLocal")
+ @ApiOperation("从备份空间下载到工作空间")
+ public ResponseResult downloadToLocal(@RequestParam String paths, @RequestParam String names, @RequestParam String sizes) {
+
+
+ if (StrUtil.isBlank(paths) && StrUtil.isBlank(names)) {
+ return ResponseResult.error("参数为空");
+ }
+ Boolean isOk = tsFilesService.downloadToLocal(paths, names, sizes);
+ if (isOk) {
+ return ResponseResult.success();
+ } else {
+ return ResponseResult.error();
+ }
+
+ }
+
+
+
+
+ /**********************************
+ * 用途说明: 查询本地和备份空间结构树
+ * 参数说明 taskId 节点ID
+ * 参数说明 nodeId 任务ID
+ * 返回值说明: com.yfd.platform.config.ResponseResult 返回双树数据
+ ***********************************/
+ @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);
+ }
+
+
+
+
+
+
+}
diff --git a/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsNodesController.java b/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsNodesController.java
new file mode 100644
index 0000000..7109a23
--- /dev/null
+++ b/java/src/main/java/com/yfd/platform/modules/experimentalData/controller/TsNodesController.java
@@ -0,0 +1,110 @@
+package com.yfd.platform.modules.experimentalData.controller;
+
+
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
+import com.yfd.platform.annotation.Log;
+import com.yfd.platform.config.ResponseResult;
+import com.yfd.platform.modules.experimentalData.domain.TsNodes;
+import com.yfd.platform.modules.experimentalData.service.ITsNodesService;
+import com.yfd.platform.modules.experimentalData.service.ITsTaskService;
+import com.yfd.platform.modules.specialDocument.domain.Nodes;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * 试验任务节点表 前端控制器
+ *
+ *
+ * @author LiMengNan
+ * @since 2025-01-21
+ */
+@RestController
+@RequestMapping("/experimentalData/ts-nodes")
+public class TsNodesController {
+
+
+ //试验任务节点服务类
+ @Resource
+ private ITsNodesService tsNodesService;
+
+
+ /***********************************
+ * 用途说明:获取试验任务节点 树形结构
+ * 参数说明
+ * nodeName 节点名称
+ * taskId 所属任务ID
+ * 返回值说明: 专项文档节点树形结构
+ ***********************************/
+ @PostMapping("/getTsNodesTree")
+ @ApiOperation("获取试验任务节点树形结构")
+ @ResponseBody
+ @PreAuthorize("@el.check('select:tsnodes')")
+ public ResponseResult getTsNodesTree(String nodeName, String taskId) {
+ List