Compare commits
No commits in common. "715687e8d271853f592c166642ed6cecd7f64157" and "15a58a9c3bbbb3d274d5c09d197af35d118128ca" have entirely different histories.
715687e8d2
...
15a58a9c3b
|
|
@ -4,13 +4,13 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.SecureRandom;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
|
|
@ -22,9 +22,6 @@ import org.apache.poi.ss.usermodel.Sheet;
|
|||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
|
@ -884,105 +881,67 @@ public class ConstructionProjectManagementController {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 발주기관 건설현장 엑셀 다운로드 처리(진행률 표시)
|
||||
* 발주기관 건설현장 CSV 다운로드 처리
|
||||
* @param workbook
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "admins/drilling/inquiry/excel.do")
|
||||
public void downloadDrillingInquiryListExcel(HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String, Object> params) throws Exception {
|
||||
@RequestMapping(value = "admins/drilling/inquiry/excel.do")
|
||||
public void downloadDrillingInquiryListExcel(HttpServletRequest request, HttpServletResponse response, HSSFWorkbook workbook, @RequestParam HashMap<String, Object> params) throws Exception {
|
||||
|
||||
// =========================
|
||||
// 1. 엑셀 헤더 정보 구성
|
||||
// =========================
|
||||
String[] headers = {
|
||||
"cid","constName","projectStateCodeName","constStartDate",
|
||||
"constStateCodeName","inquiryDist","masterCompanyDept",
|
||||
"masterCompanyAdmin","masterCompanyTel","coinstCompanyDept",
|
||||
"constCompanyAdmin","constCompanyTel"
|
||||
};
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
String[][] headerNames = {
|
||||
{"연번", "사업명", "입력상태", "사업내용", "", "발주기관현황", "", "", "", "건설사현황", "", ""},
|
||||
{"", "", "", "사업기간", "사업단계", "발주처", "담당부서",
|
||||
"담당자", "담당자연락처", "건설사명", "담당자", "담당자연락처"}
|
||||
};
|
||||
String[] headers = {"cid","constName","projectStateCodeName","constStartDate","constStateCodeName","inquiryDist" ,"masterCompanyDept","masterCompanyAdmin","masterCompanyTel","coinstCompanyDept","constCompanyAdmin","constCompanyTel"};
|
||||
String[][] headerNames = {{"연번", "사업명", "입력상태", "사업내용", "", "발주기관현황", "", "", "", "건설사현황", "", ""},
|
||||
{"", "", "", "사업기간", "사업단계", "발주처", "담당부서", "담당자", "담당자연락처", "건설사명", "담당자", "담당자연락처"}};
|
||||
|
||||
final int[] headerWidths = {
|
||||
1325,15900,4240,6360,5830,8830,
|
||||
6890,2915,3710,5035,2915,3710
|
||||
};
|
||||
final int[] headerWidths = {1325, 15900, 4240, 6360, 5830, 8830, 6890, 2915, 3710, 5035, 2915, 3710};
|
||||
String[] columnType = {"String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String"};
|
||||
String sheetName = "Sheet1";
|
||||
|
||||
String[] columnType = {
|
||||
"String","String","String","String","String","String",
|
||||
"String","String","String","String","String","String"
|
||||
};
|
||||
|
||||
String sheetName = "Sheet1";
|
||||
String excelFileName = "발주기관 건설현장 목록";
|
||||
|
||||
// =========================
|
||||
// 2. DB 조회
|
||||
// =========================
|
||||
String excelFileName = "발주기관 건설현장 목록";
|
||||
|
||||
// int startIndex = 0;
|
||||
Long totalCount = 0L;
|
||||
// DB 조회
|
||||
JSONObject resultObj = drillingInquiryService.drillingInquiryList(request, params);
|
||||
|
||||
// 여기에서 list 꺼내기
|
||||
List<EgovMap> list = (List<EgovMap>) resultObj.get("datas");
|
||||
Long totalCount = (Long) resultObj.get("count");
|
||||
|
||||
// =========================
|
||||
// 3. 데이터 없으면 리턴
|
||||
// =========================
|
||||
if (list == null || list.isEmpty()) {
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.getWriter().write("<script>alert('데이터가 없습니다.');</script>");
|
||||
return;
|
||||
}
|
||||
|
||||
// =========================
|
||||
// 4. 리스트 후처리
|
||||
// =========================
|
||||
totalCount = (Long) resultObj.get("count");
|
||||
|
||||
int idx = 0;
|
||||
for (EgovMap rowData : list) {
|
||||
|
||||
// 공사기간 형식 처리: startDate ~ endDate
|
||||
String constStartDate = (String) rowData.get("constStartDate");
|
||||
String constEndDate = (String) rowData.get("constEndDate");
|
||||
|
||||
rowData.put("constStartDate",
|
||||
(constStartDate == null ? "" : constStartDate)
|
||||
+ " ~ "
|
||||
+ (constEndDate == null ? "" : constEndDate));
|
||||
|
||||
rowData.put("constStartDate", constStartDate + " ~ " + constEndDate); // 공사기간을 'startDate ~ endDate' 형식으로 변환
|
||||
rowData.put("cid", (totalCount) - (idx++));
|
||||
|
||||
String inquiryDist = "";
|
||||
if (rowData.get("glName") != null)
|
||||
inquiryDist += rowData.get("glName") + " ";
|
||||
if (rowData.get("gmName") != null)
|
||||
inquiryDist += rowData.get("gmName") + " ";
|
||||
if (rowData.get("gsName") != null)
|
||||
inquiryDist += rowData.get("gsName");
|
||||
|
||||
rowData.put("inquiryDist", inquiryDist.trim());
|
||||
String glName = "";
|
||||
String gmName = "";
|
||||
String gsName = "";
|
||||
String inquiryDist = ""; // 발주처
|
||||
if ((String)rowData.get("glName") != null) {
|
||||
glName = (String)rowData.get("glName");
|
||||
inquiryDist = inquiryDist + glName + " ";
|
||||
}if ((String)rowData.get("gmName") != null) {
|
||||
gmName = (String)rowData.get("gmName");
|
||||
inquiryDist = inquiryDist + gmName + " ";
|
||||
}if ((String)rowData.get("gsName") != null) {
|
||||
gsName = (String)rowData.get("gsName");
|
||||
inquiryDist = inquiryDist + gsName;
|
||||
}
|
||||
rowData.put("inquiryDist", inquiryDist);
|
||||
|
||||
}
|
||||
|
||||
// =========================
|
||||
// 5. 엑셀 유틸 호출
|
||||
// =========================
|
||||
ExcelMergeHeaderUtil.listToExcelMergeHeader(
|
||||
list,
|
||||
response,
|
||||
headers,
|
||||
headerNames,
|
||||
headerWidths,
|
||||
columnType,
|
||||
sheetName,
|
||||
excelFileName
|
||||
);
|
||||
|
||||
ExcelMergeHeaderUtil.listToExcelMergeHeader(list, response, headers, headerNames, headerWidths, columnType, sheetName, excelFileName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 건설현장 관리 > 발주기관 로그인 내역 화면
|
||||
* @param params
|
||||
|
|
@ -1153,5 +1112,5 @@ public class ConstructionProjectManagementController {
|
|||
|
||||
ExcelMergeHeaderUtil.listToExcelMergeHeaderForLoginHistory(resultList, response, headers, headerNames, headerWidths, columnType, sheetName, excelFileName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
package geoinfo.util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
|
|
@ -18,7 +17,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.DataFormat;
|
||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
|
@ -26,554 +24,497 @@ import org.apache.poi.ss.usermodel.IndexedColors;
|
|||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataFormat;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
|
||||
|
||||
public class ExcelMergeHeaderUtil {
|
||||
|
||||
public static boolean isEmpty(final Object obj) {
|
||||
return !isNotEmpty(obj);
|
||||
}
|
||||
|
||||
public static boolean isNotEmpty(final Object obj) {
|
||||
if (null == obj)
|
||||
return false;
|
||||
else {
|
||||
if (obj instanceof String)
|
||||
return "".equals(obj) ? false : true;
|
||||
else if (obj instanceof List)
|
||||
return !((List<?>) obj).isEmpty();
|
||||
else if (obj instanceof Map)
|
||||
return !((Map<?, ?>) obj).isEmpty();
|
||||
// else if(obj instanceof Object[]) return 0 == Array.getLength(obj) ? false :
|
||||
// true;
|
||||
else if (obj instanceof Integer)
|
||||
return !(null == obj);
|
||||
else if (obj instanceof Long)
|
||||
return !(null == obj);
|
||||
else if (obj instanceof LocalDate)
|
||||
return !(null == obj);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static boolean isEmpty(final Object obj) {
|
||||
return !isNotEmpty(obj);
|
||||
}
|
||||
|
||||
public static String getTimeStampString(final String format) {
|
||||
return getTimeStampString(new Date(), format);
|
||||
}
|
||||
public static boolean isNotEmpty(final Object obj) {
|
||||
if(null == obj) return false;
|
||||
else {
|
||||
if(obj instanceof String) return "".equals(obj) ? false : true;
|
||||
else if(obj instanceof List) return !((List<?>)obj).isEmpty();
|
||||
else if(obj instanceof Map) return !((Map<?,?>)obj).isEmpty();
|
||||
// else if(obj instanceof Object[]) return 0 == Array.getLength(obj) ? false : true;
|
||||
else if(obj instanceof Integer) return !(null == obj);
|
||||
else if(obj instanceof Long) return !(null == obj);
|
||||
else if(obj instanceof LocalDate) return !(null == obj);
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTimeStampString(final Date date) {
|
||||
return getTimeStampString(date, "yyyyMMddHHmmss");
|
||||
}
|
||||
public static String getTimeStampString(final String format) {
|
||||
return getTimeStampString(new Date(), format);
|
||||
}
|
||||
|
||||
public static String getTimeStampString(final Date date, final String format) {
|
||||
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(format, java.util.Locale.KOREA);
|
||||
return formatter.format(date);
|
||||
}
|
||||
public static String getTimeStampString(final Date date) {
|
||||
return getTimeStampString(date, "yyyyMMddHHmmss");
|
||||
}
|
||||
|
||||
public static String getTimeStampString(String date, final String format) {
|
||||
try {
|
||||
if (null == date || "".equals(date))
|
||||
return "";
|
||||
public static String getTimeStampString(final Date date, final String format){
|
||||
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat (format, java.util.Locale.KOREA);
|
||||
return formatter.format(date);
|
||||
}
|
||||
|
||||
Date d = null;
|
||||
date = date.replaceAll("-", "");
|
||||
public static String getTimeStampString(String date, final String format) {
|
||||
try {
|
||||
if(null == date || "".equals(date)) return "";
|
||||
|
||||
switch (date.length()) {
|
||||
case 14:
|
||||
break;
|
||||
case 12:
|
||||
date += "00";
|
||||
break;
|
||||
case 10:
|
||||
date += "0000";
|
||||
break;
|
||||
case 8:
|
||||
date += "000000";
|
||||
break;
|
||||
case 6:
|
||||
date += "01000000";
|
||||
break;
|
||||
case 4:
|
||||
date += "0101000000";
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
Date d = null;
|
||||
date= date.replaceAll("-", "");
|
||||
|
||||
java.text.SimpleDateFormat tmpFormat = new java.text.SimpleDateFormat("yyyyMMddHHmmss",
|
||||
java.util.Locale.KOREA);
|
||||
switch(date.length()) {
|
||||
case 14: break;
|
||||
case 12: date += "00"; break;
|
||||
case 10: date += "0000"; break;
|
||||
case 8: date += "000000"; break;
|
||||
case 6: date += "01000000"; break;
|
||||
case 4: date += "0101000000"; break;
|
||||
default: return "";
|
||||
}
|
||||
|
||||
if ("".equals(date))
|
||||
d = new Date();
|
||||
else {
|
||||
tmpFormat.setLenient(true);
|
||||
d = tmpFormat.parse(date);
|
||||
}
|
||||
java.text.SimpleDateFormat tmpFormat = new java.text.SimpleDateFormat("yyyyMMddHHmmss", java.util.Locale.KOREA);
|
||||
|
||||
return getTimeStampString(d, format);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
if("".equals(date)) d = new Date();
|
||||
else {
|
||||
tmpFormat.setLenient(true);
|
||||
d = tmpFormat.parse(date);
|
||||
}
|
||||
|
||||
public static String getFileExtention(final String filename) {
|
||||
if (null == filename || "".equals(filename))
|
||||
return "";
|
||||
return getTimeStampString(d, format);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return -1 < filename.lastIndexOf(".") ? filename.substring(filename.lastIndexOf(".") + 1).toLowerCase() : "";
|
||||
}
|
||||
public static String getFileExtention(final String filename) {
|
||||
if(null == filename || "".equals(filename)) return "";
|
||||
|
||||
public static String generationSaveName() {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmmss_SSS");
|
||||
}
|
||||
return -1 < filename.lastIndexOf(".") ? filename.substring(filename.lastIndexOf(".") + 1).toLowerCase() : "";
|
||||
}
|
||||
|
||||
public static void listToExcel(List<EgovMap> list, HttpServletResponse response, String[] headers,
|
||||
String[] headerNames, String[] columnType, String sheetName, String excelFileName) throws IOException {
|
||||
if (ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(0);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); // 쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); // 숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); // 헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
public static String generationSaveName() {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmmss_SSS");
|
||||
}
|
||||
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
public static void listToExcel(List<EgovMap> list, HttpServletResponse response, String[] headers, String[] headerNames, String[] columnType, String sheetName, String excelFileName) throws IOException {
|
||||
if(ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(0);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); //쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); //숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); //헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
|
||||
XSSFDataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
headerStyle.setFillForegroundColor((short) 3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
XSSFDataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
headerStyle.setFillForegroundColor((short)3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
for(int i=0; i<list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i+1);
|
||||
|
||||
for (int j = 0; j < headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
for(int j=0; j<headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
|
||||
Object value = rowData.get(headers[j]);
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
Object value = rowData.get(headers[j]);
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < headerNames.length; j++) {
|
||||
Cell cell = headerRow.createCell(j);
|
||||
cell.setCellValue(headerNames[j]);
|
||||
cell.setCellStyle(headerStyle);
|
||||
sheet.autoSizeColumn(j);
|
||||
sheet.setColumnWidth(j, (sheet.getColumnWidth(j)) + 1000);
|
||||
}
|
||||
// 엑셀이름 한글깨짐방지
|
||||
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||
for(int j=0; j<headerNames.length; j++) {
|
||||
Cell cell = headerRow.createCell(j);
|
||||
cell.setCellValue(headerNames[j]);
|
||||
cell.setCellStyle(headerStyle);
|
||||
sheet.autoSizeColumn(j);
|
||||
sheet.setColumnWidth(j, (sheet.getColumnWidth(j)) + 1000);
|
||||
}
|
||||
//엑셀이름 한글깨짐방지
|
||||
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
response.setHeader("Content-Disposition", String.format("attachment; filename=\"" + outputFileName + "_"
|
||||
+ ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm") + ".xlsx\""));
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
response.setHeader("Content-Disposition", String.format("attachment; filename=\""+outputFileName+"_"+ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm")+".xlsx\""));
|
||||
|
||||
wb.write(response.getOutputStream());
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
wb.write(response.getOutputStream());
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void listToExcelMergeHeader(List<EgovMap> list, HttpServletResponse response, String[] headers,
|
||||
String[][] headerNames, int[] headerWidths, String[] columnType, String sheetName, String excelFileName)
|
||||
throws IOException {
|
||||
if (ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
// XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Workbook wb = new SXSSFWorkbook(200);
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(headerNames.length);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); // 쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); // 숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); // 헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
public static void listToExcelMergeHeader(List<EgovMap> list, HttpServletResponse response, String[] headers, String[][] headerNames, int[] headerWidths, String[] columnType, String sheetName, String excelFileName) throws IOException {
|
||||
if(ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(headerNames.length);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); //쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); //숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); //헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
|
||||
XSSFDataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
// headerStyle.setFillForegroundColor((short)3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
// 바디 스타일
|
||||
CellStyle bodyStyle = wb.createCellStyle();
|
||||
bodyStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
// ---------- 헤더구성 ------------------------------------
|
||||
Row hRow = null;
|
||||
// rows
|
||||
int rowCnt = 0;
|
||||
|
||||
// XSSFDataFormat format = wb.createDataFormat();
|
||||
DataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
// headerStyle.setFillForegroundColor((short)3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
// 헤더 셀 병합
|
||||
// === 세로 병합 (단일 컬럼) ===
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0)); // 연번
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 1, 1)); // 사업명
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 2)); // 입력상태
|
||||
|
||||
// === 가로 병합 (대분류) ===
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 3, 4)); // 사업내용
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 5, 8)); // 발주기관현황
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 11)); // 건설사현황
|
||||
|
||||
// 헤더 정보 구성
|
||||
for (int i = 0; i < headerNames.length; i++) {
|
||||
hRow = sheet.createRow(rowCnt++);
|
||||
for (int j = 0; j < headerNames[i].length; j++) {
|
||||
Cell cell = headerRow.createCell(j);
|
||||
cell = hRow.createCell(j);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue(headerNames[i][j]);
|
||||
sheet.setColumnWidth(j, (sheet.getColumnWidth(j)) + 1000);
|
||||
sheet.setColumnWidth(j, headerWidths[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// 바디 스타일
|
||||
CellStyle bodyStyle = wb.createCellStyle();
|
||||
bodyStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
// ---------- 헤더구성 ------------------------------------
|
||||
Row hRow = null;
|
||||
// rows
|
||||
int rowCnt = 0;
|
||||
// ---------- 헤더구성 끝------------------------------------
|
||||
|
||||
// 헤더 셀 병합
|
||||
// === 세로 병합 (단일 컬럼) ===
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0)); // 연번
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 1, 1)); // 사업명
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 2)); // 입력상태
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i + 2);
|
||||
|
||||
// === 가로 병합 (대분류) ===
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 3, 4)); // 사업내용
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 5, 8)); // 발주기관현황
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 11)); // 건설사현황
|
||||
for (int j = 0; j < headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
|
||||
// 헤더 정보 구성
|
||||
for (int i = 0; i < headerNames.length; i++) {
|
||||
hRow = sheet.createRow(rowCnt++);
|
||||
for (int j = 0; j < headerNames[i].length; j++) {
|
||||
Cell cell = headerRow.createCell(j);
|
||||
cell = hRow.createCell(j);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue(headerNames[i][j]);
|
||||
sheet.setColumnWidth(j, (sheet.getColumnWidth(j)) + 1000);
|
||||
sheet.setColumnWidth(j, headerWidths[j]);
|
||||
}
|
||||
}
|
||||
// 특정 컬럼 중앙 정렬 -----참고용------------
|
||||
// if ("lvl1_rate".equals(headers[j]) ||
|
||||
// "lvl2_rate".equals(headers[j]) ||
|
||||
// "lvl3_rate".equals(headers[j]) ||
|
||||
// "lvl2_organ_up".equals(headers[j]) ||
|
||||
// "lvl3_organ_up".equals(headers[j])) {
|
||||
// cell.setCellStyle(bodyStyle);
|
||||
// } -----참고용------------
|
||||
|
||||
// ---------- 헤더구성 끝------------------------------------
|
||||
Object value = rowData.get(headers[j]);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i + 2);
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
|
||||
for (int j = 0; j < headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
|
||||
// 특정 컬럼 중앙 정렬 -----참고용------------
|
||||
// if ("lvl1_rate".equals(headers[j]) ||
|
||||
// "lvl2_rate".equals(headers[j]) ||
|
||||
// "lvl3_rate".equals(headers[j]) ||
|
||||
// "lvl2_organ_up".equals(headers[j]) ||
|
||||
// "lvl3_organ_up".equals(headers[j])) {
|
||||
// cell.setCellStyle(bodyStyle);
|
||||
// } -----참고용------------
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
|
||||
Object value = rowData.get(headers[j]);
|
||||
//엑셀이름 한글깨짐방지
|
||||
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
response.setHeader("Content-Disposition", String.format("attachment; filename=\""+outputFileName+"_"+ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm")+".xlsx\""));
|
||||
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
wb.write(response.getOutputStream());
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 엑셀이름 한글깨짐방지
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, "UTF-8").replaceAll("\\+", "%20");
|
||||
private static void createNoDataAlert(HttpServletResponse response) throws IOException {
|
||||
response.setHeader("Content-Type", "text/html; charset=UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + encodedFileName + "_"
|
||||
+ ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm") + ".xlsx");
|
||||
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
|
||||
out.write("<html lang=\"ko\">");
|
||||
out.write("<head>");
|
||||
out.write("<script type=\"text/javascript\">");
|
||||
out.write("alert('데이터가 없습니다.');");
|
||||
out.write("history.back(-1);");
|
||||
out.write("</script>");
|
||||
out.write("</head>");
|
||||
out.write("</html>");
|
||||
|
||||
// =========================
|
||||
// 엑셀을 ByteArray로 생성
|
||||
// =========================
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
wb.write(bos);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
if (wb instanceof SXSSFWorkbook) {
|
||||
((SXSSFWorkbook) wb).dispose(); // temp 파일 정리
|
||||
}
|
||||
wb.close();
|
||||
public static void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
String browser = getBrowser(request);
|
||||
|
||||
byte[] fileBytes = bos.toByteArray();
|
||||
response.setContentLength(fileBytes.length);
|
||||
String dispositionPrefix = "attachment; filename=";
|
||||
String encodedFilename = null;
|
||||
|
||||
// =========================
|
||||
// 전송
|
||||
// =========================
|
||||
OutputStream os = response.getOutputStream();
|
||||
os.write(fileBytes);
|
||||
os.flush();
|
||||
os.close();
|
||||
if (browser.equals("MSIE")) {
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Firefox")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Opera")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Chrome")) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < filename.length(); i++) {
|
||||
char c = filename.charAt(i);
|
||||
if(c==','){
|
||||
sb.append(URLEncoder.encode(",", "UTF-8"));
|
||||
} else if (c > '~') {
|
||||
sb.append(URLEncoder.encode("" + c, "UTF-8"));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
encodedFilename = sb.toString();
|
||||
} else {
|
||||
throw new IOException("Not supported browser");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename);
|
||||
|
||||
if ("Opera".equals(browser)) {
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
}
|
||||
if(filename.contains("zip")){
|
||||
response.setContentType("application/zip");
|
||||
}
|
||||
}
|
||||
|
||||
private static String getBrowser(HttpServletRequest request) {
|
||||
String header = request.getHeader("User-Agent");
|
||||
if (header.indexOf("MSIE") > -1) {
|
||||
return "MSIE";
|
||||
} else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지
|
||||
return "Trident";
|
||||
} else if (header.indexOf("Chrome") > -1) {
|
||||
return "Chrome";
|
||||
} else if (header.indexOf("Opera") > -1) {
|
||||
return "Opera";
|
||||
}
|
||||
return "Firefox";
|
||||
}
|
||||
|
||||
public static String LocalDateTimeToStringDate(LocalDateTime localDateTime) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String formattedDate = localDateTime.toLocalDate().format(formatter);
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
|
||||
public static void listToExcelMergeHeaderForLoginHistory(List<EgovMap> list, HttpServletResponse response, String[] headers, String[] headerNames, int[] headerWidths, String[] columnType, String sheetName, String excelFileName) throws IOException {
|
||||
if(ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(headerNames.length);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); //쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); //숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); //헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
|
||||
XSSFDataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
// headerStyle.setFillForegroundColor((short)3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
|
||||
// 바디 스타일
|
||||
CellStyle bodyStyle = wb.createCellStyle();
|
||||
bodyStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
// ---------- 헤더구성 ------------------------------------
|
||||
Row hRow = null;
|
||||
// rows
|
||||
int rowCnt = 0;
|
||||
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
// 헤더 정보 구성
|
||||
hRow = sheet.createRow(rowCnt++);
|
||||
for (int i = 0; i < headerNames.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell = hRow.createCell(i);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue(headerNames[i]);
|
||||
sheet.setColumnWidth(i, (sheet.getColumnWidth(i)) + 1000);
|
||||
sheet.setColumnWidth(i, headerWidths[i]);
|
||||
}
|
||||
|
||||
}
|
||||
// ---------- 헤더구성 끝------------------------------------
|
||||
|
||||
private static void createNoDataAlert(HttpServletResponse response) throws IOException {
|
||||
response.setHeader("Content-Type", "text/html; charset=UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
|
||||
out.write(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
|
||||
out.write("<html lang=\"ko\">");
|
||||
out.write("<head>");
|
||||
out.write("<script type=\"text/javascript\">");
|
||||
out.write("alert('데이터가 없습니다.');");
|
||||
out.write("history.back(-1);");
|
||||
out.write("</script>");
|
||||
out.write("</head>");
|
||||
out.write("</html>");
|
||||
for (int j = 0; j < headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
Object value = rowData.get(headers[j]);
|
||||
|
||||
public static void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException {
|
||||
String browser = getBrowser(request);
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
|
||||
String dispositionPrefix = "attachment; filename=";
|
||||
String encodedFilename = null;
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
|
||||
if (browser.equals("MSIE")) {
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Firefox")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Opera")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Chrome")) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < filename.length(); i++) {
|
||||
char c = filename.charAt(i);
|
||||
if (c == ',') {
|
||||
sb.append(URLEncoder.encode(",", "UTF-8"));
|
||||
} else if (c > '~') {
|
||||
sb.append(URLEncoder.encode("" + c, "UTF-8"));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
encodedFilename = sb.toString();
|
||||
} else {
|
||||
throw new IOException("Not supported browser");
|
||||
}
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
|
||||
response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename);
|
||||
//엑셀이름 한글깨짐방지
|
||||
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||
|
||||
if ("Opera".equals(browser)) {
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
}
|
||||
if (filename.contains("zip")) {
|
||||
response.setContentType("application/zip");
|
||||
}
|
||||
}
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
response.setHeader("Content-Disposition", String.format("attachment; filename=\""+outputFileName+"_"+ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm")+".xlsx\""));
|
||||
|
||||
private static String getBrowser(HttpServletRequest request) {
|
||||
String header = request.getHeader("User-Agent");
|
||||
if (header.indexOf("MSIE") > -1) {
|
||||
return "MSIE";
|
||||
} else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지
|
||||
return "Trident";
|
||||
} else if (header.indexOf("Chrome") > -1) {
|
||||
return "Chrome";
|
||||
} else if (header.indexOf("Opera") > -1) {
|
||||
return "Opera";
|
||||
}
|
||||
return "Firefox";
|
||||
}
|
||||
wb.write(response.getOutputStream());
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
|
||||
public static String LocalDateTimeToStringDate(LocalDateTime localDateTime) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String formattedDate = localDateTime.toLocalDate().format(formatter);
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static void listToExcelMergeHeaderForLoginHistory(List<EgovMap> list, HttpServletResponse response,
|
||||
String[] headers, String[] headerNames, int[] headerWidths, String[] columnType, String sheetName,
|
||||
String excelFileName) throws IOException {
|
||||
if (ExcelMergeHeaderUtil.isNotEmpty(list)) {
|
||||
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet(sheetName);
|
||||
Row headerRow = sheet.createRow(headerNames.length);
|
||||
CellStyle cellStyle1 = wb.createCellStyle(); // 쉼표들어간 숫자 양식
|
||||
CellStyle cellStyle2 = wb.createCellStyle(); // 숫자양식
|
||||
CellStyle headerStyle = wb.createCellStyle(); // 헤더 스타일
|
||||
CellStyle borderStyle = wb.createCellStyle(); // 기본 검정 테두리 스타일
|
||||
|
||||
// 기본 검정 테두리 스타일 설정
|
||||
borderStyle.setBorderTop(BorderStyle.THIN);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
borderStyle.setBorderLeft(BorderStyle.THIN);
|
||||
borderStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
// 글꼴 색상 흰색으로 설정
|
||||
Font headerFont = wb.createFont();
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex()); // 글씨 색상 흰색
|
||||
headerStyle.setFont(headerFont); // 헤더 스타일에 적용
|
||||
|
||||
XSSFDataFormat format = wb.createDataFormat();
|
||||
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
// headerStyle.setFillForegroundColor((short)3);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
|
||||
|
||||
// 바디 스타일
|
||||
CellStyle bodyStyle = wb.createCellStyle();
|
||||
bodyStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
// ---------- 헤더구성 ------------------------------------
|
||||
Row hRow = null;
|
||||
// rows
|
||||
int rowCnt = 0;
|
||||
|
||||
// 헤더 정보 구성
|
||||
hRow = sheet.createRow(rowCnt++);
|
||||
for (int i = 0; i < headerNames.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell = hRow.createCell(i);
|
||||
cell.setCellStyle(headerStyle);
|
||||
cell.setCellValue(headerNames[i]);
|
||||
sheet.setColumnWidth(i, (sheet.getColumnWidth(i)) + 1000);
|
||||
sheet.setColumnWidth(i, headerWidths[i]);
|
||||
}
|
||||
|
||||
// ---------- 헤더구성 끝------------------------------------
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EgovMap rowData = list.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
|
||||
for (int j = 0; j < headers.length; j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
|
||||
Object value = rowData.get(headers[j]);
|
||||
|
||||
// Money 타입
|
||||
if ("Money".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle1);
|
||||
|
||||
// Int 타입
|
||||
} else if ("Int".equalsIgnoreCase(columnType[j])) {
|
||||
if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
cell.setCellValue(0);
|
||||
}
|
||||
cell.setCellStyle(cellStyle2);
|
||||
|
||||
// String 타입
|
||||
} else {
|
||||
cell.setCellValue(value == null ? "" : String.valueOf(value));
|
||||
}
|
||||
// 검정 테두리 적용
|
||||
cell.setCellStyle(borderStyle);
|
||||
}
|
||||
}
|
||||
|
||||
// 엑셀이름 한글깨짐방지
|
||||
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
response.setHeader("Content-Disposition", String.format("attachment; filename=\"" + outputFileName + "_"
|
||||
+ ExcelMergeHeaderUtil.getTimeStampString("yyyyMMdd_HHmm") + ".xlsx\""));
|
||||
|
||||
wb.write(response.getOutputStream());
|
||||
wb.close();
|
||||
} else {
|
||||
createNoDataAlert(response);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -574,7 +574,6 @@
|
|||
|
||||
// 엑셀 다운로드
|
||||
function clickExcelDownload(){
|
||||
/*
|
||||
const params = new URLSearchParams();
|
||||
|
||||
params.append("constTag", trim($('#const-tag').val()));
|
||||
|
|
@ -596,203 +595,7 @@
|
|||
// AJAX가 아닌 직접 다운로드 요청
|
||||
window.location.href = "/admins/drilling/inquiry/excel.do?" + params.toString();
|
||||
$('#excelDownload').val("");
|
||||
*/
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.append("constTag", trim($('#const-tag').val()));
|
||||
params.append("constName", trim($('#const-name').val()));
|
||||
params.append("excelDownload", "Y");
|
||||
|
||||
parent[1].showLoadingBar();
|
||||
|
||||
fetch("/admins/drilling/inquiry/excel.do", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: params.toString()
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error("다운로드 실패");
|
||||
|
||||
const disposition = response.headers.get("Content-Disposition");
|
||||
let fileName = "excel.xlsx";
|
||||
|
||||
if (disposition && disposition.includes("filename=")) {
|
||||
fileName = disposition.split("filename=")[1].replace(/"/g, "");
|
||||
}
|
||||
|
||||
return response.blob().then(blob => ({ blob, fileName }));
|
||||
})
|
||||
.then(({ blob, fileName }) => {
|
||||
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
.catch(err => {
|
||||
alert("엑셀 다운로드 중 오류 발생");
|
||||
console.error(err);
|
||||
})
|
||||
.finally(() => {
|
||||
$('#excelDownload').val("");
|
||||
parent.hideLoadingBar();
|
||||
});
|
||||
}
|
||||
|
||||
let currentJobId = null;
|
||||
|
||||
function startExcelDownload() {
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.append("constTag", trim($('#const-tag').val()));
|
||||
params.append("constName", trim($('#const-name').val()));
|
||||
params.append("excelDownload", "Y");
|
||||
|
||||
|
||||
parent.showLoadingBar();
|
||||
// parent.document.getElementById("progressWrap").style.display = "block";
|
||||
|
||||
fetch("/admins/drilling/inquiry/excel/start.do", {
|
||||
method: "POST",
|
||||
headers: {"Content-Type":"application/x-www-form-urlencoded"},
|
||||
body: params.toString()
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
currentJobId = data.jobId;
|
||||
pollProgress();
|
||||
});
|
||||
|
||||
$('#excelDownload').val("");
|
||||
}
|
||||
|
||||
function pollProgress() {
|
||||
|
||||
fetch("/admins/drilling/inquiry/excel/progress.do?jobId=" + currentJobId)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
|
||||
let percent = data.progress;
|
||||
|
||||
if(percent < 0){
|
||||
alert("엑셀 생성 중 오류 발생");
|
||||
return;
|
||||
}
|
||||
|
||||
parent.document.getElementById("progressBar").style.width = percent + "%";
|
||||
parent.document.getElementById("progressText").innerText = percent + "%";
|
||||
|
||||
if(percent < 100){
|
||||
setTimeout(pollProgress, 500);
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
window.location = "/admins/drilling/inquiry/excel/download.do?jobId=" + currentJobId;
|
||||
parent.hideLoadingBar();
|
||||
}, 700);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on("click", '#btnSubmit', function(e) {
|
||||
|
||||
var canvasModal = parent.document.getElementById("canvasModal");
|
||||
var canvas = parent.document.getElementById("canvas");
|
||||
var ctx = canvas.getContext("2d");
|
||||
|
||||
function showPer(per) {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// 원형 진행률
|
||||
ctx.strokeStyle = "#f66";
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.arc(canvas.width/2, canvas.height/2, 50, -Math.PI/2, (-Math.PI/2 + 2*Math.PI*per/100));
|
||||
ctx.stroke();
|
||||
|
||||
// 숫자 표시
|
||||
ctx.font = '20px Arial';
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(per + '%', canvas.width/2, canvas.height/2);
|
||||
}
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.append("constTag", trim($('#const-tag').val()));
|
||||
params.append("constName", trim($('#const-name').val()));
|
||||
params.append("excelDownload", "Y");
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/admins/drilling/inquiry/excel.do?" + params.toString(), true);
|
||||
xhr.responseType = "blob";
|
||||
|
||||
var fakePer = 0;
|
||||
var fakeInterval;
|
||||
|
||||
xhr.onloadstart = function () {
|
||||
canvasModal.style.display = "flex"; // 모달 표시
|
||||
fakePer = 0;
|
||||
showPer(4);
|
||||
|
||||
// fake progress 시작 (0~90%)
|
||||
fakeInterval = setInterval(function() {
|
||||
if (fakePer < 90) {
|
||||
fakePer += Math.random() * 3; // 0~3%씩 증가
|
||||
showPer(Math.floor(fakePer));
|
||||
}
|
||||
}, 100); // 0.1초마다 증가
|
||||
};
|
||||
|
||||
xhr.onprogress = function (e) {
|
||||
if (e.lengthComputable) {
|
||||
showPer(Math.floor((e.loaded / e.total) * 100));
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onload = function () {
|
||||
if (xhr.status === 200) {
|
||||
var blob = xhr.response;
|
||||
|
||||
// 서버에서 보낸 Content-Disposition 헤더 확인
|
||||
var disposition = xhr.getResponseHeader('Content-Disposition');
|
||||
var fileName = "excel.xlsx"; // 기본 파일명
|
||||
if (disposition && disposition.indexOf('filename*=') !== -1) {
|
||||
var matches = disposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
||||
if (matches != null && matches[1]) {
|
||||
fileName = decodeURIComponent(matches[1]);
|
||||
// 접두사 UTF-8'' 제거
|
||||
fileName = fileName.replace(/^UTF-8''/, '');
|
||||
}
|
||||
}
|
||||
|
||||
// Blob 다운로드
|
||||
var link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = fileName; // 서버에서 가져온 이름 사용
|
||||
document.body.appendChild(link); // Firefox에서 필요
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onloadend = function () {
|
||||
clearInterval(fakeInterval); // fake progress 중지
|
||||
showPer(100);
|
||||
setTimeout(function () {
|
||||
canvasModal.style.display = "none"; // 모달 숨김
|
||||
}, 500);
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
});
|
||||
</script><style>
|
||||
.drilling .page-content-inner {
|
||||
padding: 30px 0;
|
||||
|
|
@ -977,7 +780,7 @@ li {
|
|||
</div>
|
||||
<div class="table-info-group">
|
||||
<span>Total: <span id="count">-</span>건</span>
|
||||
<span class="pull-right" id="btnSubmit"><img src="${pageContext.request.contextPath}/images/admins/excel.gif" style="cursor:hand"</span>
|
||||
<span class="pull-right"><img src="${pageContext.request.contextPath}/images/admins/excel.gif" style="cursor:hand" onClick="javascript:clickExcelDownload()"></span>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
|
|
@ -1032,6 +835,7 @@ li {
|
|||
</div>
|
||||
</section>
|
||||
<!-- 페이지 컨테이너 끝 -->
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,92 +7,7 @@
|
|||
<script>
|
||||
var waitWin;
|
||||
|
||||
function showLoadingBar() {
|
||||
document.getElementById("loadingModal").style.display = "flex";
|
||||
document.getElementById("progressBar").style.width = "0%";
|
||||
document.getElementById("progressText").innerText = "0%";
|
||||
}
|
||||
|
||||
function hideLoadingBar() {
|
||||
document.getElementById("loadingModal").style.display = "none";
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
/* 전체 화면 반투명 배경 */
|
||||
#loadingModal {
|
||||
display: none; /* 기본 숨김 */
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/* background: rgba(0,0,0,0.5); /* 반투명 검정 */ */
|
||||
z-index: 9999;
|
||||
/* display: flex; */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 내용 박스 */
|
||||
#loadingContent {
|
||||
background: #fff;
|
||||
padding: 30px 50px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
min-width: 300px;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* 로딩 스피너 */
|
||||
.spinner {
|
||||
border: 6px solid #f3f3f3;
|
||||
border-top: 6px solid #3498db;
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto 15px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg);}
|
||||
100% { transform: rotate(360deg);}
|
||||
}
|
||||
|
||||
/* 진행률 바 */
|
||||
#progressWrap {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
background: #eee;
|
||||
border-radius: 10px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
#progressBar {
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
background: #4caf50;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#progressText {
|
||||
margin-top: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#canvasModal {
|
||||
display:none;
|
||||
position:fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background: rgba(0,0,0,0.5);
|
||||
z-index:9999;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
|
||||
<!--
|
||||
|
|
@ -103,20 +18,5 @@ function hideLoadingBar() {
|
|||
|
||||
<iframe src="${pageContext.request.contextPath}/admins/${menuId}/${pId}.do?isFirst=true" frameborder="0" height="740" width="100%" scrolling="yes" name="iframeMain" style="overflow-x: hidden;"></iframe>
|
||||
|
||||
<!-- 로딩 모달 -->
|
||||
<div id="loadingModal">
|
||||
<div id="loadingContent">
|
||||
<div class="spinner"></div>
|
||||
<div id="loadingText">엑셀 파일 생성 중...</div>
|
||||
<div id="progressWrap">
|
||||
<div id="progressBar"></div>
|
||||
</div>
|
||||
<div id="progressText">0%</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Canvas Modal -->
|
||||
<div id="canvasModal">
|
||||
<canvas id="canvas" width="120" height="120" style="background:none;"></canvas>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue