From 563619a5cb13b6f9fdaac2a87467780ced71c135 Mon Sep 17 00:00:00 2001
From: suerwei <18810552194@163.com>
Date: 星期六, 18 五月 2024 16:22:39 +0800
Subject: [PATCH] 附件详情
---
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java
index f99e75f..73a71ef 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java
@@ -1,7 +1,12 @@
package com.javaweb.geo.controller;
+import java.io.File;
+import java.util.ArrayList;
import java.util.List;
+import cn.hutool.core.io.FileUtil;
+import com.javaweb.common.config.Global;
+import com.javaweb.geo.vo.FileVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -70,6 +75,16 @@
}
mmap.put("urlAddress",path);
return prefix + "/image_view";
+ }
+
+ /**
+ * 椤圭洰鏂囦欢鍒楄〃椤甸潰
+ * @return
+ */
+ @GetMapping("/projectDataFileList")
+ public String projectDataFileList(String id ,ModelMap modelMap){
+ modelMap.put("id",id);
+ return prefix + "/files";
}
/**
@@ -159,4 +174,38 @@
return projectDataService.uploadZIP(file,request);
}
+ /**
+ * 鑾峰彇鏂囦欢鍒楄〃
+ * @param id
+ * @return
+ */
+ @PostMapping( "/listFile")
+ @ResponseBody
+ public TableDataInfo listFile(String id){
+ List<FileVo> paths = new ArrayList<>();
+ ProjectData projectData = projectDataService.selectProjectDataById(id);
+// if (!ObjectUtils.isEmpty(projectData)){
+// String num = project.getNum();
+//
+// String diskPath = Global.getUploadPath() + "\\sources\\椤圭洰璧勬枡\\"+num;
+//
+// File file = new File(diskPath);
+//
+// if(FileUtil.exist(file)){
+// if(file.isDirectory()){
+// File []lists = file.listFiles();
+// for(int i =0;i<lists.length;i++){
+// String name =lists[i].getName();
+// String path = urlPrefixPath + num + "/" +name;
+// FileVo vo = new FileVo() ;
+// vo.setName(name);
+// vo.setPath(path);
+// paths.add(vo);
+// }
+// }
+// }
+// }
+ return getDataTable(paths);
+ }
+
}
--
Gitblit v1.9.1