fix(88615): 标准拆分--编辑--导出文件打不开
This commit is contained in:
+10
-3
@@ -4087,13 +4087,20 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
//创建临时文件夹
|
//创建临时文件夹
|
||||||
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + fileOriName;
|
String tempPath = "";
|
||||||
|
if (fileOriName.length() > 10){
|
||||||
|
int index = fileOriName.lastIndexOf(".");
|
||||||
|
tempPath = fileOriName.substring(0, 50) + fileOriName.substring(index);
|
||||||
|
}
|
||||||
|
// String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + fileOriName;
|
||||||
|
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + tempPath;
|
||||||
File nowFile = new File(fileNowPath);
|
File nowFile = new File(fileNowPath);
|
||||||
if (nowFile.exists()){
|
if (nowFile.exists()){
|
||||||
nowFile.delete();
|
nowFile.delete();
|
||||||
}
|
}
|
||||||
nowFile.mkdirs();
|
nowFile.mkdirs();
|
||||||
String fileName = fileOriName.replace(".zip", "") + ".xls";
|
// String fileName = fileOriName.replace(".zip", "") + ".xls";
|
||||||
|
String fileName = tempPath.replace(".zip", "") + ".xls";
|
||||||
// 设置表格相关属性
|
// 设置表格相关属性
|
||||||
HSSFSheet sheetItems = workbook.createSheet("条文内容");
|
HSSFSheet sheetItems = workbook.createSheet("条文内容");
|
||||||
String[] headers = getWorkbookTitleForExport(cut); // 获取表头
|
String[] headers = getWorkbookTitleForExport(cut); // 获取表头
|
||||||
@@ -4362,7 +4369,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
String repFileName = fileName.replaceAll("/","_");
|
String repFileName = fileName.replaceAll("/","_");
|
||||||
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
|
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
|
||||||
response.setHeader("Content-Disposition",
|
response.setHeader("Content-Disposition",
|
||||||
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
"attachment; filename=\""+ ReadExcel.encodeFileName(tempPath+".zip", request) +"\"");
|
||||||
response.setContentType("application/force-download");
|
response.setContentType("application/force-download");
|
||||||
response.flushBuffer();
|
response.flushBuffer();
|
||||||
os = response.getOutputStream();
|
os = response.getOutputStream();
|
||||||
|
|||||||
Reference in New Issue
Block a user