엑셀저장 수정

main
이범준 6 months ago
parent f945473f06
commit b9c11e7de2

@ -1,6 +1,5 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -8,13 +7,10 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -108,11 +104,11 @@ public class Crdn02Controller extends ApplicationController {
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -142,10 +138,7 @@ public class Crdn02Controller extends ApplicationController {
xlsx.cell(0, 0).value("검사자료 목록").value(center).merge(0, cellDefs.size()-1) xlsx.cell(0, 0).value("검사자료 목록").value(center).merge(0, cellDefs.size()-1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("검사자료 목록.xlsx")) return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("검사자료 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList()); .addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
} }

@ -1,6 +1,5 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -8,13 +7,10 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -90,11 +86,11 @@ public class Crdn03Controller extends ApplicationController {
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -113,10 +109,7 @@ public class Crdn03Controller extends ApplicationController {
xlsx.cell(0, 0).value("표지정보미확인자료 목록").value(center).merge(0, cellDefs.size()-1) xlsx.cell(0, 0).value("표지정보미확인자료 목록").value(center).merge(0, cellDefs.size()-1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("표지정보미확인자료 목록.xlsx")) return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("표지정보미확인자료 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList()); .addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
} }

@ -7,7 +7,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -123,8 +122,8 @@ public class Crdn06Controller extends ApplicationController {
Format format = new Format(xlsx); Format format = new Format(xlsx);
Comment comment = new Comment(xlsx); Comment comment = new Comment(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); CellStyle left = format.cellStyle(Style.LEFT);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -169,10 +168,6 @@ public class Crdn06Controller extends ApplicationController {
xlsx.cell(0, 0).value("단속자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(0, 0).value("단속자료 목록").value(center).merge(0, cellDefs.size()-1);
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
mav.addObject("download", xlsx.getDownloadable().setFilename("단속자료 목록.xlsx")); mav.addObject("download", xlsx.getDownloadable().setFilename("단속자료 목록.xlsx"));

@ -1,6 +1,5 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -8,13 +7,10 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -87,12 +83,12 @@ public class Crdn08Controller extends ApplicationController {
query.setSggCd(sggCd); query.setSggCd(sggCd);
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); CellStyle left = format.cellStyle(Style.LEFT);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -118,10 +114,7 @@ public class Crdn08Controller extends ApplicationController {
xlsx.cell(0, 0).value("면제차량 목록").value(center).merge(0, cellDefs.size()-1) xlsx.cell(0, 0).value("면제차량 목록").value(center).merge(0, cellDefs.size()-1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("면제차량 목록.xlsx")) return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("면제차량 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList()); .addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
} }

@ -10,13 +10,10 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -129,12 +126,12 @@ public class Cvlc01Controller extends ApplicationController {
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); CellStyle left = format.cellStyle(Style.LEFT);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -159,10 +156,7 @@ public class Cvlc01Controller extends ApplicationController {
xlsx.cell(0, 0).value("민원접수자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(0, 0).value("민원접수자료 목록").value(center).merge(0, cellDefs.size()-1);
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
mav.addObject("download", xlsx.getDownloadable().setFilename("민원접수자료 목록.xlsx")); mav.addObject("download", xlsx.getDownloadable().setFilename("민원접수자료 목록.xlsx"));
mav.addObject("downloadData", list); mav.addObject("downloadData", list);

@ -8,7 +8,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -115,8 +114,8 @@ public class Cvlc02Controller extends ApplicationController {
Format format = new Format(xlsx); Format format = new Format(xlsx);
Comment comment = new Comment(xlsx); Comment comment = new Comment(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); CellStyle left = format.cellStyle(Style.LEFT);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -160,10 +159,7 @@ public class Cvlc02Controller extends ApplicationController {
xlsx.cell(0, 0).value("민원답변대상자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(0, 0).value("민원답변대상자료 목록").value(center).merge(0, cellDefs.size()-1);
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
mav.addObject("download", xlsx.getDownloadable().setFilename("민원답변대상자료 목록.xlsx")); mav.addObject("download", xlsx.getDownloadable().setFilename("민원답변대상자료 목록.xlsx"));
mav.addObject("downloadData", list); mav.addObject("downloadData", list);

@ -1,6 +1,5 @@
package cokr.xit.fims.cvlc.web; package cokr.xit.fims.cvlc.web;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -8,13 +7,10 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -92,11 +88,11 @@ public class Cvlc03Controller extends ApplicationController {
query.setSggCd(sggCd); query.setSggCd(sggCd);
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -122,10 +118,7 @@ public class Cvlc03Controller extends ApplicationController {
xlsx.cell(0, 0).value("민원자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(0, 0).value("민원자료 목록").value(center).merge(0, cellDefs.size()-1);
xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)));
xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
ModelAndView mav = new ModelAndView("downloadView"); ModelAndView mav = new ModelAndView("downloadView");
mav.addObject("download", xlsx.getDownloadable().setFilename("민원자료 목록.xlsx")); mav.addObject("download", xlsx.getDownloadable().setFilename("민원자료 목록.xlsx"));
return mav.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList()); return mav.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -138,7 +137,7 @@ public class Epst02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostGdccService.getEpostGdccList(req.setFetchSize(0)); List<DataObject> list = epostGdccService.getEpostGdccList(req.setFetchSize(0));
@ -161,10 +160,7 @@ public class Epst02Controller extends ApplicationController {
xlsx.cell(0, 0).value("우편통합 안내문").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("우편통합 안내문").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합안내문" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("우편통합안내문" + "_목록_" + dateTime + ".xlsx"));
} }
@ -325,7 +321,7 @@ public class Epst02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -348,10 +344,7 @@ public class Epst02Controller extends ApplicationController {
xlsx.cell(0, 0).value("우편통합 우편발송").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("우편통합 우편발송").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합우편발송" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("우편통합우편발송" + "_목록_" + dateTime + ".xlsx"));
} }
@ -405,7 +398,7 @@ public class Epst02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostRcptRegService.getEpostRcptRegDtlList(req.setFetchSize(0)); List<DataObject> list = epostRcptRegService.getEpostRcptRegDtlList(req.setFetchSize(0));
@ -431,10 +424,7 @@ public class Epst02Controller extends ApplicationController {
xlsx.cell(0, 0).value("우편통합 발송상세").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("우편통합 발송상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합발송상세" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("우편통합발송상세" + "_목록_" + dateTime + ".xlsx"));
} }
@ -549,7 +539,7 @@ public class Epst02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -575,10 +565,7 @@ public class Epst02Controller extends ApplicationController {
xlsx.cell(0, 0).value("우편통합 접수결과").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("우편통합 접수결과").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합접수결과" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("우편통합접수결과" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -116,8 +115,8 @@ public class Excl01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); CellStyle left = format.cellStyle(Style.LEFT);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -161,11 +160,6 @@ public class Excl01Controller extends ApplicationController {
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("부과제외" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("부과제외" + "_목록_" + dateTime + ".xlsx"));
} }

@ -9,7 +9,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -138,7 +137,7 @@ public class Excl02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -191,10 +190,7 @@ public class Excl02Controller extends ApplicationController {
xlsx.cell(0, 0).value("의견제출").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("의견제출").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("의견제출" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("의견제출" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -110,7 +109,7 @@ public class Excl03Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -147,10 +146,7 @@ public class Excl03Controller extends ApplicationController {
xlsx.cell(0, 0).value("단속 재등록").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("단속 재등록").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("단속재등록" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("단속재등록" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -119,7 +118,7 @@ public class Levy01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -157,10 +156,7 @@ public class Levy01Controller extends ApplicationController {
xlsx.cell(0, 0).value("사전 감경부과 대상").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("사전 감경부과 대상").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("사전감경부과대상" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("사전감경부과대상" + "_목록_" + dateTime + ".xlsx"));
} }
@ -270,7 +266,7 @@ public class Levy01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -337,10 +333,7 @@ public class Levy01Controller extends ApplicationController {
xlsx.cell(0, 0).value("부과").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("부과").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("부과" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("부과" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -116,7 +115,7 @@ public class Levy02Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -154,10 +153,7 @@ public class Levy02Controller extends ApplicationController {
xlsx.cell(0, 0).value("과태료감경").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("과태료감경").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("과태료감경" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("과태료감경" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -114,7 +113,7 @@ public class Rcvm01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -170,10 +169,7 @@ public class Rcvm01Controller extends ApplicationController {
xlsx.cell(0, 0).value("수납").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("수납").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("수납" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("수납" + "_목록_" + dateTime + ".xlsx"));
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
@ -109,7 +108,7 @@ public class Rdca01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -152,10 +151,7 @@ public class Rdca01Controller extends ApplicationController {
xlsx.cell(0, 0).value("감액").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("감액").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("감액" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("감액" + "_목록_" + dateTime + ".xlsx"));
} }

@ -9,7 +9,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -224,7 +223,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -267,10 +266,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("계고장 발송 대상").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("계고장 발송 대상").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("계고장발송대상" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("계고장발송대상" + "_목록_" + dateTime + ".xlsx"));
} }
@ -377,7 +373,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -404,10 +400,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("계고장 발송 현황").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("계고장 발송 현황").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("계고장발송현황" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("계고장발송현황" + "_목록_" + dateTime + ".xlsx"));
} }
@ -463,7 +456,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -499,10 +492,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("계도장 발송 상세").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("계도장 발송 상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("계도장발송상세" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("계도장발송상세" + "_목록_" + dateTime + ".xlsx"));
} }
@ -563,7 +553,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -604,10 +594,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("사전통지 발송 대상").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("사전통지 발송 대상").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("사전통지발송대상" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("사전통지발송대상" + "_목록_" + dateTime + ".xlsx"));
} }
@ -717,7 +704,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -744,10 +731,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("사전통지 발송 현황").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("사전통지 발송 현황").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("사전통지발송현황" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("사전통지발송현황" + "_목록_" + dateTime + ".xlsx"));
} }
@ -803,7 +787,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -846,10 +830,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("사전통지 발송 상세").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("사전통지 발송 상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("사전통지발송상세" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("사전통지발송상세" + "_목록_" + dateTime + ".xlsx"));
} }
@ -981,7 +962,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -1008,10 +989,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("고지서 발송 현황").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("고지서 발송 현황").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("고지서발송현황" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("고지서발송현황" + "_목록_" + dateTime + ".xlsx"));
} }
@ -1067,7 +1045,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -1110,10 +1088,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("고지서 발송 상세").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("고지서 발송 상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("고지서발송상세" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("고지서발송상세" + "_목록_" + dateTime + ".xlsx"));
} }
@ -1228,7 +1203,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -1269,10 +1244,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("반송현황").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("반송현황").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("반송현황" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("반송현황" + "_목록_" + dateTime + ".xlsx"));
} }
@ -1459,7 +1431,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -1484,10 +1456,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("공시송달현황").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("공시송달현황").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("공시송달현황" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("공시송달현황" + "_목록_" + dateTime + ".xlsx"));
} }
@ -1543,7 +1512,7 @@ public class Sndb01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -1586,10 +1555,7 @@ public class Sndb01Controller extends ApplicationController {
xlsx.cell(0, 0).value("공시송달상세").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("공시송달상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("공시송달상세" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("공시송달상세" + "_목록_" + dateTime + ".xlsx"));
} }

@ -12,13 +12,10 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format; import cokr.xit.base.docs.xls.Format;
@ -211,7 +208,7 @@ public class Sprt01Controller extends ApplicationController {
List<DataObject> downList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("Y")).toList(); List<DataObject> downList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("Y")).toList();
if("xls".equals(query.getDownload())) { if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {}); List<CellDef> cellDefs = fromJson(query.getCellDefs(), CellDef.listType());
String fileName = "통합조회자료 목록"; String fileName = "통합조회자료 목록";
List<DataObject> listForExcel; List<DataObject> listForExcel;
@ -227,7 +224,7 @@ public class Sprt01Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0(); CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -286,10 +283,7 @@ public class Sprt01Controller extends ApplicationController {
xlsx.cell(0, 0).value(fileName).value(center).merge(0, cellDefs.size()-1) xlsx.cell(0, 0).value(fileName).value(center).merge(0, cellDefs.size()-1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(listForExcel, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(listForExcel, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename(fileName+".xlsx")) return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename(fileName+".xlsx"))
.addObject("downloadData", listForExcel).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList()); .addObject("downloadData", listForExcel).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
} }

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -114,7 +113,7 @@ public class Sprt04Controller extends ApplicationController {
XLSWriter xlsx = new XLSWriter().worksheet(0); XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx); Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); CellStyle center = format.cellStyle(Style.CENTER);
CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -139,10 +138,7 @@ public class Sprt04Controller extends ApplicationController {
xlsx.cell(0, 0).value("민원상담").value(center).merge(0, cellDefs.size() - 1) xlsx.cell(0, 0).value("민원상담").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
List<Integer> cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList();
for(int i=0; i<cellWidthInfo.size();i++) {
xlsx.workbook().getSheetAt(0).setColumnWidth(i, cellWidthInfo.get(i)*256);
}
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("민원상담" + "_목록_" + dateTime + ".xlsx")); .addObject("download", xlsx.getDownloadable().setFilename("민원상담" + "_목록_" + dateTime + ".xlsx"));
} }

Loading…
Cancel
Save