拆分流程导出表格问题
This commit is contained in:
+10
-13
@@ -418,25 +418,23 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
|
||||
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||
response.setContentType("application/force-download");
|
||||
response.flushBuffer();
|
||||
|
||||
os = response.getOutputStream();
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
excelOS.close();
|
||||
// ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||
// FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||
// int len = 0;
|
||||
// while ((len = fis.read()) != -1) {
|
||||
// os.write(len);
|
||||
// }
|
||||
// os.flush();
|
||||
// os.close(); // 后开先关
|
||||
// fis.close(); // 先开后关
|
||||
|
||||
List<AttFileEO> multiFileInfos = this.attFileEOService.getMultiFileInfos(fileIds);
|
||||
if(CollectionUtils.isNotEmpty(multiFileInfos)){
|
||||
for (AttFileEO data : multiFileInfos){
|
||||
if(StringUtils.isNotBlank(data.getOldFileName())){
|
||||
String[] split = data.getOldFileName().split("\\.");
|
||||
//存在则更换后缀
|
||||
if(split.length>0){
|
||||
data.setOldFileName(split[0]+".png");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.attFileEOService.downLoadFileList(multiFileInfos,fileNowPath);
|
||||
|
||||
}
|
||||
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||
int len = 0;
|
||||
@@ -446,7 +444,6 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
|
||||
os.flush();
|
||||
os.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
|
||||
Reference in New Issue
Block a user