다운로드 설정 추가
This commit is contained in:
parent
4d795610e2
commit
d69c008318
@ -28,6 +28,7 @@ import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -711,7 +712,13 @@ public class EstimateService {
|
||||
public void excelDownload(
|
||||
HttpServletRequest request, HttpServletResponse response, EstimateRequest estimateRequest)
|
||||
throws Exception {
|
||||
ExcelUtil excelUtil = new ExcelUtil();
|
||||
|
||||
// file Name 명이 없는경우
|
||||
if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) {
|
||||
estimateRequest.setFileName(
|
||||
"Quation_Detail_" + new SimpleDateFormat("yyyyMMdd").format(new Date()));
|
||||
}
|
||||
|
||||
EstimateResponse estimateResponse = new EstimateResponse();
|
||||
String splitStr = "、";
|
||||
|
||||
@ -881,6 +888,7 @@ public class EstimateService {
|
||||
|
||||
String excelTemplateNam = "excel_download_quotation_detail_template.xlsx";
|
||||
|
||||
ExcelUtil excelUtil = new ExcelUtil();
|
||||
excelUtil.download(
|
||||
request,
|
||||
response,
|
||||
|
||||
@ -47,6 +47,7 @@ public class ExcelUtil {
|
||||
InputStream is = new BufferedInputStream(templateStream);
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + ".xlsx\"");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
|
||||
try (OutputStream os = response.getOutputStream()) {
|
||||
Context context = new Context();
|
||||
|
||||
@ -73,6 +73,7 @@ public class PdfUtil {
|
||||
// 응답에 PDF 설정
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + pdfFileName + "\"");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
|
||||
try (OutputStream os = response.getOutputStream();
|
||||
PdfWriter writer = new PdfWriter(os);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user