From e5c8ded25c5b2b220bc52d6e8c72900387815baf Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 27 Nov 2023 13:15:22 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=98=EA=B2=AC=EC=A0=9C=EC=B6=9C=EC=8B=AC?= =?UTF-8?q?=EC=9D=98=EA=B2=B0=EC=9D=98=EC=84=9C=20=ED=8F=AC=EB=A7=B7=20cla?= =?UTF-8?q?ss=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/cmmn/hwp/format/DlbrDecsn.java | 66 +++++++++++++++++++ .../service/bean/OpnnSbmsnServiceBean.java | 12 ++-- .../sql/mapper/fims/sprt/otptStng-mapper.xml | 2 + 3 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsn.java diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsn.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsn.java new file mode 100644 index 00000000..b7c85969 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsn.java @@ -0,0 +1,66 @@ +package cokr.xit.fims.cmmn.hwp.format; + +import java.util.List; + +import cokr.xit.fims.cmmn.hwp.ClickHereEditor; +import cokr.xit.fims.cmmn.hwp.HWPFormatWriter; +import cokr.xit.fims.cmmn.hwp.HWPPrintUtil; +import cokr.xit.fims.sprt.PrintOption; +import cokr.xit.foundation.data.DataObject; +import kr.dogfoot.hwplib.object.HWPFile; + +public class DlbrDecsn implements HWPFormatWriter { + + @Override + public void setting(HWPPrintUtil hwpPrintUtil) { + hwpPrintUtil.setFormatName("dlbrDecsn"); + hwpPrintUtil.setFormatKorName("의견제출심의결의서"); + + hwpPrintUtil.setFormatType("info"); + hwpPrintUtil.setRecordPerPartFile(1); + + hwpPrintUtil.setBaseFormatFilePath("format/opnnDlbrDecsnForm.hwp"); + hwpPrintUtil.setAttachFormatFilePath(""); + } + + @Override + public void writeGlobalInfo(HWPFile baseFile, List dataObjectList, PrintOption printOption, + HWPPrintUtil hwpPrintUtil) { + } + + @Override + public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile, DataObject dataObject, + HWPPrintUtil hwpPrintUtil) { + + ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile); + + baseFileEditor.set("접수번호", dataObject.string("RCPT_NO")); + baseFileEditor.set("접수일자", dataObject.string("RCPT_YMD")); + baseFileEditor.set("위반정보", dataObject.string("TASK_SE_NM")); + baseFileEditor.set("진술자명", dataObject.string("STTR_NM")); + baseFileEditor.set("진술자생년월일", dataObject.string("STTR_BRDT")); + baseFileEditor.set("진술자연락처", dataObject.string("STTR_CTTPC")); + baseFileEditor.set("소유주관계", dataObject.string("OWNR_REL_NM")); + baseFileEditor.set("차량번호", dataObject.string("VHRNO")); + baseFileEditor.set("단속일시", dataObject.string("CRDN_YMD_TM_MASK")); + baseFileEditor.set("단속장소", dataObject.string("CRDN_PLC")); + baseFileEditor.set("의견제출내용", dataObject.string("OPNN_SBMSN_CN")); + baseFileEditor.set("심의회원직급1", dataObject.string("DLBR_MBR_JBGD1")); + baseFileEditor.set("심의회원명1", dataObject.string("DLBR_MBR_NM1")); + baseFileEditor.set("심의회원직급2", dataObject.string("DLBR_MBR_JBGD2")); + baseFileEditor.set("심의회원명2", dataObject.string("DLBR_MBR_NM2")); + baseFileEditor.set("심의회원직급3", dataObject.string("DLBR_MBR_JBGD3")); + baseFileEditor.set("심의회원명3", dataObject.string("DLBR_MBR_NM3")); + baseFileEditor.set("심의회원직급4", dataObject.string("DLBR_MBR_JBGD4")); + baseFileEditor.set("심의회원명4", dataObject.string("DLBR_MBR_NM4")); + baseFileEditor.set("심의회원직급5", dataObject.string("DLBR_MBR_JBGD5")); + baseFileEditor.set("심의회원명5", dataObject.string("DLBR_MBR_NM5")); + baseFileEditor.set("심의회원직급6", dataObject.string("DLBR_MBR_JBGD6")); + baseFileEditor.set("심의회원명6", dataObject.string("DLBR_MBR_NM6")); + baseFileEditor.set("심의회원직급7", dataObject.string("DLBR_MBR_JBGD7")); + baseFileEditor.set("심의회원명7", dataObject.string("DLBR_MBR_NM7")); + baseFileEditor.set("담당자검토의견", dataObject.string("PIC_RVW_OPNN")); + + } + +} diff --git a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java index 7087d2ac..226ae161 100644 --- a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java +++ b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java @@ -10,11 +10,13 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; import cokr.xit.base.file.FileInfo; -import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.cmmn.hwp.AddUtil; +import cokr.xit.fims.cmmn.hwp.HWPFormatWriter; import cokr.xit.fims.cmmn.hwp.HWPPrintUtil; +import cokr.xit.fims.cmmn.hwp.format.DlbrDecsn; import cokr.xit.fims.cmmn.service.bean.FactionBean; import cokr.xit.fims.excl.LevyExclQuery; +import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.excl.service.OpnnSbmsnService; import cokr.xit.fims.sprt.PrintOption; import cokr.xit.foundation.UserInfo; @@ -118,7 +120,8 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm Map result = new HashMap<>(); HWPPrintUtil printUtil = new HWPPrintUtil(); - printUtil.setting(formatType, formatName); + HWPFormatWriter hwpFormatWriter = new DlbrDecsn(); + hwpFormatWriter.setting(printUtil); UserInfo userInfo = currentUser(); factionBean.initUserInfo(userInfo); @@ -141,15 +144,14 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm HWPFile resultFile = HWPReader.fromFile(resultHwpPath); // 공통사항 세팅 - printUtil.setGlobalInfo(printOption, dataObjectList, resultFile); + hwpFormatWriter.writeGlobalInfo(resultFile, dataObjectList, printOption, printUtil); HWPWriter.toFile(resultFile, resultHwpPath); // 데이터 건별 처리 for (int recordIndex = 0; recordIndex < printUtil.getRecordPerPartFile(); recordIndex++) { if (dataIndex < dataObjectList.size()) { DataObject dataObject = dataObjectList.get(dataIndex); - - printUtil.setBySingleData(printOption, dataObject, resultFile); + hwpFormatWriter.writeSingleDataInfo(resultFile, null, dataObject, printUtil); } if (formatType.equals("list")) { diff --git a/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml index ac6a755a..20f8c174 100644 --- a/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml @@ -26,4 +26,6 @@ SELECT OTPT_FORM_ID AND TASK_SE_CD = #{taskSeCd} AND SNDNG_SE_CD = #{sndngSeCd} AND OTPT_PAPER_SE_CD = #{otptPaperSeCd} + + \ No newline at end of file