从jsh远程仓库更新

(cherry picked from commit 36139e26a4)
This commit is contained in:
cjl
2019-01-15 11:48:38 +08:00
parent 1e1e5f6ed5
commit 693a7558ba
39 changed files with 12153 additions and 10992 deletions

View File

@@ -0,0 +1,28 @@
package com.jsh.erp.utils;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
public class ExportExecUtil {
public static void showExec(File excelFile,String fileName,HttpServletResponse response) throws Exception{
response.setContentType("application/octet-stream");
fileName = new String(fileName.getBytes("gbk"),"ISO8859_1");
response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + ".xls" + "\"");
FileInputStream fis = new FileInputStream(excelFile);
OutputStream out = response.getOutputStream();
int SIZE = 1024 * 1024;
byte[] bytes = new byte[SIZE];
int LENGTH = -1;
while((LENGTH = fis.read(bytes)) != -1){
out.write(bytes,0,LENGTH);
}
out.flush();
fis.close();
}
}