From 0beaddf61414431d919d65118b53d329ce6f1e5f Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 9 Jan 2024 11:16:46 +0900 Subject: [PATCH] =?UTF-8?q?pdf=EA=B4=80=EB=A0=A8=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/cmmn/dao/LinkMapper.java | 23 ++++ .../xit/fims/cmmn/pdf/PDFExtractFormat.java | 5 + .../{PDFFormat.java => PDFPrintFormat.java} | 2 +- .../pdf/extrationFormat/ElectronicNotice.java | 10 ++ .../pdf/{format => printFormat}/Advntce.java | 6 +- .../cmmn/pdf/{format => printFormat}/Nht.java | 6 +- .../xit/fims/cmmn/service/bean/LinkBean.java | 41 +++++++ .../bean/IntegrationSearchServiceBean.java | 8 +- .../fims/sprt/service/bean/OtptStngBean.java | 8 +- .../sql/mapper/fims/cmmn/link-mapper.xml | 103 ++++++++++++++++++ src/main/webapp/WEB-INF/jsp/include/top.jsp | 27 +++++ 11 files changed, 224 insertions(+), 15 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/cmmn/dao/LinkMapper.java create mode 100644 src/main/java/cokr/xit/fims/cmmn/pdf/PDFExtractFormat.java rename src/main/java/cokr/xit/fims/cmmn/pdf/{PDFFormat.java => PDFPrintFormat.java} (98%) create mode 100644 src/main/java/cokr/xit/fims/cmmn/pdf/extrationFormat/ElectronicNotice.java rename src/main/java/cokr/xit/fims/cmmn/pdf/{format => printFormat}/Advntce.java (98%) rename src/main/java/cokr/xit/fims/cmmn/pdf/{format => printFormat}/Nht.java (99%) create mode 100644 src/main/java/cokr/xit/fims/cmmn/service/bean/LinkBean.java create mode 100644 src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/LinkMapper.java b/src/main/java/cokr/xit/fims/cmmn/dao/LinkMapper.java new file mode 100644 index 00000000..eec5b003 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/dao/LinkMapper.java @@ -0,0 +1,23 @@ +package cokr.xit.fims.cmmn.dao; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +@Mapper("linkMapper") +public interface LinkMapper extends AbstractMapper { + + /**전자고지 발송 마스터 정보를 등록한다. + * @param params 전자고지 발송 마스터 정보 + * @return 저장여부 + */ + int insertElectronicNoticeSndngMaster(DataObject params); + + /**전자고지 발송 디테일 정보를 등록한다. + * @param params 전자고지 발송 디테일 정보 + * @return 저장여부 + */ + int insertElectronicNoticeSndngDetail(DataObject params); + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFExtractFormat.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFExtractFormat.java new file mode 100644 index 00000000..d16add70 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFExtractFormat.java @@ -0,0 +1,5 @@ +package cokr.xit.fims.cmmn.pdf; + +public abstract class PDFExtractFormat { + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintFormat.java similarity index 98% rename from src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java rename to src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintFormat.java index 3c7297de..8b94ec11 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintFormat.java @@ -6,7 +6,7 @@ import java.util.List; import cokr.xit.fims.sprt.PrintOption; import cokr.xit.foundation.data.DataObject; -public abstract class PDFFormat { +public abstract class PDFPrintFormat { protected List prototypeStngs = new ArrayList(); diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/extrationFormat/ElectronicNotice.java b/src/main/java/cokr/xit/fims/cmmn/pdf/extrationFormat/ElectronicNotice.java new file mode 100644 index 00000000..3d749425 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/extrationFormat/ElectronicNotice.java @@ -0,0 +1,10 @@ +package cokr.xit.fims.cmmn.pdf.extrationFormat; + +import cokr.xit.fims.cmmn.pdf.PDFExtractFormat; + +/** + * 전자고지 + */ +public class ElectronicNotice extends PDFExtractFormat { + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java b/src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Advntce.java similarity index 98% rename from src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java rename to src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Advntce.java index 8f922edc..6b620c0d 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Advntce.java @@ -1,11 +1,11 @@ -package cokr.xit.fims.cmmn.pdf.format; +package cokr.xit.fims.cmmn.pdf.printFormat; import java.util.ArrayList; import java.util.List; import java.util.Map; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.pdf.PDFFormat; +import cokr.xit.fims.cmmn.pdf.PDFPrintFormat; import cokr.xit.fims.cmmn.pdf.PDFPrintUtil; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.fims.sprt.PrintOption; @@ -15,7 +15,7 @@ import cokr.xit.foundation.data.DataObject; /** * 사전통지서 */ -public class Advntce extends PDFFormat { +public class Advntce extends PDFPrintFormat { public Advntce(){ addForPost( diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java b/src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Nht.java similarity index 99% rename from src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java rename to src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Nht.java index db51cbf7..b56470a4 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Nht.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/printFormat/Nht.java @@ -1,18 +1,18 @@ -package cokr.xit.fims.cmmn.pdf.format; +package cokr.xit.fims.cmmn.pdf.printFormat; import java.util.ArrayList; import java.util.List; import java.util.Map; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.pdf.PDFFormat; +import cokr.xit.fims.cmmn.pdf.PDFPrintFormat; import cokr.xit.fims.cmmn.pdf.PDFPrintUtil; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.fims.sprt.PrintOption; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; -public class Nht extends PDFFormat { +public class Nht extends PDFPrintFormat { public Nht() { addForPost( diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/LinkBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/LinkBean.java new file mode 100644 index 00000000..d4bcb68c --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/LinkBean.java @@ -0,0 +1,41 @@ +package cokr.xit.fims.cmmn.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.fims.cmmn.dao.LinkMapper; +import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.data.DataObject; + +@Component("linkBean") +public class LinkBean extends AbstractComponent { + + @Resource(name = "linkMapper") + private LinkMapper linkMapper; + + public boolean insertElectronicNoticeSndng(DataObject masterInfo, List detailInfos) { + + int effected = linkMapper.insertElectronicNoticeSndngMaster(masterInfo); + if(effected != 1) { + throw new RuntimeException("발송 마스터 등록 오류"); + } + + effected = 0; + for(int i=0; i < detailInfos.size(); i++) { + detailInfos.get(i).set("unitySndngMastrId", masterInfo.string("unitySndngMastrId")); + effected = linkMapper.insertElectronicNoticeSndngDetail(detailInfos.get(i)); + if(effected != 1) { + throw new RuntimeException("발송 상세 등록 오류"); + } + } + + if(effected != 1) { + throw new RuntimeException("발송 상세 등록 오류"); + } + + return true; + } +} diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java index b1991060..feafa3d5 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java @@ -41,11 +41,11 @@ import cokr.xit.fims.cmmn.hwp.format.RcvmtConfirm; import cokr.xit.fims.cmmn.hwp.format.ReportOnClaims; import cokr.xit.fims.cmmn.hwp.format.RequestForDelivery; import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng; -import cokr.xit.fims.cmmn.pdf.PDFFormat; +import cokr.xit.fims.cmmn.pdf.PDFPrintFormat; 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.pdf.printFormat.Advntce; +import cokr.xit.fims.cmmn.pdf.printFormat.Nht; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; @@ -287,7 +287,7 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements public Map makePdfFile(String formatType, String formatName, PrintOption printOption, String[] crdnIds) { Map result = new HashMap<>(); - PDFFormat pdfFormat = null; + PDFPrintFormat pdfFormat = null; if(formatName.equals("advntce")) { pdfFormat = new Advntce(); } else if(formatName.equals("nht")) { diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java index 38d1ec6b..63264175 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java @@ -10,9 +10,9 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng; -import cokr.xit.fims.cmmn.pdf.PDFFormat; -import cokr.xit.fims.cmmn.pdf.format.Advntce; -import cokr.xit.fims.cmmn.pdf.format.Nht; +import cokr.xit.fims.cmmn.pdf.PDFPrintFormat; +import cokr.xit.fims.cmmn.pdf.printFormat.Advntce; +import cokr.xit.fims.cmmn.pdf.printFormat.Nht; import cokr.xit.fims.sprt.OtptArtclStng; import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptStngQuery; @@ -41,7 +41,7 @@ public class OtptStngBean extends AbstractComponent { public Map getOtptArtclStngMap(OtptStngQuery query){ Map otptStngMap = new HashMap(); - PDFFormat pdfFormat = null; + PDFPrintFormat pdfFormat = null; switch(query.getSndngSeCd()) { case "02" : pdfFormat = new Advntce(); diff --git a/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml new file mode 100644 index 00000000..1eea1d9a --- /dev/null +++ b/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml @@ -0,0 +1,103 @@ + + + + + +/* 전자고지 발송 마스터 정보 등록(linkMapper.insertElectronicNoticeSndngMaster) */ + +SELECT + CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(UNITY_SNDNG_MASTR_ID,5)) + 1, 1) AS INT), 16, '0')) + AS NEW_ID +FROM TB_CNTC_SNDNG_MASTR + +INSERT + INTO TB_CNTC_SNDNG_MASTR ( + UNITY_SNDNG_MASTR_ID + , SIGNGU_CODE + , FFNLG_CODE + , TMPLAT_ID + , SNDNG_TY_CODE + , SNDNG_CO + , SNDNG_PROCESS_STTUS + , SNDNG_DT + , CLOS_DT + , ERROR_CODE + , ERROR_MSSAGE + , REGIST_DT + , REGISTER + , UPDT_DT + , UPDUSR + ) VALUES ( + #{unitySndngMastrId} + , #{signguCode} + , #{ffnlgCode} + , #{tmplatId} + , 'ENS' + , #{sndngCo} + , 'accept' + , #{sndngDt} + , #{closDt} + , #{errorCode} + , #{errorMssage} + , + , #{register} + , + , #{updusr} + ) + + + +/* 전자고지 발송 디테일 정보 등록(linkMapper.insertElectronicNoticeSndngDetail) */ + +SELECT + CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(UNITY_SNDNG_DETAIL_ID,5)) + 1, 1) AS INT), 16, '0')) + AS NEW_ID +FROM TB_CNTC_SNDNG_DETAIL + +INSERT + INTO TB_CNTC_SNDNG_DETAIL ( + UNITY_SNDNG_DETAIL_ID + , UNITY_SNDNG_MASTR_ID + , SIGNGU_CODE + , FFNLG_CODE + , MAIN_CODE + , VHCLE_NO + , IHIDNUM + , MOBLPHON_NO + , NM + , ADRES + , DETAIL_ADRES + , ZIP + , TMPLT_MSG_DATA + , MOBILE_PAGE_CN + , USE_INSTT_IDNTFC_ID + , EXTERNAL_DOCUMENT_UUID + , REGIST_DT + , REGISTER + , UPDT_DT + , UPDUSR + ) VALUES ( + #{unitySndngDetailId} + , #{unitySndngMastrId} + , #{signguCode} + , #{ffnlgCode} + , #{mainCode} + , #{vhcleNo} + , #{ihidnum} + , #{moblphonNo} + , #{nm} + , #{adres} + , #{detailAdres} + , #{zip} + , #{tmpltMsgData} + , #{mobilePageCn} + , #{useInsttIdntfcId} + , #{externalDocumentUuid} + , + , #{register} + , + , #{updusr} + ) + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/include/top.jsp b/src/main/webapp/WEB-INF/jsp/include/top.jsp index 33f481fc..efe3695b 100644 --- a/src/main/webapp/WEB-INF/jsp/include/top.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/top.jsp @@ -54,6 +54,9 @@ + @@ -162,6 +165,14 @@ + + function fnOpenTempFileUploadWindow(){ window.open( @@ -171,6 +182,17 @@ function fnOpenTempFileUploadWindow(){ ); } +function fnOpenStngDialog(){ + dialog.open({ + id : "selectStngDialog", + title : "설정 선택", + content : document.getElementById("selectStngButtonsTemplate").innerHTML, + size : "sm", + init : () => {}, + onClose : () => {} + }); +} + function fnOpenMyInfo(){ window.open( wctx.url("/user/openMyInfo.do") @@ -390,5 +412,10 @@ $("#photoMask--top").on( "click", function() { $("#btnOpenTempFileUploadWindow").on( "click", function() { fnOpenTempFileUploadWindow(); }); +/*--------------------- 특화 설정 ---------------------*/ +$("#btnOpenStngDialog").on( "click", function() { + fnOpenStngDialog(); +}); +