엑셀저장 수정

main
이범준 7 months ago
parent f0a5abedfd
commit 8baa20792c

@ -56,7 +56,7 @@ public class FormatMaker {
public static Format yyyy_mm_dd(Format format, String key) {
return format.of(key).value(o -> {
return DataFormat.yyyy_mm_dd_hh_mm_ss(((Map) o).get(key));
return DataFormat.yyyy_mm_dd(((Map) o).get(key));
});
}

@ -8,6 +8,7 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -15,14 +16,17 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.service.CrdnService;
@ -107,46 +111,42 @@ public class Crdn02Controller extends ApplicationController {
if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
XLSWriter xlsx = new XLSWriter()
.setFilename("검사자료 목록.xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER);
CellStyle numeric = xlsx.n_nn0();
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
Map<String, Object> valueMap = new HashMap<String, Object>();
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("자료출처", xlsx.style("CRDN_INPT_SE_NM", center));
valueMap.put("차량번호", "VHRNO");
valueMap.put("처리상태", xlsx.style("CRDN_STTS_NM", center));
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("사진매수", xlsx.style("ATCH_FILE_CNT", center));
valueMap.put("위반건수", xlsx.style("CRDN_CNT", center));
valueMap.put("단속건수", xlsx.style("CRDN_CNT", center));
valueMap.put("검사결과", "INSP_RSLT");
valueMap.put("처리방법", xlsx.style("PRCS_MTHD", center));
valueMap.put("위반동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("단속동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("원금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("감경금액", xlsx.style("ADVNTCE_AMT", numeric));
valueMap.put("금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("단속조", xlsx.style("TEAM_NM", center));
valueMap.put("성명", "RTPYR_NM");
valueMap.put("주민번호", xlsx.style("RTPYR_NO", center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("자료출처", format.of("CRDN_INPT_SE_NM").style(center));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("처리상태", format.of("CRDN_STTS_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("사진매수", format.of("ATCH_FILE_CNT").style(center));
valueMap.put("위반건수", format.of("CRDN_CNT").style(center));
valueMap.put("단속건수", format.of("CRDN_CNT").style(center));
valueMap.put("검사결과", format.of("INSP_RSLT"));
valueMap.put("처리방법", format.of("PRCS_MTHD").style(center));
valueMap.put("위반동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("원금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("감경금액", format.of("ADVNTCE_AMT").style(numeric));
valueMap.put("금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("단속조", format.of("TEAM_NM").style(center));
valueMap.put("성명", format.of("RTPYR_NM"));
valueMap.put("주민번호", format.of("RTPYR_NO").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("검사자료 목록", center)
.merge(0, cellDefs.size()-1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView").addObject("xls", xlsx)
xlsx.cell(0, 0).value("검사자료 목록").value(center).merge(0, cellDefs.size()-1)
.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()));
xlsx.autoWidth();
return new ModelAndView("xlsView").addObject("download", xlsx.getDownloadable().setFilename("검사자료 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
}

@ -8,6 +8,7 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -15,13 +16,16 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService;
@ -89,35 +93,31 @@ public class Crdn03Controller extends ApplicationController {
if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
XLSWriter xlsx = new XLSWriter()
.setFilename("표지정보미확인자료 목록.xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER);
CellStyle numeric = xlsx.n_nn0();
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
Map<String, Object> valueMap = new HashMap<String, Object>();
valueMap.put("자료출처", xlsx.style("CRDN_INPT_SE_NM", center));
valueMap.put("위반일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("법정동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("잔액", xlsx.style("BLNC", numeric));
valueMap.put("사진건수", xlsx.style("ATCH_FILE_CNT", center));
valueMap.put("발행번호", "CRDN_SN");
valueMap.put("자료출처", format.of("CRDN_INPT_SE_NM").style(center));
valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("잔액", format.of("BLNC").style(numeric));
valueMap.put("사진건수", format.of("ATCH_FILE_CNT").style(center));
valueMap.put("발행번호", format.of(format.of("CRDN_SN")));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("표지정보미확인자료 목록", center)
.merge(0, cellDefs.size()-1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView").addObject("xls", xlsx)
xlsx.cell(0, 0).value("표지정보미확인자료 목록").value(center).merge(0, cellDefs.size()-1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("표지정보미확인자료 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
}

@ -127,24 +127,27 @@ public class Crdn06Controller extends ApplicationController {
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("자료출처", format.of("CRDN_INPT_SE_NM").style(center));
valueMap.put("차량번호", left);
valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,"CRDN_YMD_TM").style(dateDT));
valueMap.put("단속장소", left);
valueMap.put("사진건수", center);
valueMap.put("스티커번호", left);
valueMap.put("장애차량확인", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("처리상태", format.of("CRDN_STTS_NM").style(center));
valueMap.put("제외사유", format.of("LEVY_EXCL_RSN_NM").style(center));
valueMap.put("제외처리일자", FormatMaker.yyyy_mm_dd(format,"LEVY_EXCL_YMD").style(dateYMD));
valueMap.put("제외내역", left);
if(ifEmpty(query.getIncludePhoto(), () -> "").equals("Y")) {
valueMap.put("사진1", FormatMaker.photoCellForApproval(format, comment, "CRDN_PHOTO_PATH1"));
valueMap.put("사진2", FormatMaker.photoCellForApproval(format, comment, "CRDN_PHOTO_PATH2"));
for(CellDef def : cellDefs) {
switch(def.getLabel()) {
case "자료출처"->{ valueMap.put("자료출처", format.of("CRDN_INPT_SE_NM").style(center)); }
case "차량번호"->{ valueMap.put("차량번호", left); }
case "위반일시"->{ valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,"CRDN_YMD_TM").style(dateDT)); }
case "단속장소"->{ valueMap.put("단속장소", left); }
case "사진건수"->{ valueMap.put("사진건수", center); }
case "스티커번호"->{ valueMap.put("스티커번호", left); }
case "장애차량확인"->{ valueMap.put("장애차량확인", format.of("PARKNG_PSBLTY_RSLT_NM").style(center)); }
case "처리상태"->{ valueMap.put("처리상태", format.of("CRDN_STTS_NM").style(center)); }
case "제외사유"->{ valueMap.put("제외사유", format.of("LEVY_EXCL_RSN_NM").style(center)); }
case "제외처리일자"->{ valueMap.put("제외처리일자", FormatMaker.yyyy_mm_dd(format,"LEVY_EXCL_YMD").style(dateYMD)); }
case "제외내역"->{ valueMap.put("제외내역", left); }
case "사진1"->{ valueMap.put("사진1", FormatMaker.photoCellForApproval(format, comment, "CRDN_PHOTO_PATH1")); }
case "사진2"->{ valueMap.put("사진2", FormatMaker.photoCellForApproval(format, comment, "CRDN_PHOTO_PATH2")); }
}
}
CellDef.setValues(cellDefs, valueMap);

@ -8,6 +8,7 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -15,13 +16,16 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.fims.crdn.service.CrdnStngService;
@ -86,41 +90,37 @@ public class Crdn08Controller extends ApplicationController {
if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
XLSWriter xlsx = new XLSWriter()
.setFilename("면제차량 목록.xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER);
CellStyle dateYMD = xlsx.yyyy_mm_dd();
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = crdnStngService.getExemptionVehicleList(query.setFetchSize(0));
Map<String, Object> valueMap = new HashMap<String, Object>();
valueMap.put("차량번호", "VHRNO");
valueMap.put("사유", "EXMPTN_RSN");
valueMap.put("공문번호", "DOC_NO");
valueMap.put("소유주명", "OWNR_NM");
valueMap.put("면제시작일", xlsx.format(o -> xlsx.str2date(o.get("EXMPTN_BGNG_YMD"))).style(dateYMD));
valueMap.put("면제종료일", xlsx.format(o -> xlsx.str2date(o.get("EXMPTN_END_YMD"))).style(dateYMD));
valueMap.put("입력자", "RGTR_NM");
valueMap.put("입력일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("수정자", "MDFR_NM");
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("삭제자", "DLTR_NM");
valueMap.put("삭제사유", "DEL_RSN");
valueMap.put("삭제일시", xlsx.format(o -> xlsx.str2datetime(o.get("DEL_DT"))).style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("사유", format.of("EXMPTN_RSN"));
valueMap.put("공문번호", format.of("DOC_NO"));
valueMap.put("소유주명", format.of("OWNR_NM"));
valueMap.put("면제시작일", FormatMaker.yyyy_mm_dd(format, "EXMPTN_BGNG_YMD").style(dateYMD));
valueMap.put("면제종료일", FormatMaker.yyyy_mm_dd(format, "EXMPTN_END_YMD").style(dateYMD));
valueMap.put("입력자", format.of("RGTR_NM"));
valueMap.put("입력일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("수정자", format.of("MDFR_NM"));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("삭제자", format.of("DLTR_NM"));
valueMap.put("삭제사유", format.of("DEL_RSN"));
valueMap.put("삭제일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "DEL_DT").style(dateDT));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("면제차량 목록", center)
.merge(0, cellDefs.size()-1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView").addObject("xls", xlsx)
xlsx.cell(0, 0).value("면제차량 목록").value(center).merge(0, cellDefs.size()-1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename("면제차량 목록.xlsx"))
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
}

@ -136,6 +136,7 @@ public class Cvlc01Controller extends ApplicationController {
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
@ -146,9 +147,9 @@ public class Cvlc01Controller extends ApplicationController {
valueMap.put("신고자", center);
valueMap.put("담당자", center);
valueMap.put("담당자전화번호", center);
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format,dateYMD,"CVLCPT_RCPT_YMD"));
valueMap.put("처리기한", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,dateDT,"CVLCPT_PRCS_PRNMNT_DT"));
valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,dateDT,"CRDN_YMD_TM"));
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format,"CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("처리기한", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,"CVLCPT_PRCS_PRNMNT_DT").style(dateDT));
valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format,"CRDN_YMD_TM").style(dateDT));
valueMap.put("위반내용", center);
valueMap.put("차량번호", left);
valueMap.put("사진건수", center);

@ -118,6 +118,7 @@ public class Cvlc02Controller extends ApplicationController {
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();

@ -8,6 +8,7 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -15,14 +16,17 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
@ -91,49 +95,40 @@ public class Cvlc03Controller extends ApplicationController {
if("xls".equals(query.getDownload())) {
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
XLSWriter xlsx = new XLSWriter()
.setFilename("민원자료 목록.xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER);
CellStyle dateYMD = xlsx.yyyy_mm_dd();
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
Map<String, Object> valueMap = new HashMap<String, Object>();
valueMap.put("접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
valueMap.put("목록번호", xlsx.style("CVLCPT_LIST_NO", center));
valueMap.put("등록구분", xlsx.style("CRDN_REG_SE_NM", center));
valueMap.put("신고자", xlsx.style("CVLCPT_APLCNT_NM", center));
valueMap.put("담당자", xlsx.style("CVLCPT_PRCS_PIC_NM", center));
valueMap.put("담당자전화번호", xlsx.style("CVLCPT_PRCS_PIC_TELNO", center));
valueMap.put("접수일자", xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
valueMap.put("처리기한", xlsx.format(o -> {
if(o.get("CVLCPT_PRCS_PRNMNT_DT") != null && ((String)o.get("CVLCPT_PRCS_PRNMNT_DT")).length() > 8) {
return xlsx.str2datetime(o.get("CVLCPT_PRCS_PRNMNT_DT"));
} else {
return xlsx.str2date(o.get("CVLCPT_PRCS_PRNMNT_DT"));
}
}).style(dateDT));
valueMap.put("위반일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("위반내용", xlsx.style("VLTN_ARTCL", center));
valueMap.put("차량번호", "VHRNO");
valueMap.put("사진건수", xlsx.style("ATCH_FILE_CNT", center));
valueMap.put("서손/계고사유", xlsx.style("LEVY_EXCL_RSN_NM", center));
valueMap.put("특기사항", "ETC_CN");
valueMap.put("접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("목록번호", format.of("CVLCPT_LIST_NO").style(center));
valueMap.put("등록구분", format.of("CRDN_REG_SE_NM").style(center));
valueMap.put("신고자", format.of("CVLCPT_APLCNT_NM").style(center));
valueMap.put("담당자", format.of("CVLCPT_PRCS_PIC_NM").style(center));
valueMap.put("담당자전화번호", format.of("CVLCPT_PRCS_PIC_TELNO").style(center));
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("처리기한", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CVLCPT_PRCS_PRNMNT_DT").style(dateDT));
valueMap.put("위반일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("위반내용", format.of("VLTN_ARTCL").style(center));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("사진건수", format.of("ATCH_FILE_CNT").style(center));
valueMap.put("서손/계고사유", format.of("LEVY_EXCL_RSN_NM").style(center));
valueMap.put("특기사항", format.of("ETC_CN"));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("민원자료 목록", center)
.merge(0, cellDefs.size()-1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView").addObject("xls", xlsx)
.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
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(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
xlsx.autoWidth();
ModelAndView mav = new ModelAndView("downloadView");
mav.addObject("download", xlsx.getDownloadable().setFilename("민원자료 목록.xlsx"));
return mav.addObject("downloadData", list).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
}
return setCollectionInfo(new ModelAndView("jsonView"),crdnCvlcptService.getCivilComplaintList(query),"","");

@ -8,18 +8,22 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.epst.EpostGdcc;
import cokr.xit.fims.epst.EpostQuery;
import cokr.xit.fims.epst.EpostRcptReg;
@ -133,41 +137,37 @@ public class Epst02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("우편통합안내문" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostGdccService.getEpostGdccList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("발송구분", xlsx.style("SNDNG_SE_NM", center));
valueMap.put("사용여부", xlsx.style("USE_YN_NM", center));
valueMap.put("최종사용일시", xlsx.format(o -> xlsx.str2date(o.get("LAST_USE_DT"))).style(dateDT));
valueMap.put("제목", "TTL_NM");
valueMap.put("문구내용", "WORDS_CN");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("발송구분", format.of("SNDNG_SE_NM").style(center));
valueMap.put("사용여부", format.of("USE_YN_NM").style(center));
valueMap.put("최종사용일시", FormatMaker.yyyy_mm_dd(format, "LAST_USE_DT").style(dateDT));
valueMap.put("제목", format.of("TTL_NM"));
valueMap.put("문구내용", format.of("WORDS_CN"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("우편통합 안내문", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("우편통합 안내문").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합안내문" + "_목록_" + dateTime + ".xlsx"));
}
}
@ -324,41 +324,35 @@ public class Epst02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("우편통합우편발송" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostRcptRegService.getEpostRcptRegList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("발송일자", xlsx.format(o -> xlsx.str2date(o.get("SEND_DATE"))).style(dateYMD));
valueMap.put("발송내역", xlsx.style("JOB_CD", center));
valueMap.put("취급구분", xlsx.style("DIV_KB_NM", center));
valueMap.put("접수일자", xlsx.format(o -> xlsx.str2date(o.get("RCEPT_YMD"))).style(dateYMD));
valueMap.put("자료키", xlsx.style("CON_KEY", center));
valueMap.put("발송건수", xlsx.style("RECEV_CNT", numeric));
valueMap.put("우편처리상태", xlsx.style("POST_PRCS_STTS_NM", center));
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("발송일자", FormatMaker.yyyy_mm_dd(format, "SEND_DATE").style(dateYMD));
valueMap.put("발송내역", format.of("JOB_CD").style(center));
valueMap.put("취급구분", format.of("DIV_KB_NM").style(center));
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format, "RCEPT_YMD").style(dateYMD));
valueMap.put("자료키", format.of("CON_KEY").style(center));
valueMap.put("발송건수", format.of("RECEV_CNT").style(numeric));
valueMap.put("우편처리상태", format.of("POST_PRCS_STTS_NM").style(center));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("우편통합 우편발송", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("우편통합 우편발송").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합우편발송" + "_목록_" + dateTime + ".xlsx"));
}
}
@ -408,44 +402,40 @@ public class Epst02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("우편통합발송상세" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostRcptRegService.getEpostRcptRegDtlList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등기번호", xlsx.style("RGST_NMBR", center));
valueMap.put("우편번호", xlsx.style("RECEV_CAR_OWNER_ZIPCODE", center));
valueMap.put("수취인명", "RECEV_CAR_OWNER_NM");
valueMap.put("배달일시", xlsx.format(o -> xlsx.str2datetime(o.get("DELIV_YMD_TM"))).style(dateDT));
valueMap.put("배달결과", xlsx.style("DELIVRSLTCD_NM", center));
valueMap.put("수령인명", "SUBRECPRSNNM");
valueMap.put("수령인관계", xlsx.style("RELRECPRSNCDNM", center));
valueMap.put("미배달사유", "NONDELIVREASNCDNM");
valueMap.put("주소", "RECEV_CAR_OWNER_ADDR");
valueMap.put("상세주소", "RECEV_CAR_OWNER_DETAILADDR");
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등기번호", format.of("RGST_NMBR").style(center));
valueMap.put("우편번호", format.of("RECEV_CAR_OWNER_ZIPCODE").style(center));
valueMap.put("수취인명", format.of("RECEV_CAR_OWNER_NM"));
valueMap.put("배달일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "DELIV_YMD_TM").style(dateDT));
valueMap.put("배달결과", format.of("DELIVRSLTCD_NM").style(center));
valueMap.put("수령인명", format.of("SUBRECPRSNNM"));
valueMap.put("수령인관계", format.of("RELRECPRSNCDNM").style(center));
valueMap.put("미배달사유", format.of("NONDELIVREASNCDNM"));
valueMap.put("주소", format.of("RECEV_CAR_OWNER_ADDR"));
valueMap.put("상세주소", format.of("RECEV_CAR_OWNER_DETAILADDR"));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("우편통합 발송상세", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("우편통합 발송상세").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합발송상세" + "_목록_" + dateTime + ".xlsx"));
}
}
@ -556,44 +546,38 @@ public class Epst02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("우편통합접수결과" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = epostRcptRsltService.getEpostRcptRsltList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("발송자료키", xlsx.style("RELETCDATA", center));
valueMap.put("우편물코드", xlsx.style("JOB_CD", center));
valueMap.put("우편물종류", xlsx.style("JOB_CD3_NM", center));
valueMap.put("발송일자", xlsx.format(o -> xlsx.str2date(o.get("EXTRI_REGYMD"))).style(dateYMD));
valueMap.put("접수일자", xlsx.format(o -> xlsx.str2date(o.get("RCEPT_YMD"))).style(dateYMD));
valueMap.put("취급구분", xlsx.style("DIV_KB_NM", center));
valueMap.put("발송건수", xlsx.style("RCEPT_CNT", numeric));
valueMap.put("결제금액", xlsx.style("RCEPT_AMT", numeric));
valueMap.put("제작수수료", xlsx.style("USEFEE_AMT", numeric));
valueMap.put("우편요금", xlsx.style("TOTPOST_PRC", numeric));
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("발송자료키", format.of("RELETCDATA").style(center));
valueMap.put("우편물코드", format.of("JOB_CD").style(center));
valueMap.put("우편물종류", format.of("JOB_CD3_NM").style(center));
valueMap.put("발송일자", FormatMaker.yyyy_mm_dd(format, "EXTRI_REGYMD").style(dateYMD));
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format, "RCEPT_YMD").style(dateYMD));
valueMap.put("취급구분", format.of("DIV_KB_NM").style(center));
valueMap.put("발송건수", format.of("RCEPT_CNT").style(numeric));
valueMap.put("결제금액", format.of("RCEPT_AMT").style(numeric));
valueMap.put("제작수수료", format.of("USEFEE_AMT").style(numeric));
valueMap.put("우편요금", format.of("TOTPOST_PRC").style(numeric));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("우편통합 접수결과", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("우편통합 접수결과").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("우편통합접수결과" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,18 +8,22 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.excl.LevyExcl;
import cokr.xit.fims.excl.LevyExclQuery;
import cokr.xit.fims.excl.service.LevyExclService;
@ -110,61 +114,55 @@ public class Excl01Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("부과제외" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyExclService.getLevyExclList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("부과제외일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD));
valueMap.put("부과제외구분", xlsx.style("LEVY_EXCL_SE_NM", center));
valueMap.put("부과제외사유", "LEVY_EXCL_RSN_NM");
valueMap.put("기타내용", "ETC_CN");
valueMap.put("민원신청번호", xlsx.style("CVLCPT_APLY_NO", center));
valueMap.put("민원접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
valueMap.put("민원접수일자", xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("상세단속장소", "DTL_CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("단속특별구역", xlsx.style("CRDN_SPAREA_NM", center));
valueMap.put("사용연료", xlsx.style("USE_FUEL_NM", center));
valueMap.put("주차가능여부", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("부과제외일자", FormatMaker.yyyy_mm_dd(format, "LEVY_EXCL_YMD").style(dateYMD));
valueMap.put("부과제외구분", format.of("LEVY_EXCL_SE_NM").style(center));
valueMap.put("부과제외사유", format.of("LEVY_EXCL_RSN_NM"));
valueMap.put("기타내용", format.of("ETC_CN"));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속원금", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("주차가능여부", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("부과제외", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("부과제외").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("부과제외" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -9,18 +9,20 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.FileService;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
@ -28,6 +30,8 @@ import cokr.xit.fims.cmmn.Print;
import cokr.xit.fims.cmmn.PrintOption;
import cokr.xit.fims.cmmn.hwp.format.DlbrDecsnList;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.excl.LevyExclQuery;
import cokr.xit.fims.excl.OpnnSbmsn;
import cokr.xit.fims.excl.service.OpnnSbmsnService;
@ -133,71 +137,65 @@ public class Excl02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("의견제출" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = opnnSbmsnService.getOpnnSbmsnList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("접수번호", xlsx.style("RCPT_NO", center));
valueMap.put("접수일자", xlsx.format(o -> xlsx.str2date(o.get("RCPT_YMD"))).style(dateYMD));
valueMap.put("접수구분", xlsx.style("RCPT_SE_NM", center));
valueMap.put("통보구분", xlsx.style("NTFCTN_SE_NM", center));
valueMap.put("소유주관계", xlsx.style("OWNR_REL_NM", center));
valueMap.put("진술자명", "STTR_NM");
valueMap.put("진술자생일", xlsx.style("STTR_BRDT_MASK", center));
valueMap.put("진술자우편번호", xlsx.style("STTR_ZIP", center));
valueMap.put("진술자주소", "STTR_ADDR");
valueMap.put("진술자상세주소", "STTR_DADDR");
valueMap.put("의견제출상태", xlsx.style("OPNN_SBMSN_STTS_NM", center));
valueMap.put("의견제출분류", "OPNN_SBMSN_SE_NM");
valueMap.put("의견제출요지", "OPNN_SBMSN_GIST");
valueMap.put("문서번호", "DOC_NO");
valueMap.put("답변일자", xlsx.format(o -> xlsx.str2date(o.get("ANS_YMD"))).style(dateYMD));
valueMap.put("답변내용", "ANS_CN");
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("상세단속장소", "DTL_CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("과태료금액", xlsx.style("FFNLG_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("단속특별구역", xlsx.style("CRDN_SPAREA_NM", center));
valueMap.put("사용연료", xlsx.style("USE_FUEL_NM", center));
valueMap.put("주차가능여부", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("접수번호", format.of("RCPT_NO").style(center));
valueMap.put("접수일자", FormatMaker.yyyy_mm_dd(format, "RCPT_YMD").style(dateYMD));
valueMap.put("접수구분", format.of("RCPT_SE_NM").style(center));
valueMap.put("통보구분", format.of("NTFCTN_SE_NM").style(center));
valueMap.put("소유주관계", format.of("OWNR_REL_NM").style(center));
valueMap.put("진술자명", format.of("STTR_NM"));
valueMap.put("진술자생일", format.of("STTR_BRDT_MASK").style(center));
valueMap.put("진술자우편번호", format.of("STTR_ZIP").style(center));
valueMap.put("진술자주소", format.of("STTR_ADDR"));
valueMap.put("진술자상세주소", format.of("STTR_DADDR"));
valueMap.put("의견제출상태", format.of("OPNN_SBMSN_STTS_NM").style(center));
valueMap.put("의견제출분류", format.of("OPNN_SBMSN_SE_NM"));
valueMap.put("의견제출요지", format.of("OPNN_SBMSN_GIST"));
valueMap.put("문서번호", format.of("DOC_NO"));
valueMap.put("답변일자", FormatMaker.yyyy_mm_dd(format, "ANS_YMD").style(dateYMD));
valueMap.put("답변내용", format.of("ANS_CN"));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("주차가능여부", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("의견제출", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("의견제출").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("의견제출" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,19 +8,23 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.excl.CrdnReReg;
import cokr.xit.fims.excl.LevyExclQuery;
import cokr.xit.fims.excl.service.CrdnReRegService;
@ -105,55 +109,49 @@ public class Excl03Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("단속재등록" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = crdnReRegService.getCrdnReRegList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("재등록일자", xlsx.format(o -> xlsx.str2date(o.get("RE_REG_YMD"))).style(dateYMD));
valueMap.put("단속등록구분", xlsx.style("CRDN_REG_SE_NM", center));
valueMap.put("기타내용", "ETC_CN");
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", "CRDN_STDG_NM");
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("상세단속장소", "DTL_CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("단속특별구역", xlsx.style("CRDN_SPAREA_NM", center));
valueMap.put("사용연료", xlsx.style("USE_FUEL_NM", center));
valueMap.put("주차가능여부", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("재등록일자", FormatMaker.yyyy_mm_dd(format, "RE_REG_YMD").style(dateYMD));
valueMap.put("단속등록구분", format.of("CRDN_REG_SE_NM").style(center));
valueMap.put("기타내용", format.of("ETC_CN"));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("주차가능여부", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("단속 재등록", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("단속 재등록").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("단속재등록" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,19 +8,23 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.levy.Levy;
import cokr.xit.fims.levy.LevyQuery;
import cokr.xit.fims.levy.service.LevyService;
@ -114,55 +118,50 @@ public class Levy01Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("사전감경부과대상" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getRductLevyTrgtList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("법정동", "CRDN_STDG_NM");
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("과태료금액", xlsx.style("FFNLG_AMT", numeric));
valueMap.put("사전통지금액", xlsx.style("ADVNTCE_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("민원신청번호", xlsx.style("CVLCPT_APLY_NO", center));
valueMap.put("민원접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
valueMap.put("민원접수일자", xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
valueMap.put("민원전송결과", xlsx.style("CVLCPT_TRSM_NM", center));
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("사전통지금액", format.of("ADVNTCE_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("민원전송결과", format.of("CVLCPT_TRSM_NM").style(center));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("사전 감경부과 대상", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("사전 감경부과 대상").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("사전감경부과대상" + "_목록_" + dateTime + ".xlsx"));
}
}
@ -268,84 +267,79 @@ public class Levy01Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("부과" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = levyService.getLevyList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("회계연도", xlsx.style("FYR", center));
valueMap.put("회계코드", xlsx.style("ACNTG_SE_CD", center));
valueMap.put("세목코드", xlsx.style("TXITM_CD", center));
valueMap.put("세목명", xlsx.style("TXITM_NM", center));
valueMap.put("부과번호", xlsx.style("LEVY_NO", center));
valueMap.put("분납순번", xlsx.style("INSPY_NO", center));
valueMap.put("부과구분", xlsx.style("LEVY_SE_NM", center));
valueMap.put("통합구분", xlsx.style("UNTY_SE_NM", center));
valueMap.put("감경구분", xlsx.style("RDUCT_SE_NM", center));
valueMap.put("부과일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_YMD"))).style(dateYMD));
valueMap.put("최초납기일자", xlsx.format(o -> xlsx.str2date(o.get("FRST_DUDT_YMD"))).style(dateYMD));
valueMap.put("납기일자", xlsx.format(o -> xlsx.str2date(o.get("DUDT_YMD"))).style(dateYMD));
valueMap.put("과태료금액", xlsx.style("FFNLG_AMT", numeric));
valueMap.put("부과본세", xlsx.style("LEVY_PCPTAX", numeric));
valueMap.put("부과가산금", xlsx.style("LEVY_ADAMT", numeric));
valueMap.put("분납이자", xlsx.style("INSPY_INT", numeric));
valueMap.put("수납본세", xlsx.style("RCVMT_PCPTAX", numeric));
valueMap.put("수납가산금", xlsx.style("RCVMT_ADAMT", numeric));
valueMap.put("감액본세", xlsx.style("RDCAMT_PCPTAX", numeric));
valueMap.put("감액가산금", xlsx.style("RDCAMT_ADAMT", numeric));
valueMap.put("미납금액", xlsx.style("SUM_AMT", numeric));
valueMap.put("과세물건", "TXTN_THING");
valueMap.put("체납사유", "NPMNT_RSN_NM");
valueMap.put("수납일자", xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD"))).style(dateYMD));
valueMap.put("압류일자", xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD"))).style(dateYMD));
valueMap.put("압류물건", "SZR_THING");
valueMap.put("대체압류차량", "RPM_SZR_VHRNO");
valueMap.put("압류해제일자", xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD"))).style(dateYMD));
valueMap.put("전자납부번호", "EPAYNO_MASK");
valueMap.put("은행명", "BANK_NM");
valueMap.put("가상계좌번호", xlsx.style("VR_ACTNO", center));
valueMap.put("은행명2", "BANK_NM2");
valueMap.put("가상계좌번호2", xlsx.style("VR_ACTNO2", center));
valueMap.put("은행명3", "BANK_NM3");
valueMap.put("가상계좌번호3", xlsx.style("VR_ACTNO3", center));
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("법정동", "CRDN_STDG_NM");
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("회계연도", format.of("FYR").style(center));
valueMap.put("회계코드", format.of("ACNTG_SE_CD").style(center));
valueMap.put("세목코드", format.of("TXITM_CD").style(center));
valueMap.put("세목명", format.of("TXITM_NM").style(center));
valueMap.put("부과번호", format.of("LEVY_NO").style(center));
valueMap.put("분납순번", format.of("INSPY_NO").style(center));
valueMap.put("부과구분", format.of("LEVY_SE_NM").style(center));
valueMap.put("통합구분", format.of("UNTY_SE_NM").style(center));
valueMap.put("감경구분", format.of("RDUCT_SE_NM").style(center));
valueMap.put("부과일자", FormatMaker.yyyy_mm_dd(format, "LEVY_YMD").style(dateYMD));
valueMap.put("최초납기일자", FormatMaker.yyyy_mm_dd(format, "FRST_DUDT_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "DUDT_YMD").style(dateYMD));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("부과본세", format.of("LEVY_PCPTAX").style(numeric));
valueMap.put("부과가산금", format.of("LEVY_ADAMT").style(numeric));
valueMap.put("분납이자", format.of("INSPY_INT").style(numeric));
valueMap.put("수납본세", format.of("RCVMT_PCPTAX").style(numeric));
valueMap.put("수납가산금", format.of("RCVMT_ADAMT").style(numeric));
valueMap.put("감액본세", format.of("RDCAMT_PCPTAX").style(numeric));
valueMap.put("감액가산금", format.of("RDCAMT_ADAMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("과세물건", format.of("TXTN_THING"));
valueMap.put("체납사유", format.of("NPMNT_RSN_NM"));
valueMap.put("수납일자", FormatMaker.yyyy_mm_dd(format, "RCVMT_YMD").style(dateYMD));
valueMap.put("압류일자", FormatMaker.yyyy_mm_dd(format, "SZR_YMD").style(dateYMD));
valueMap.put("압류물건", format.of("SZR_THING"));
valueMap.put("대체압류차량", format.of("RPM_SZR_VHRNO"));
valueMap.put("압류해제일자", FormatMaker.yyyy_mm_dd(format, "SZR_RMV_YMD").style(dateYMD));
valueMap.put("전자납부번호", format.of("EPAYNO_MASK"));
valueMap.put("은행명", format.of("BANK_NM"));
valueMap.put("가상계좌번호", format.of("VR_ACTNO").style(center));
valueMap.put("은행명2", format.of("BANK_NM2"));
valueMap.put("가상계좌번호2", format.of("VR_ACTNO2").style(center));
valueMap.put("은행명3", format.of("BANK_NM3"));
valueMap.put("가상계좌번호3", format.of("VR_ACTNO3").style(center));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("부과", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("부과").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("부과" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,19 +8,23 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.levy.LevyQuery;
import cokr.xit.fims.levy.Rduct;
import cokr.xit.fims.levy.service.RductService;
@ -111,56 +115,50 @@ public class Levy02Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("과태료감경" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = rductService.getRductList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("감경일자", xlsx.format(o -> xlsx.str2date(o.get("RDUCT_YMD"))).style(dateYMD));
valueMap.put("감경사유", "RDUCT_RSN_CD");
valueMap.put("기타내용", "ETC_CN");
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("상세단속장소", "DTL_CRDN_PLC");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("감경금액", xlsx.style("RDUCT_AMT", numeric));
valueMap.put("과태료금액", xlsx.style("FFNLG_AMT", numeric));
valueMap.put("미납금액", xlsx.style("SUM_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("단속특별구역", xlsx.style("CRDN_SPAREA_NM", center));
valueMap.put("사용연료", xlsx.style("USE_FUEL_NM", center));
valueMap.put("주차가능여부", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("감경일자", FormatMaker.yyyy_mm_dd(format, "RDUCT_YMD").style(dateYMD));
valueMap.put("감경사유", format.of("RDUCT_RSN_CD"));
valueMap.put("기타내용", format.of("ETC_CN"));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("감경금액", format.of("RDUCT_AMT").style(numeric));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("미납금액", format.of("SUM_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("주차가능여부", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("과태료감경", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("과태료감경").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("과태료감경" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,18 +8,22 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.rcvm.Rcvmt;
import cokr.xit.fims.rcvm.RcvmtQuery;
import cokr.xit.fims.rcvm.service.RcvmtService;
@ -109,73 +113,68 @@ public class Rcvm01Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("수납" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = rcvmtService.getRcvmtList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("수납입력구분", xlsx.style("RCVMT_INPT_SE_NM", center));
valueMap.put("수납취소", xlsx.style("RCVMT_RTRCN_NM", center));
valueMap.put("회계연도", xlsx.style("FYR", center));
valueMap.put("회계구분", xlsx.style("ACNTG_SE_CD", center));
valueMap.put("세목코드", xlsx.style("TXITM_CD", center));
valueMap.put("세목명", "TXITM_NM");
valueMap.put("부과번호", xlsx.style("LEVY_NO", center));
valueMap.put("수납일련번호", xlsx.style("RCVMT_SN", center));
valueMap.put("회계일자", xlsx.format(o -> xlsx.str2date(o.get("ACNTG_YMD"))).style(dateYMD));
valueMap.put("소인일자", xlsx.format(o -> xlsx.str2date(o.get("PSTMRK_YMD"))).style(dateYMD));
valueMap.put("수납일자", xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD"))).style(dateYMD));
valueMap.put("수납금액", xlsx.style("RCVMT_AMT", numeric));
valueMap.put("수납본세", xlsx.style("RCVMT_PCPTAX", numeric));
valueMap.put("수납가산금", xlsx.style("RCVMT_ADAMT", numeric));
valueMap.put("수납이자", xlsx.style("RCVMT_INT", numeric));
valueMap.put("수납은행", "RCVMT_BANK_NM");
valueMap.put("납부방법", "PAY_MTHD_SE_NM");
valueMap.put("수납구분", xlsx.style("RCVMT_SE_NM", center));
valueMap.put("수납상태", xlsx.style("RCVMT_STTS_NM", center));
valueMap.put("부과일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_YMD"))).style(dateYMD));
valueMap.put("최초납기일자", xlsx.format(o -> xlsx.str2date(o.get("FRST_DUDT_YMD"))).style(dateYMD));
valueMap.put("납기일자", xlsx.format(o -> xlsx.str2date(o.get("DUDT_YMD"))).style(dateYMD));
valueMap.put("부과본세", xlsx.style("LEVY_PCPTAX", numeric));
valueMap.put("부과가산금", xlsx.style("LEVY_ADAMT", numeric));
valueMap.put("분납이자", xlsx.style("INSPY_INT", numeric));
valueMap.put("압류일자", xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD"))).style(dateYMD));
valueMap.put("압류물건", "SZR_THING");
valueMap.put("대체압류차량", "RPM_SZR_VHRNO");
valueMap.put("압류해제일자", xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD"))).style(dateYMD));
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", "CRDN_STDG_NM");
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("수납입력구분", format.of("RCVMT_INPT_SE_NM").style(center));
valueMap.put("수납취소", format.of("RCVMT_RTRCN_NM").style(center));
valueMap.put("회계연도", format.of("FYR").style(center));
valueMap.put("회계구분", format.of("ACNTG_SE_CD").style(center));
valueMap.put("세목코드", format.of("TXITM_CD").style(center));
valueMap.put("세목명", format.of("TXITM_NM"));
valueMap.put("부과번호", format.of("LEVY_NO").style(center));
valueMap.put("수납일련번호", format.of("RCVMT_SN").style(center));
valueMap.put("회계일자", FormatMaker.yyyy_mm_dd(format, "ACNTG_YMD").style(dateYMD));
valueMap.put("소인일자", FormatMaker.yyyy_mm_dd(format, "PSTMRK_YMD").style(dateYMD));
valueMap.put("수납일자", FormatMaker.yyyy_mm_dd(format, "RCVMT_YMD").style(dateYMD));
valueMap.put("수납금액", format.of("RCVMT_AMT").style(numeric));
valueMap.put("수납본세", format.of("RCVMT_PCPTAX").style(numeric));
valueMap.put("수납가산금", format.of("RCVMT_ADAMT").style(numeric));
valueMap.put("수납이자", format.of("RCVMT_INT").style(numeric));
valueMap.put("수납은행", format.of("RCVMT_BANK_NM"));
valueMap.put("납부방법", format.of("PAY_MTHD_SE_NM"));
valueMap.put("수납구분", format.of("RCVMT_SE_NM").style(center));
valueMap.put("수납상태", format.of("RCVMT_STTS_NM").style(center));
valueMap.put("부과일자", FormatMaker.yyyy_mm_dd(format, "LEVY_YMD").style(dateYMD));
valueMap.put("최초납기일자", FormatMaker.yyyy_mm_dd(format, "FRST_DUDT_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "DUDT_YMD").style(dateYMD));
valueMap.put("부과본세", format.of("LEVY_PCPTAX").style(numeric));
valueMap.put("부과가산금", format.of("LEVY_ADAMT").style(numeric));
valueMap.put("분납이자", format.of("INSPY_INT").style(numeric));
valueMap.put("압류일자", FormatMaker.yyyy_mm_dd(format, "SZR_YMD").style(dateYMD));
valueMap.put("압류물건", format.of("SZR_THING"));
valueMap.put("대체압류차량", format.of("RPM_SZR_VHRNO"));
valueMap.put("압류해제일자", FormatMaker.yyyy_mm_dd(format, "SZR_RMV_YMD").style(dateYMD));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("수납", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("수납").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("수납" + "_목록_" + dateTime + ".xlsx"));
}
}

@ -8,16 +8,20 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.rdca.Rdcamt;
import cokr.xit.fims.rdca.RdcamtQuery;
import cokr.xit.fims.rdca.service.RdcamtService;
@ -104,61 +108,55 @@ public class Rdca01Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("감액" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle numeric = xlsx.n_nn0(); // 숫자 3자리 콤마(,)
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = rdcamtService.getRdcamtList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("업무구분", xlsx.style("TASK_SE_NM", center));
valueMap.put("부과제외일자", xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD));
valueMap.put("부과제외구분", xlsx.style("LEVY_EXCL_SE_NM", center));
valueMap.put("부과제외사유", "LEVY_EXCL_RSN_NM");
valueMap.put("기타내용", "ETC_CN");
valueMap.put("민원신청번호", xlsx.style("CVLCPT_APLY_NO", center));
valueMap.put("민원접수번호", xlsx.style("CVLCPT_RCPT_NO", center));
valueMap.put("민원접수일자", xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
valueMap.put("단속일시", xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자구분", xlsx.style("RTPYR_SE_NM", center));
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("납부자명", "RTPYR_NM");
valueMap.put("단속법정동", xlsx.style("CRDN_STDG_NM", center));
valueMap.put("단속장소", "CRDN_PLC");
valueMap.put("상세단속장소", "DTL_CRDN_PLC");
valueMap.put("위반항목", "VLTN_ARTCL");
valueMap.put("단속금액", xlsx.style("FFNLG_CRDN_AMT", numeric));
valueMap.put("처리상태", "CRDN_STTS_NM");
valueMap.put("단속특별구역", xlsx.style("CRDN_SPAREA_NM", center));
valueMap.put("사용연료", xlsx.style("USE_FUEL_NM", center));
valueMap.put("주차가능여부", xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("우편번호", xlsx.style("ZIP", center));
valueMap.put("주소", "ADDR");
valueMap.put("상세주소", "DTL_ADDR");
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("업무구분", format.of("TASK_SE_NM").style(center));
valueMap.put("부과제외일자", FormatMaker.yyyy_mm_dd(format, "LEVY_EXCL_YMD").style(dateYMD));
valueMap.put("부과제외구분", format.of("LEVY_EXCL_SE_NM").style(center));
valueMap.put("부과제외사유", format.of("LEVY_EXCL_RSN_NM"));
valueMap.put("기타내용", format.of("ETC_CN"));
valueMap.put("민원신청번호", format.of("CVLCPT_APLY_NO").style(center));
valueMap.put("민원접수번호", format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원접수일자", FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("단속일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자구분", format.of("RTPYR_SE_NM").style(center));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("납부자명", format.of("RTPYR_NM"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM").style(center));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("상세단속장소", format.of("DTL_CRDN_PLC"));
valueMap.put("위반항목", format.of("VLTN_ARTCL"));
valueMap.put("단속금액", format.of("FFNLG_CRDN_AMT").style(numeric));
valueMap.put("처리상태", format.of("CRDN_STTS_NM"));
valueMap.put("단속특별구역", format.of("CRDN_SPAREA_NM").style(center));
valueMap.put("사용연료", format.of("USE_FUEL_NM").style(center));
valueMap.put("주차가능여부", format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("우편번호", format.of("ZIP").style(center));
valueMap.put("주소", format.of("ADDR"));
valueMap.put("상세주소", format.of("DTL_ADDR"));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("감액", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("감액").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("감액" + "_목록_" + dateTime + ".xlsx"));
}
}

File diff suppressed because it is too large Load Diff

@ -12,6 +12,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -19,13 +20,14 @@ import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.file.etc.OutsourcingFileWriter;
import cokr.xit.base.file.pdf.PDFWriter;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController;
@ -45,6 +47,8 @@ import cokr.xit.fims.cmmn.pdf.print.format.Nht;
import cokr.xit.fims.cmmn.service.bean.OtptStngBean;
import cokr.xit.fims.cmmn.service.bean.OutsourcingStngBean;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnListMapper;
@ -222,75 +226,70 @@ public class Sprt01Controller extends ApplicationController {
listForExcel = list;
}
XLSWriter xlsx = new XLSWriter()
.setFilename(fileName+".xlsx")
.worksheet(0);
CellStyle center = xlsx.cellStyle(Styler.CENTER);
CellStyle numeric = xlsx.n_nn0();
CellStyle dateYMD = xlsx.yyyy_mm_dd();
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
Map<String, Object> valueMap = new HashMap<String, Object>();
valueMap.put("시군구명" , xlsx.style("SGG_NM", center));
valueMap.put("과태료명" , xlsx.style("TASK_SE_NM", center));
valueMap.put("단속입력구분" , xlsx.style("CRDN_INPT_SE_NM", center));
valueMap.put("단속일시" , xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
valueMap.put("신고자명" , xlsx.style("CVLCPT_APLCNT_NM", center));
valueMap.put("민원접수번호" , xlsx.style("CVLCPT_RCPT_NO", center));
valueMap.put("민원접수일자" , xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
valueMap.put("민원목록번호" , xlsx.style("CVLCPT_LIST_NO", center));
valueMap.put("단속차량번호" , "VHRNO");
valueMap.put("대체차량번호" , "RPM_SZR_VHRNO");
valueMap.put("사진건수" , xlsx.style("ATCH_FILE_CNT", center));
valueMap.put("차량확인" , xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
valueMap.put("납부자명" , xlsx.style("RTPYR_NM", center));
valueMap.put("납부자번호" , xlsx.style("RTPYR_NO", center));
valueMap.put("처리상태" , xlsx.style("CRDN_STTS_NM", center));
valueMap.put("제외사유" , "LEVY_EXCL_RSN_NM");
valueMap.put("제외일자" , xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD));
valueMap.put("기타사항" , "ETC_CN");
valueMap.put("고지번호" , xlsx.style("GOJI_NO", center));
valueMap.put("처리일자" , xlsx.format(o -> xlsx.str2date(o.get("CRDN_STTS_CHG_YMD"))).style(dateYMD));
valueMap.put("단속장소" , "CRDN_PLC");
valueMap.put("단속구분" , xlsx.style("CRDN_SE_NM", center));
valueMap.put("의견진술여부" , xlsx.style("OPNN_SBMSN_YN_NM", center));
valueMap.put("의견진술기한" , xlsx.format(o -> xlsx.str2date(o.get("ADVNTCE_DUDT_YMD"))).style(dateYMD));
valueMap.put("견인여부" , xlsx.style("TOWNG_YN_NM", center));
valueMap.put("압류일자" , xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD"))).style(dateYMD));
valueMap.put("압류해제일자" , xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD"))).style(dateYMD));
valueMap.put("잔액" , xlsx.style("SUM_AMT", numeric));
valueMap.put("부과금액" , xlsx.style("LEVY_AMT", numeric));
valueMap.put("본세" , xlsx.style("LEVY_PCPTAX", numeric));
valueMap.put("가산금" , xlsx.style("LEVY_ADAMT", numeric));
valueMap.put("납부기한" , xlsx.format(o -> xlsx.str2date(o.get("DUDT_YMD"))).style(dateYMD));
valueMap.put("납기후일자" , xlsx.format(o -> xlsx.str2date(o.get("DUDT_AFTR_YMD"))).style(dateYMD));
valueMap.put("납기후금액" , xlsx.style("DUDT_AFTR_AMT", numeric));
valueMap.put("가상계좌번호" , xlsx.style("VR_ACTNO", center));
valueMap.put("전자납부번호" , xlsx.style("EPAYNO", center));
valueMap.put("수납유형" , xlsx.style("PAY_MTHD_SE_NM", center));
valueMap.put("수납일자" , xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD"))).style(dateYMD));
valueMap.put("수납금액" , xlsx.style("RCVMT_AMT", numeric));
valueMap.put("수납본세" , xlsx.style("RCVMT_PCPTAX", numeric));
valueMap.put("수납가산금" , xlsx.style("RCVMT_ADAMT", numeric));
valueMap.put("단속등록구분" , xlsx.style("CRDN_REG_SE_NM", center));
valueMap.put("납부자주소" , "RTPYR_FULL_ADDR");
valueMap.put("거주상태" , xlsx.style("RTPYR_STTS_NM", center));
valueMap.put("차량번호", "VHRNO");
valueMap.put("성명", "RTPYR_NM");
valueMap.put("주소", "RTPYR_ADDR");
valueMap.put("번지", "RTPYR_DTL_ADDR");
valueMap.put("시군구명" , format.of("SGG_NM").style(center));
valueMap.put("과태료명" , format.of("TASK_SE_NM").style(center));
valueMap.put("단속입력구분" , format.of("CRDN_INPT_SE_NM").style(center));
valueMap.put("단속일시" , FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "CRDN_YMD_TM").style(dateDT));
valueMap.put("신고자명" , format.of("CVLCPT_APLCNT_NM").style(center));
valueMap.put("민원접수번호" , format.of("CVLCPT_RCPT_NO").style(center));
valueMap.put("민원접수일자" , FormatMaker.yyyy_mm_dd(format, "CVLCPT_RCPT_YMD").style(dateYMD));
valueMap.put("민원목록번호" , format.of("CVLCPT_LIST_NO").style(center));
valueMap.put("단속차량번호" , format.of("VHRNO"));
valueMap.put("대체차량번호" , format.of("RPM_SZR_VHRNO"));
valueMap.put("사진건수" , format.of("ATCH_FILE_CNT").style(center));
valueMap.put("차량확인" , format.of("PARKNG_PSBLTY_RSLT_NM").style(center));
valueMap.put("납부자명" , format.of("RTPYR_NM").style(center));
valueMap.put("납부자번호" , format.of("RTPYR_NO").style(center));
valueMap.put("처리상태" , format.of("CRDN_STTS_NM").style(center));
valueMap.put("제외사유" , format.of("LEVY_EXCL_RSN_NM"));
valueMap.put("제외일자" , FormatMaker.yyyy_mm_dd(format, "LEVY_EXCL_YMD").style(dateYMD));
valueMap.put("기타사항" , format.of("ETC_CN"));
valueMap.put("고지번호" , format.of("GOJI_NO").style(center));
valueMap.put("처리일자" , FormatMaker.yyyy_mm_dd(format, "CRDN_STTS_CHG_YMD").style(dateYMD));
valueMap.put("단속장소" , format.of("CRDN_PLC"));
valueMap.put("단속구분" , format.of("CRDN_SE_NM").style(center));
valueMap.put("의견진술여부" , format.of("OPNN_SBMSN_YN_NM").style(center));
valueMap.put("의견진술기한" , FormatMaker.yyyy_mm_dd(format, "ADVNTCE_DUDT_YMD").style(dateYMD));
valueMap.put("견인여부" , format.of("TOWNG_YN_NM").style(center));
valueMap.put("압류일자" , FormatMaker.yyyy_mm_dd(format, "SZR_YMD").style(dateYMD));
valueMap.put("압류해제일자" , FormatMaker.yyyy_mm_dd(format, "SZR_RMV_YMD").style(dateYMD));
valueMap.put("잔액" , format.of("SUM_AMT").style(numeric));
valueMap.put("부과금액" , format.of("LEVY_AMT").style(numeric));
valueMap.put("본세" , format.of("LEVY_PCPTAX").style(numeric));
valueMap.put("가산금" , format.of("LEVY_ADAMT").style(numeric));
valueMap.put("납부기한" , FormatMaker.yyyy_mm_dd(format, "DUDT_YMD").style(dateYMD));
valueMap.put("납기후일자" , FormatMaker.yyyy_mm_dd(format, "DUDT_AFTR_YMD").style(dateYMD));
valueMap.put("납기후금액" , format.of("DUDT_AFTR_AMT").style(numeric));
valueMap.put("가상계좌번호" , format.of("VR_ACTNO").style(center));
valueMap.put("전자납부번호" , format.of("EPAYNO").style(center));
valueMap.put("수납유형" , format.of("PAY_MTHD_SE_NM").style(center));
valueMap.put("수납일자" , FormatMaker.yyyy_mm_dd(format, "RCVMT_YMD").style(dateYMD));
valueMap.put("수납금액" , format.of("RCVMT_AMT").style(numeric));
valueMap.put("수납본세" , format.of("RCVMT_PCPTAX").style(numeric));
valueMap.put("수납가산금" , format.of("RCVMT_ADAMT").style(numeric));
valueMap.put("단속등록구분" , format.of("CRDN_REG_SE_NM").style(center));
valueMap.put("납부자주소" , format.of("RTPYR_FULL_ADDR"));
valueMap.put("거주상태" , format.of("RTPYR_STTS_NM").style(center));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("성명", format.of("RTPYR_NM"));
valueMap.put("주소", format.of("RTPYR_ADDR"));
valueMap.put("번지", format.of("RTPYR_DTL_ADDR"));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value(fileName, center)
.merge(0, cellDefs.size()-1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(listForExcel, CellDef.values(cellDefs));
return new ModelAndView("xlsView").addObject("xls", xlsx)
xlsx.cell(0, 0).value(fileName).value(center).merge(0, cellDefs.size()-1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView").addObject("download", xlsx.getDownloadable().setFilename(fileName+".xlsx"))
.addObject("downloadData", listForExcel).addObject("dataNames", cellDefs.stream().map(CellDef::getLabel).toList());
}

@ -8,18 +8,22 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CellDef;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.docs.xls.CellDef;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.cmmn.xls.FormatMaker;
import cokr.xit.fims.cmmn.xls.StyleMaker;
import cokr.xit.fims.sprt.CvlcptDscsn;
import cokr.xit.fims.sprt.CvlcptDscsnQuery;
import cokr.xit.fims.sprt.service.CvlcptDscsnService;
@ -109,43 +113,38 @@ public class Sprt04Controller extends ApplicationController {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter()
.setFilename("민원상담" + "_목록_" + dateTime + ".xlsx")
.worksheet(0);
// CellStyle 지정은 여기에서..
CellStyle center = xlsx.cellStyle(Styler.CENTER); // 가운데 정렬
CellStyle dateYMD = xlsx.yyyy_mm_dd(); // 연월일
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss(); // 연월일+시간
XLSWriter xlsx = new XLSWriter().worksheet(0).trackWidth(CmmnUtil.intArray(cellDefs.size()));
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER));
CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT));
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
List<DataObject> list = cvlcptDscsnService.getCvlcptDscsnList(req.setFetchSize(0));
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("민원접수구분", xlsx.style("CVLCPT_RCPT_SE_NM", center));
valueMap.put("상담일자", xlsx.format(o -> xlsx.str2date(o.get("DSCSN_YMD"))).style(dateYMD));
valueMap.put("요일", xlsx.style("WEEK_NM", center));
valueMap.put("성명", xlsx.style("CVLPR_NM", center));
valueMap.put("연락처", xlsx.style("CVLPR_CTTPC", center));
valueMap.put("상담내용", "DSCSN_CN");
valueMap.put("차량번호", "VHRNO");
valueMap.put("납부자번호", xlsx.style("RTPYR_NO", center));
valueMap.put("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT));
valueMap.put("등록사용자", xlsx.style("RGTR_NM", center));
valueMap.put("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT));
valueMap.put("수정사용자", xlsx.style("MDFR_NM", center));
valueMap.put("민원접수구분", format.of("CVLCPT_RCPT_SE_NM").style(center));
valueMap.put("상담일자", FormatMaker.yyyy_mm_dd(format, "DSCSN_YMD").style(dateYMD));
valueMap.put("요일", format.of("WEEK_NM").style(center));
valueMap.put("성명", format.of("CVLPR_NM").style(center));
valueMap.put("연락처", format.of("CVLPR_CTTPC").style(center));
valueMap.put("상담내용", format.of("DSCSN_CN"));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("납부자번호", format.of("RTPYR_NO").style(center));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0)
.value("민원상담", center)
.merge(0, cellDefs.size() - 1)
.cell(3, 0)
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
.cell(4, 0)
.values(list, CellDef.values(cellDefs));
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
xlsx.cell(0, 0).value("민원상담").value(center).merge(0, cellDefs.size() - 1)
.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()));
xlsx.autoWidth();
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("민원상담" + "_목록_" + dateTime + ".xlsx"));
}
}

Loading…
Cancel
Save