From ab56a9f1c405eab2cb2630912351591fb4b4681c Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Tue, 12 Dec 2023 13:43:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=91=EC=85=80=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C,=20MapperSupport=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/excl/web/Excl01Controller.java | 47 ++++++++++++++++-- src/main/resources/logback-spring.xml | 2 +- src/main/resources/sql/mybatis-config.xml | 2 +- .../template/xls/excl-list-tmpl.xlsx | Bin 0 -> 9426 bytes .../WEB-INF/jsp/fims/excl/excl01010-main.jsp | 4 +- src/main/webapp/resources/js/base/dataset.js | 8 +++ 6 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/template/xls/excl-list-tmpl.xlsx diff --git a/src/main/java/cokr/xit/fims/excl/web/Excl01Controller.java b/src/main/java/cokr/xit/fims/excl/web/Excl01Controller.java index 2bf6c336..edb8b604 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl01Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl01Controller.java @@ -5,9 +5,13 @@ import java.util.Map; import javax.annotation.Resource; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.code.CommonCode; +import cokr.xit.base.file.xls.XLSWriter; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.excl.LevyExcl; @@ -82,9 +86,46 @@ public class Excl01Controller extends ApplicationController { * } */ public ModelAndView getLevyExclusionList(LevyExclQuery req) { - List result = levyExclService.getLevyExclList(setFetchSize(req)); - - return setCollectionInfo(new ModelAndView("jsonView"), result, "levyExcl"); + if (!"xls".equals(req.getDownload())) { + List result = levyExclService.getLevyExclList(setFetchSize(req)); + return setCollectionInfo(new ModelAndView("jsonView"), result, "levyExcl"); + } else { + XLSWriter xlsx = new XLSWriter() + .setFilename("부과제외 목록.xlsx") + .worksheet(0); + + CellStyle + header = xlsx.cellStyle(new XLSWriter.Styler() + .width(20) + .foregroundColor(HSSFColor.HSSFColorPredefined.LIGHT_BLUE.getIndex()) + .configure(styler -> { + Font font = xlsx.workbook().createFont(); + font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + styler.font(font); + }) + ), + numeric = xlsx.n_nn0(); + + xlsx.cell(0, 0) + .value("부과제외 목록", XLSWriter.Styler.CENTER) + .merge(0, 15) + .cell(3, 0) + .rowValues(List.of( + "업무구분", header, "부과제외일자", header, "부과제외구분", header, "부과제외사유", header, "기타내용", header, + "민원신청번호", header, "민원접수번호", header, "민원접수일자", header, "단속일시", header, "차량번호", header, + "법정동", header, "단속장소", header, "과태료금액", header, "처리상태", header, "납부자명", header, "납부자생일", header + )) + .cell(4, 0) + .values( + levyExclService.getLevyExclList(req.setFetchSize(0)), + "TASK_SE_NM", xlsx.format(r -> xlsx.str2date(r.get("LEVY_EXCL_YMD"))), "LEVY_EXCL_SE_NM", "LEVY_EXCL_RSN_NM", "ETC_CN", + "CVLCPT_APLY_NO", "CVLCPT_RCPT_NO", xlsx.format(r -> xlsx.str2date(r.get("CVLCPT_RCPT_YMD"))), xlsx.format(r -> xlsx.str2date(r.get("CRDN_YMD")) + " " + xlsx.str2time(r.get("CRDN_TM"))), + "VHRNO", "CRDN_STDG_NM", "CRDN_PLC", xlsx.style("FFNLG_AMT", numeric), "CRDN_STTS_NM", "RTPYR_NM", xlsx.format(r -> xlsx.str2date(r.get("RTPYR_BRDT"))) + ); + + return new ModelAndView("xlsView") + .addObject("xls", xlsx); + } } /**지정한 ID의 부과제외 정보(info)를 반환한다. diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 9f5f4d9f..fd7a1c5c 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -62,9 +62,9 @@ + - diff --git a/src/main/resources/sql/mybatis-config.xml b/src/main/resources/sql/mybatis-config.xml index f2b44261..44b31575 100644 --- a/src/main/resources/sql/mybatis-config.xml +++ b/src/main/resources/sql/mybatis-config.xml @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/template/xls/excl-list-tmpl.xlsx b/src/main/resources/template/xls/excl-list-tmpl.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..7650fbc31c3d5eae8217ed6adb7065597ca70c92 GIT binary patch literal 9426 zcmeHNg;$hY_Z|ruO1eS1(*fxmx{(e6=?-b62L+@>Qo2D(y1NmOZWvM|hi>IJ`o+E1 z`~Cic?>n>Bd)BOZpS|WiXFvPdXYW@{5fKR=@DKn5007hg)5COYqXz&$ED`{K2LK`% zNIE&XSva~GYkE6dxEgYJIoMO>AR#bi0TAH#|8M*kuRv-1XO(U)Z0Sq6JIPIUg{3NS z;L`(0KQ7BN(T<+?eILyXGHh(_Gv3}}gR=>2`6_Y0Ect+rN35$H9qJ%qea-3^5kUhT zT1I4ioW1?~^zB3>aW49Luq=Es@h2q4#!;53faI6;-ReA2YZ3~jq}Bw4qJbOf3;o(S z(7r~DkNQOd1B;!jD%vYJ{6oc)*c;<`Q?@qDK1Qb-?D9wvG(Jm&9!B|U)VdnXrs|C@ zH%W?Zu1pQw(=W^rR=7f9TOTctLLWA_@jX`NA+0J7Kl`ZP7i-7b?)%*LRXbC3#F^Sn z6EA_aF}p#Acn~#YVh*5Y7g0l426Fu3*CR%dtMvJ(i)#6nehrVj2TEq%lo1nau0l-X zz_yy-pCP3xz{djdFB}+b;O|g9FeCSMEEq@GM3TO`$G^bYX*%ryV-I#v)A@xStPbo5 z`RtEv83Z35C+-A*emn#K?(Y!+YJZ_+tri#U8Qj;D;H*Q3)6&?*!rqmW7Oeqcw)5 zq@gHVaS%!?GkGjkiT#B`hZGerpFD(6Bqd0{Pg!rp^s4;9G+5)HEa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PJgvxHlQEQd90{VPDK5 zCY8;q2~9yO1onc1dJk1@CmP&4%e9F@8QBzzo)?#Ts(oUo^I*Xe4U;~5Ktn1=BHf_* ziS)@ZziLy6Og`#hbo@}i40Y|x5kD;w%xxnm?`kaN*7cK6ObBbXFh;XDFWspA9dvAB zFPhV^qAn;fpC7%Gv@F(V`I3Z53DH3q9sk z@uS(G2Bc|rhioM!^%{OViQE`HkeIcDEZc24t{XqHofgj!wTXLO_KqDHuFSPtz~$ZP zmq}RYws8#Py#?{*)|^QB2&2FOrsh6bbKrwFul)uRB+z#ZYSnP=JB2B@FEJ301FK6P zIP<#>&l-PFdG%i8Qd!MWv8(*XbV<1hjWwVg+la794F9vfG}8{I2Ran9hyDPxz+rC0 zS|4)KdusG8mqbnR zuLl0w=l&P)=bQwm$)CF3zXN~o{rv%Lfp-Ic>jeG|{%il^4=4a|j`|Dy|8zrsxAS{Z z{0~b^82|nge=CvyZsqsF+aFfYuzy+ky$tuef!_}de;9aA^vl2>$A{mczb7z%Kt;*^ z0sTFl`Q5@_mGloh0B}hT0Q^l?e~14yD*hR6OZg}GKVzhtA~Jk;0RS}kClD^(!Zbg> F{U0#CRqg-) literal 0 HcmV?d00001 diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp index c9bc6792..9552868a 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp @@ -533,9 +533,7 @@ } // 엑셀 버튼 이벤트 - fnExcel${pageName} = () => { - - } + fnExcel${pageName} = () => ${pageName}Control.download(); // 사용자 조회 버튼 이벤트 fnFindUser${pageName} = () => { diff --git a/src/main/webapp/resources/js/base/dataset.js b/src/main/webapp/resources/js/base/dataset.js index 10ae2aa4..b57068dd 100644 --- a/src/main/webapp/resources/js/base/dataset.js +++ b/src/main/webapp/resources/js/base/dataset.js @@ -1274,6 +1274,7 @@ class DatasetControl { _load() { if (!this.query.pageNum) this.query.pageNum = 1; + ajax.get({ url:this.urls.load, data:this.query, @@ -1286,6 +1287,13 @@ class DatasetControl { } }); } + + download(type) { + this.query.download = type || "xls"; + let query = toQuery(this.query); + this.query.download = null; + document.location.href = this.urls.load + "?" + query; + } setData(obj) { this.dataset.setData(obj);