diff --git a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index 38ddc998..be3a4516 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -72,6 +72,8 @@ public class Sndb01Controller extends ApplicationController { , sendBackMain = "/230/main.do" // 반송 현황 메인 화면 , getSendBackList = "/230/list.do" // 반송 현황 목록 조회 + , serviceByPublicNoticeMain = "/240/main.do" // 공시송달 현황 메인 화면 + , getServiceByPublicNoticeList = "/240/list.do" // 공시송달 현황 목록 조회 @@ -81,8 +83,6 @@ public class Sndb01Controller extends ApplicationController { , updateSendBack = "/220/update.do" // 반송 수정 , deleteSendBack = "/210/delete.do" // 반송 삭제 - , serviceByPublicNoticeMain = "/240/main.do" // 공시송달 현황 메인 화면 - , getServiceByPublicNoticeList = "/240/list.do" // 공시송달 현황 목록 조회 , createServiceByPublicNotice = "/240/create.do" // 공시송달 등록 , updateServiceByPublicNotice = "/240/update.do" // 공시송달 수정 , removeServiceByPublicNotice = "/240/remove.do" // 공시송달 삭제 @@ -1286,9 +1286,54 @@ public class Sndb01Controller extends ApplicationController { * } */ public ModelAndView getServiceByPublicNoticeList(SndbQuery req) { - List result = sndngDtlService.getSvbtcList(setFetchSize(req)); + if (!"xls".equals(req.getDownload())) { + List result = sndngDtlService.getSvbtcList(setFetchSize(req)); + return setCollectionInfo(new ModelAndView("jsonView"), result, "svbtc"); + } else { + // 현재 날짜 구하기 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + String dateTime = dateFormat.format(System.currentTimeMillis()); - return setCollectionInfo(new ModelAndView("jsonView"), result, "svbtc"); + ArrayList cellDefs = fromJson(req.getCellDefs(), new TypeReference>() {}); + + 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(); // 연월일+시간 + + List list = sndngDtlService.getSvbtcList(req.setFetchSize(0)); + + CellDef.setValues(cellDefs, Map.ofEntries( + Map.entry("업무구분", xlsx.style("TASK_SE_NM", center)) + , Map.entry("발송구분", xlsx.style("SNDNG_SE_NM", center)) + , Map.entry("공시송달일자", xlsx.format(o -> xlsx.str2date(o.get("SVBTC_YMD"))).style(dateYMD)) + , Map.entry("총건수", xlsx.style("TNOCS", numeric)) + , Map.entry("문서번호", "DOC_NO") + , Map.entry("제목", "TTL_NM") + , Map.entry("기타내용", "ETC_CN") + , Map.entry("등록일시", xlsx.format(o -> xlsx.str2datetime(o.get("REG_DT"))).style(dateDT)) + , Map.entry("등록사용자", xlsx.style("RGTR_NM", center)) + , Map.entry("수정일시", xlsx.format(o -> xlsx.str2datetime(o.get("MDFCN_DT"))).style(dateDT)) + , Map.entry("수정사용자", xlsx.style("MDFR_NM", center)) + ) + ); + + 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); + } } /**공시송달 발송 현황 - 세부내용 정보 화면(sndb/sndb01/250-info)을 연다. diff --git a/src/main/resources/sql/mapper/fims/sndb/sndngDtl-mapper.xml b/src/main/resources/sql/mapper/fims/sndb/sndngDtl-mapper.xml index 4f9eba36..53a3ff60 100644 --- a/src/main/resources/sql/mapper/fims/sndb/sndngDtl-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sndb/sndngDtl-mapper.xml @@ -800,19 +800,27 @@ - S.TASK_SE_CD - S.SNDNG_REG_SE_CD - S.SNDNG_SE_CD - S.LEVY_BGNG_YMD - S.LEVY_END_YMD - S.SNDNG_YMD - S.DUDT_YMD - S.TTL_NM - S.DOC_NO - S.ETC_CN - S.TNOCS - S.GRAMT - S.SNDNG_STTS_CD + SD.RG_NO + SD.DLVR_YMD + SD.DLVR_TM + SD.UNDLVR_RSN_NM + SD.ACTL_RCPN_NM + SD.RCPN_REL_NM + SD.SNDNG_SE_CD + SD.SNDNG_YMD + SD.FFNLG_AMT + SD.RCPN_NM + SD.RCPN_ZIP + SD.RCPN_ADDR + SD.RCPN_DTL_ADDR + C.CRDN_YMD + C.VHRNO + P.RTPYR_SE_CD + P.RTPYR_NO + P.RTPYR_NM + C.CRDN_STDG_NM + C.CRDN_PLC + C.CRDN_STTS_CD #{term} diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01230-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01230-main.jsp index c8a3d872..ccb86288 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01230-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01230-main.jsp @@ -183,7 +183,7 @@