|
@@ -133,39 +133,6 @@ public class ZEngineeringIndustryController extends BaseController {
|
|
|
return R.ok(iZEngineeringIndustryService.query(id, type));
|
|
|
}
|
|
|
|
|
|
- @Value("${filePath}")
|
|
|
- private String filePath;
|
|
|
-
|
|
|
- @GetMapping(value = "/downloadZip/{type}/{name}")
|
|
|
- public void downloadZip(@PathVariable String type,@PathVariable String name,HttpServletResponse response) {
|
|
|
-// File file = new File(zipPath);//创建指定目录和文件名称的文件对象
|
|
|
- try {
|
|
|
- // 创建最外层文件夹
|
|
|
- byte[] fileNameBytes = filePath.getBytes("UTF-8");
|
|
|
- // 使用UTF-8编码创建文件
|
|
|
- File file = new File(new String(fileNameBytes, "UTF-8"));
|
|
|
- if (!file.exists()) {
|
|
|
- file.mkdirs();
|
|
|
- }
|
|
|
- byte[] typeFileNameBytes = (file.getPath() + "/" + type).getBytes("UTF-8");
|
|
|
- // 使用UTF-8编码创建文件
|
|
|
- File typeFile = new File(new String(typeFileNameBytes, "UTF-8"));
|
|
|
- if (!typeFile.exists()) {
|
|
|
- typeFile.mkdirs();
|
|
|
- }
|
|
|
- byte[] enginNameFileNameBytes = (typeFile.getPath() + "/" + name).getBytes("UTF-8");
|
|
|
- // 使用UTF-8编码创建文件
|
|
|
- File enginNameFile = new File(new String(enginNameFileNameBytes, "UTF-8"));
|
|
|
- if (!enginNameFile.exists()) {
|
|
|
- enginNameFile.mkdirs();
|
|
|
- }
|
|
|
- System.out.println(enginNameFile.getPath());
|
|
|
- FolderToZipUtil.toZip(filePath+"/"+type+"/"+name,response.getOutputStream(),true);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 工业工程|市政工程根据工程类型查询工程名称
|
|
|
*/
|