Commit 0e8a9868 authored by zhkwei's avatar zhkwei

1、报表导出部分bug

parent 9ad4b6dc
......@@ -25,6 +25,7 @@ import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Optional;
......@@ -251,6 +252,34 @@ public class CitReportController {
return ResponseEntity.ok(reportService.addCellManualDataSource(data, from));
}
@RequestMapping(value = "exportReportData/{projectId}/{period}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public void exportReportData(HttpServletResponse response, @RequestBody PeriodReportDataParam param,
@PathVariable(name = "period", required = false) Integer period,
@PathVariable(name = "projectId", required = false) String projectId) {
OutputStream ouputStream = null;
try {
Workbook tWorkbook = citReportService.generateReportData(param.getReportIds(), projectId, period);
response.setContentType("multipart/form-data");
// response.setHeader("Content-Disposition", "attachment;fileName=" + new String(param.getFileName().getBytes("GB2312"), "ISO-8859-1"));
ouputStream = response.getOutputStream();
tWorkbook.write(ouputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (ouputStream != null) {
ouputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@RequestMapping(value = "uploadReportData/{projectId}/{period}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment