拆分流程导出表格问题

This commit is contained in:
gaojiabao
2023-02-13 11:36:01 +08:00
parent 9e80e6f93e
commit 76feeb358a
@@ -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("下载文件失败,请重试");