diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java index fa7f4156..b69af6bf 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java @@ -280,6 +280,26 @@ public class Advntce extends PDFFormat { return result; } + + @Override + public List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, + DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { + List result = new ArrayList(); + + switch(otptArtclNm) { + case "crdnPhoto" -> { + int i = 1; + while(!dataObject.string("CRDN_PHOTO"+i).equals("")) { + result.add(dataObject.string("CRDN_PHOTO"+i)); + i++; + } + } + } + + return result; + } + + /** * 출력용 샘플 데이터를 생성한다. */ @@ -323,23 +343,4 @@ public class Advntce extends PDFFormat { return dataObject; } - - @Override - public List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { - List result = new ArrayList(); - - switch(otptArtclNm) { - case "crdnPhoto" -> { - int i = 1; - while(!dataObject.string("CRDN_PHOTO"+i).equals("")) { - result.add(dataObject.string("CRDN_PHOTO"+i)); - i++; - } - } - } - - return result; - } - } diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java new file mode 100644 index 00000000..82ce10d5 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java @@ -0,0 +1,341 @@ +package cokr.xit.fims.cmmn.pdf.format; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import cokr.xit.fims.cmmn.CmmnUtil; +import cokr.xit.fims.cmmn.FactionUtil; +import cokr.xit.fims.cmmn.pdf.PDFFormat; +import cokr.xit.fims.cmmn.pdf.PDFPrintUtil; +import cokr.xit.fims.sprt.PrintOption; +import cokr.xit.foundation.data.DataFormat; +import cokr.xit.foundation.data.DataObject; + +public class Nht extends PDFFormat { + + public Nht() { + addForPost( + image("postSenderLogo","우편물송신자로고","").a4(10, 0).letter(10, 0).size(0, 0), + text("postSenderInst","우편물송신자기관","").a4(10, 5).letter(10, 5), + text("postSenderDept","우편물송신자부서","").a4(50, 5).letter(50, 5), + text("postSenderAddr","우편물송신자주소","").a4(10, 15).letter(10, 15), + text("postSenderDtlAddr","우편물송신자상세주소","").a4(10, 25).letter(10, 25), + text("postSenderZip","우편물송신자우편번호","").a4(10, 35).letter(10, 35), + text("postSenderTel","우편물송신자전화번호","").a4(10, 45).letter(10, 45), + text("postSenderFax","우편물송신자팩스번호","").a4(50, 45).letter(50, 45), + + text("postReceiverAddr","우편물수신자주소","").a4(100, 40).letter(100, 40).size(90, 0).align("right"), + text("postReceiverDtlAddr","우편물수신자상세주소","").a4(100, 50).letter(100, 50).size(90, 0).align("right"), + text("postReceiver","우편물수신자명","").a4(100, 60).letter(100, 60).size(90, 0).align("right"), + text("postReceiverZip","우편물수신자우편번호","").a4(100, 70).letter(100, 70).size(90, 0).align("right") + ); + + add( + image("background","배경이미지","").a4(0, 0).letter(0, 0).size(0, 0), + images("crdnPhoto","단속사진","").a4(110, 100).letter(116, 95).size(90, 80), + image("rprsCrdnPhoto","대표단속사진","").a4(10, 200).letter(10, 186).size(80, 80), + + text("rtpyrNm","수신자명",""), + text("rtpyrNo","수신자번호",""), + text("rtpyrAddr","수신자주소",""), + text("rtpyrDtlAddr","수신자상세주소",""), + text("rtpyrFullAddr","수신자전체주소",""), + + text("vhrno","차량번호",""), + text("crdnYmd","단속일자",""), + text("crdnYmdTm","단속일시",""), + text("crdnPlc","단속장소",""), + text("ffnlgCarmdlNm","차종",""), + text("vltnArtcl","위반내용",""), + text("vltnLawNm","위반법령",""), + text("crdnSn","증거번호",""), + text("ffnlgCrdnAmt","최초금액",""), + + text("advntceAmt","사전통지금액",""), + text("advntceDudtYmd","납부기한",""), + + text("vrActno","대표가상계좌번호",""), + text("vrActno1","가상계좌번호1",""), + text("vrActno2","가상계좌번호2",""), + text("vrActno3","가상계좌번호3",""), + text("vrActno4","가상계좌번호4",""), + text("vrActno5","가상계좌번호5",""), + text("vrActno6","가상계좌번호6",""), + text("vrActno7","가상계좌번호7",""), + text("vrActno8","가상계좌번호8",""), + text("vrActno9","가상계좌번호9",""), + text("vrActno10","가상계좌번호10",""), + text("epayNo","전자납부번호",""), + + text("otptYmd","출력일자",""), + text("otptDt","출력일시",""), + text("otptYYYY","출력년도",""), + text("otptMM","출력월",""), + text("otptDD","출력일",""), + + text("offcsText","관인명",""), + image("offcs","관인이미지","").size(20, 20), + + text("undefined","(미정)","미정항목") + ); + } + + /** + * 출력요소에 매핑될 값을 반환한다. + */ + @Override + public String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost, + DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { + + String result = ""; + if(forPost) { + return this.getValueForPost(otptArtclNm, defaultValue, dataObject, printOption, pdfPrintUtil); + } + + Map globalVariable = printOption.getGlobalVariable(); + + switch(otptArtclNm) { + case "background" -> { + if(globalVariable.get("bcrnImgPath") != null) { + result = globalVariable.get("bcrnImgPath"); + } + } + case "rprsCrdnPhoto" -> { //대표사진 + result = dataObject.string("CRDN_PHOTO1"); + } + case "rtpyrNm" -> { + result = dataObject.string("RTPYR_NM"); + } + case "rtpyrNo" -> { + result = dataObject.string("RTPYR_NO"); + } + case "rtpyrAddr" -> { + result = dataObject.string("RTPYR_ADDR"); + } + case "rtpyrDtlAddr" -> { + result = dataObject.string("RTPYR_DTL_ADDR"); + } + case "rtpyrFullAddr" -> { + result = dataObject.string("RTPYR_FULL_ADDR"); + } + case "rtpyrZip" -> { + result = dataObject.string("RTPYR_ZIP"); + } + case "vhrno" -> { + result = dataObject.string("VHRNO"); + } + case "crdnYmd" -> { + result = DataFormat.yyyy_mm_dd(dataObject.string("CRDN_YMD")); + } + case "crdnYmdTm" -> { + result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM")); + } + case "crdnPlc" -> { + result = dataObject.string("CRDN_PLC"); + } + case "ffnlgCarmdlNm" -> { + result = dataObject.string("FFNLG_CARMDL_NM"); + } + case "vltnArtcl" -> { + result = dataObject.string("VLTN_ARTCL"); + } + case "vltnLawNm" -> { + result = dataObject.string("VLTN_LAW_NM"); + } + case "crdnSn" -> { + result = dataObject.string("CRDN_SN"); + } + case "ffnlgCrdnAmt" -> { + result = dataObject.string("FFNLG_CRDN_AMT"); + } + case "advntceAmt" -> { + result = CmmnUtil.addCommaToNumber(dataObject.string("ADVNTCE_AMT")); + } + case "advntceDudtYmd" -> { + result = DataFormat.yyyy_mm_dd(dataObject.string("ADVNTCE_DUDT_YMD")); + } + + case "vrActno" -> { + result = dataObject.string("VR_ACTNO"); + } + case "vrActno1" -> { + result = dataObject.string("VR_ACTNO1"); + } + case "vrActno2" -> { + result = dataObject.string("VR_ACTNO2"); + } + case "vrActno3" -> { + result = dataObject.string("VR_ACTNO3"); + } + case "vrActno4" -> { + result = dataObject.string("VR_ACTNO4"); + } + case "vrActno5" -> { + result = dataObject.string("VR_ACTNO5"); + } + case "vrActno6" -> { + result = dataObject.string("VR_ACTNO6"); + } + case "vrActno7" -> { + result = dataObject.string("VR_ACTNO7"); + } + case "vrActno8" -> { + result = dataObject.string("VR_ACTNO8"); + } + case "vrActno9" -> { + result = dataObject.string("VR_ACTNO9"); + } + case "vrActno10" -> { + result = dataObject.string("VR_ACTNO10"); + } + case "epayNo" -> { + result = dataObject.string("EPAY_NO"); + } + + case "otptYmd" -> { + result = DataFormat.yyyy_mm_dd(pdfPrintUtil.getPrintRequestDt().substring(0,8)); + } + case "otptDt" -> { + result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(pdfPrintUtil.getPrintRequestDt()); + } + case "otptYYYY" -> { + result = pdfPrintUtil.getPrintRequestDt().substring(0,4); + } + case "otptMM" -> { + result = pdfPrintUtil.getPrintRequestDt().substring(4,6); + } + case "otptDD" -> { + result = pdfPrintUtil.getPrintRequestDt().substring(6,8); + } + + case "offcsText" -> { + String instNm = (String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm"); + instNm = FactionUtil.getLastWord(instNm); + instNm = FactionUtil.getInstituteLeader(instNm, true); + result = instNm; + } + case "offcs" -> { + result = globalVariable.get("offcsFilePath"); + } + + case "undefined" -> { + result = defaultValue; + } + } + + return result; + } + + /** + * 우편물 출력요소에 매핑될 값을 반환한다. + */ + @Override + public String getValueForPost(String otptArtclNm, String defaultValue, + DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { + String result = ""; + + switch(otptArtclNm) { + case "postReceiverAddr" -> { + result = dataObject.string("RTPYR_ADDR"); + } + case "postReceiverDtlAddr" -> { + result = dataObject.string("RTPYR_DTL_ADDR"); + } + case "postReceiverZip" -> { + result = dataObject.string("RTPYR_ZIP"); + } + case "postReceiver" -> { + result = dataObject.string("RTPYR_NM"); + } + case "postSenderLogo" -> { + result = printOption.getGlobalVariable().get("logoFilePath"); + } + case "postSenderInst" -> { + result = (String)pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm"); + } + case "postSenderDept" -> { + result = (String)pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("deptNm"); + } + case "postSenderAddr" -> { + result = printOption.getGlobalVariable().get("instAddr"); + } + case "postSenderDtlAddr" -> { + result = printOption.getGlobalVariable().get("instDaddr"); + } + case "postSenderZip" -> { + result = printOption.getGlobalVariable().get("instZip"); + } + case "postSenderTel" -> { + result = printOption.getGlobalVariable().get("deptTelno"); + } + case "postSenderFax" -> { + result = printOption.getGlobalVariable().get("deptFxno"); + } + + } + return result; + } + + @Override + public List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, + DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { + List result = new ArrayList(); + + switch(otptArtclNm) { + case "crdnPhoto" -> { + int i = 1; + while(!dataObject.string("CRDN_PHOTO"+i).equals("")) { + result.add(dataObject.string("CRDN_PHOTO"+i)); + i++; + } + } + } + + return result; + } + + /** + * 출력용 샘플 데이터를 생성한다. + */ + @Override + public DataObject createSampleData() { + DataObject dataObject = new DataObject(); + dataObject.put("RTPYR_NM", "홍길동"); + dataObject.put("RTPYR_ADDR", "무슨도 무슨시 무슨구"); + dataObject.put("RTPYR_DTL_ADDR", "ㅇㅇ아파트 999호"); + dataObject.put("RTPYR_FULL_ADDR", "무슨도 무슨시 무슨구 ㅇㅇ아파트 999호"); + dataObject.put("RTPYR_ZIP", "12345"); + dataObject.put("VHRNO", "00가0000"); + dataObject.put("CRDN_YMD", "20231204"); + dataObject.put("CRDN_YMD_TM", "20231204080808"); + dataObject.put("CRDN_PLC", "사거리 건너편"); + dataObject.put("FFNLG_CARMDL_NM", "승용"); + dataObject.put("VLTN_ARTCL", "주차위반"); + dataObject.put("VLTN_LAW_NM", "00법 제0조 제0항"); + dataObject.put("CRDN_SN", "1234567890"); + dataObject.put("VR_ACTNO", "000000-00-000000"); + dataObject.put("VR_ACTNO1", "111111-00-000000"); + dataObject.put("VR_ACTNO2", "222222-00-000000"); + dataObject.put("VR_ACTNO3", "333333-00-000000"); + dataObject.put("VR_ACTNO4", "444444-00-000000"); + dataObject.put("VR_ACTNO5", "555555-00-000000"); + dataObject.put("VR_ACTNO6", "666666-00-000000"); + dataObject.put("VR_ACTNO7", "777777-00-000000"); + dataObject.put("VR_ACTNO8", "888888-00-000000"); + dataObject.put("VR_ACTNO9", "999999-00-000000"); + dataObject.put("VR_ACTNO10", "101010-00-000000"); + dataObject.put("EPAY_NO", "00000-0-00-00-000000000"); + dataObject.put("FFNLG_CRDN_AMT", "100000"); + + dataObject.put("CRDN_PHOTO1", "samplefiles/crdn1.png"); + dataObject.put("CRDN_PHOTO2", "samplefiles/crdn2.png"); + dataObject.put("CRDN_PHOTO3", "samplefiles/crdn3.png"); + dataObject.put("CRDN_PHOTO4", "samplefiles/crdn4.png"); + dataObject.put("CRDN_PHOTO5", "samplefiles/crdn5.png"); + dataObject.put("CRDN_PHOTO6", "samplefiles/crdn6.png"); + dataObject.put("CRDN_PHOTO7", "samplefiles/crdn7.png"); + + return dataObject; + } +} diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java index 352edb7a..15f174b9 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java @@ -35,6 +35,7 @@ import cokr.xit.fims.cmmn.pdf.PDFFormat; import cokr.xit.fims.cmmn.pdf.PDFPrintUtil; import cokr.xit.fims.cmmn.pdf.PstnAndSize; import cokr.xit.fims.cmmn.pdf.format.Advntce; +import cokr.xit.fims.cmmn.pdf.format.Nht; import cokr.xit.fims.cmmn.service.bean.FactionBean; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.crdn.Crdn; @@ -275,10 +276,14 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv PDFFormat pdfFormat = null; if(formatName.equals("advntce")) { pdfFormat = new Advntce(); + } else if(formatName.equals("nht")) { + pdfFormat = new Nht(); } String sndngSeCd = ""; if(formatName.equals("advntce")) { sndngSeCd = "02"; + } else if(formatName.equals("nht")) { + sndngSeCd = "03"; } String paperSeCd = printOption.getPaperSeCd(); diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 79662731..7425d937 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -61,6 +61,9 @@ public class Sprt01Controller extends ApplicationController { printAdvntceMain = "/140/info.do", makeAdvntcePdf = "/140/makeAdvntcePdf.do", makeAdvntceOutsourcing = "/140/makeAdvntceOutsourcing.do", + printNhtMain = "/150/info.do", + makeNhtPdf = "/150/makeNhtPdf.do", + makeNhtOutsourcing = "/150/makeNhtOutsourcing.do", otptStngMain = "/200/main.do", getOtptStngInfo = "/200/info.do", @@ -423,6 +426,43 @@ public class Sprt01Controller extends ApplicationController { return mav; } + + /**고지서 출력 화면을 연다. + * + * @return /fims/sprt/sprt01150 + */ + public ModelAndView printNhtMain(String... crdnIds) { + ModelAndView mav = new ModelAndView("fims/sprt/sprt01150-info"); + mav.addObject("pageName", "sprt01150-info"); + mav.addObject("crdnIds", toJson(crdnIds)); + + return mav; + } + + /** 고지서를 PDF 파일로 작성한다. + * @return 고지서 PDF파일 + */ + public ModelAndView makeNhtPdf(PrintOption printOption, String[] crdnIds) { + ModelAndView mav = new ModelAndView("jsonView"); + + Map result = sprt01Service.makePdfFile("info", "nht", printOption, crdnIds); + mav.addAllObjects(result); + + return mav; + } + + /** 고지 정보로 txt파일,이미지파일을 생성하고 압축파일로 반환한다. + * @return 고지서 압축파일 + */ + public ModelAndView makeNhtOutsourcing(PrintOption printOption, String[] crdnIds) { + ModelAndView mav = new ModelAndView("jsonView"); + + Map result = sprt01Service.makeOutsourcingFile("nht", printOption, crdnIds); + mav.addAllObjects(result); + + return mav; + } + /** 출력물 설정 메인 화면을 연다. * @return 출력물 설정 메인 화면 */ diff --git a/src/main/java/cokr/xit/fims/task/web/CmnController.java b/src/main/java/cokr/xit/fims/task/web/CmnController.java index 5fd024cb..35fb046a 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -434,6 +434,24 @@ public class CmnController { return super.makeAdvntceOutsourcing(printOption, crdnIds); } + @Override + @RequestMapping(name="고지서 출력 화면", value=METHOD_URL.printNhtMain) + public ModelAndView printNhtMain(String... crdnIds) { + return super.printNhtMain(crdnIds); + } + + @Override + @RequestMapping(name="고지서 pdf 파일 생성", value=METHOD_URL.makeNhtPdf) + public ModelAndView makeNhtPdf(PrintOption printOption, String... crdnIds) { + return super.makeNhtPdf(printOption, crdnIds); + } + + @Override + @RequestMapping(name="고지서 외주 파일 생성", value=METHOD_URL.makeNhtOutsourcing) + public ModelAndView makeNhtOutsourcing(PrintOption printOption, String... crdnIds) { + return super.makeNhtOutsourcing(printOption, crdnIds); + } + @Override @RequestMapping(name="출력물 설정 메인 화면", value=METHOD_URL.otptStngMain) public ModelAndView otptStngMain() { diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp index 28a44f33..b2448dd8 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp @@ -570,6 +570,61 @@ integrationSearch.fnPrintAdvntce = () => { } +//고지서 +integrationSearch.fnPrintNht = () => { + + var upDataset = integrationSearchControl.updataset; + + if(upDataset.length <= 0){ + dialog.alert("출력할 자료가 없습니다."); + return; + } + + var upArr = upDataset.getDataset(); + + var crdnIds = Object.keys(Object.groupBy(upArr, ({ CRDN_ID }) => CRDN_ID)); + + var url = wctx.url("/sprt/sprt01/150/info.do"); + + var dialogId = "printNhtDialog"; + + ajax.get({ + url : url + , data : { crdnIds : crdnIds.join(",") } + , success : resp => { + dialog.open({ + id : dialogId + , title : "종합조회-고지서" + , size : "xl" + , content : resp + , init : () => { + + $("#"+dialogId).find("input[name='dialogId']").val(dialogId); + var found = $("#"+dialogId).find("template")[0].innerHTML; + var trs = upDataset.inStrings(found, null); + $("#"+dialogId).find("tbody").html(trs.join()); + + + var parentRes = new Object(); + var childReq = pageObject.childReq.pop(); + + for(var reqKey in childReq) { + if(integrationSearch.provide[reqKey]){ + parentRes[reqKey] = integrationSearch.provide[reqKey]; + } else { + parentRes[reqKey] = function(){}; + } + } + + pageObject.parentRes.push(parentRes); + } + , onClose : () => { } + }); + } + }); + +} + //개별총정보 dialog integrationSearch.getInfo = (taskSeCd, crdnId) => { if (crdnId == undefined || crdnId == null || crdnId == "") { @@ -661,6 +716,7 @@ integrationSearch.setEvent = () => { $("#btnDownPrintRcvmtConfirm--${pageName}").on("click", function(){ integrationSearch.fnPrintRcvmtConfirm(); }); $("#btnUpPrintAdvntce--${pageName}").on("click", function(){ integrationSearch.fnPrintAdvntce(); }); + $("#btnPrintNht--${pageName}").on("click", function(){ integrationSearch.fnPrintNht(); }); //$("#btn").on("click", function(){ }); diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01011-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01011-info.jsp index da403187..18e2abe7 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01011-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01011-info.jsp @@ -19,8 +19,8 @@ title="단속 내역서/확인서"> 단속 내역서/확인서 - + + + + + + + +
+ +
+ +
+ + +
+ + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp index 3ce18aaf..59fe117c 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp @@ -19,6 +19,7 @@ 출력물 용지