|
|
|
@ -29,7 +29,9 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@ -800,6 +802,7 @@ public class CollectController extends Controller {
|
|
|
|
|
|
|
|
|
|
//文件名称
|
|
|
|
|
String excel_filename = job_name + "【" + bureau_name + "】.xlsx";
|
|
|
|
|
String pdf_filename = job_name + "【" + bureau_name + "】.pdf";
|
|
|
|
|
|
|
|
|
|
//1、找到upload_excel_filename_user
|
|
|
|
|
Record record = cm.viewFilledJob(job_id, bureau_id);
|
|
|
|
@ -827,14 +830,11 @@ public class CollectController extends Controller {
|
|
|
|
|
if (type_id == 2) {
|
|
|
|
|
String pdfPath = excelPath.replace(".xlsx", ".pdf");
|
|
|
|
|
AsposeUtil.xls2pdf(excelPath, pdfPath);
|
|
|
|
|
/**
|
|
|
|
|
* 解决java.io.IOException: UT010029: Stream is closed报错
|
|
|
|
|
* 由于HttpServlet的request和response里的流都只能读写一次,关掉就没有了, 所以不能使用该方法
|
|
|
|
|
*/
|
|
|
|
|
OutputStream outputStream = getResponse().getOutputStream();
|
|
|
|
|
outputStream.write(FileUtil.readBytes(pdfPath));
|
|
|
|
|
outputStream.flush();
|
|
|
|
|
renderNull();
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", true);
|
|
|
|
|
kv.set("pdf_name", pdf_filename);
|
|
|
|
|
kv.set("pdf_url", FileUtil.getName(pdfPath));
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|