| | |
| | | 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; |
| | |
| | | } |
| | | 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"; |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |