diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java b/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java index 90034080..2cede7a2 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java @@ -46,8 +46,12 @@ import kr.dogfoot.hwplib.tool.objectfinder.CellFinder; public class InsertingImageCell { public static void IMPL_InsertPicture(HWPFile hwpFile, String fieldName, String imgFilePath) throws IOException { - InsertingImageCell tii = new InsertingImageCell(); - tii.insertShapeWithImage(hwpFile, fieldName, imgFilePath); + if(imgFilePath != null && !imgFilePath.equals("")) { + InsertingImageCell tii = new InsertingImageCell(); + tii.insertShapeWithImage(hwpFile, fieldName, imgFilePath); + } + + } private final String imageFileExt = "jpg"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/PrintUtil.java b/src/main/java/cokr/xit/fims/cmmn/hwp/PrintUtil.java index 4eb94a5f..416b5a1c 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/PrintUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/PrintUtil.java @@ -111,6 +111,7 @@ public class PrintUtil { switch (formatName) { case "crdnList": { this.recordPerPartFile = 6; + break; } } @@ -121,11 +122,13 @@ public class PrintUtil { this.formatKorName = "단속확인서"; this.baseFormatFilePath = "format/crdnConfirm.hwp"; this.attachFormatFilePath = ""; + break; } case "crdnList": { this.formatKorName = "단속내역서"; this.baseFormatFilePath = "format/crdnList_root.hwp"; this.attachFormatFilePath = "format/crdnList_inner.hwp"; + break; } } @@ -202,6 +205,9 @@ public class PrintUtil { String instNm = (String) this.printRequestUserInfo.getInfo().get("instNm"); instNm = FactionUtil.getLastWord(instNm); + if(instNm.endsWith("구") || instNm.endsWith("군")) { + instNm += "청"; + } baseFileEditor.set("발신", instNm); } } @@ -248,8 +254,51 @@ public class PrintUtil { } else { + ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile); + if(this.formatName.equals("crdnConfirm")){ + baseFileEditor.set("과태료", dataObject.string("TASK_SE_NM")); + baseFileEditor.set("차량번호", dataObject.string("VHRNO")); + String crdnYmdTm = dataObject.string("CRDN_YMD_TM"); + crdnYmdTm = CmmnUtil.yyyy_mm_dd_hh_mm_ss(crdnYmdTm); + baseFileEditor.set("단속일시", crdnYmdTm); + + baseFileEditor.set("위반내용", dataObject.string("VLTN_ARTCL")); + baseFileEditor.set("단속장소", dataObject.string("CRDN_PLC")); + baseFileEditor.set("단속동", dataObject.string("CRDN_STDG_NM")); + baseFileEditor.set("단속조", dataObject.string("TEAM_NM")); + baseFileEditor.set("소유자", dataObject.string("RTPYR_NM")); + baseFileEditor.set("주소", dataObject.string("RTPYR_FULL_ADDR")); + baseFileEditor.set("우편번호", dataObject.string("RTPYR_ZIP")); + + String printRequestYmd = this.printRequestDt.substring(0, 8); + String yyyy = printRequestYmd.substring(0, 4); + String mm = printRequestYmd.substring(4, 6); + String dd = printRequestYmd.substring(6, 8); + String ymd = yyyy+"년 "+mm+"월 "+dd+"일"; + baseFileEditor.set("연월일", ymd); + + String instNm = (String) this.printRequestUserInfo.getInfo().get("instNm"); + if(instNm.endsWith("구") || instNm.endsWith("군")) { + instNm += "청"; + } + baseFileEditor.set("발신", instNm); + + if(!dataObject.string("PHOTO1").equals("")) { + InsertingImageCell.IMPL_InsertPicture(baseFile, "왼쪽위사진", dataObject.string("PHOTO1")); + } + if(!dataObject.string("PHOTO2").equals("")) { + InsertingImageCell.IMPL_InsertPicture(baseFile, "오른쪽위사진", dataObject.string("PHOTO2")); + } + if(!dataObject.string("PHOTO3").equals("")) { + InsertingImageCell.IMPL_InsertPicture(baseFile, "왼쪽아래사진", dataObject.string("PHOTO3")); + } + if(!dataObject.string("PHOTO4").equals("")) { + InsertingImageCell.IMPL_InsertPicture(baseFile, "오른쪽아래사진", dataObject.string("PHOTO4")); + } + + } } } catch(Exception e) { 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 818558a6..cdb9b26c 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 @@ -9,9 +9,12 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; +import cokr.xit.base.file.service.FileQuery; +import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.fims.cmmn.hwp.AddUtil; import cokr.xit.fims.cmmn.hwp.PrintUtil; import cokr.xit.fims.cmmn.service.bean.FactionBean; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.CrdnListMapper; import cokr.xit.fims.sprt.PrintOption; @@ -47,6 +50,9 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv @Resource(name="crdnListMapper") protected CrdnListMapper crdnListMapper; + @Resource(name="fileBean") + protected FileBean fileBean; + @Override public List getIntegrationDataList(SprtQuery query) { return sprt01Bean.getIntegrationDataList(query); @@ -80,6 +86,26 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv CrdnQuery query = new CrdnQuery(); query.setCrdnIDs(crdnIds); dataObjectList = crdnListMapper.selectCrackdownList(query); + + for(int i=0; i < dataObjectList.size(); i++) { + DataObject dataObject = dataObjectList.get(i); + String crndId = dataObject.string("CRDN_ID"); + + FileQuery fileQuery = new FileQuery(); + fileQuery.setInfoType(Crdn.INF_TYPE); + fileQuery.setInfoKeys(crndId); + List fileInfoList = fileBean.getFileList(fileQuery); + if(fileInfoList != null && fileInfoList.size() > 0) { + dataObject.set("PHOTO1", fileInfoList.get(0).string("URL")); + if(fileInfoList.size() >= 2) + dataObject.set("PHOTO2", fileInfoList.get(1).string("URL")); + if(fileInfoList.size() >= 3) + dataObject.set("PHOTO3", fileInfoList.get(2).string("URL")); + if(fileInfoList.size() >= 4) + dataObject.set("PHOTO4", fileInfoList.get(3).string("URL")); + } + + } } int totalDataCount = dataObjectList.size(); diff --git a/src/main/resources/format/crdnConfirm.hwp b/src/main/resources/format/crdnConfirm.hwp index f1f5719c..0f7056c9 100644 Binary files a/src/main/resources/format/crdnConfirm.hwp and b/src/main/resources/format/crdnConfirm.hwp differ diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-list-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-list-mapper.xml index b1bba302..08bdbb64 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-list-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-list-mapper.xml @@ -92,7 +92,8 @@ SELECT C.CRDN_ID , LE.ETC_CN AS LEVY_EXCL_ETC_CN , P.RTPYR_NM , P.RTPYR_NO - , CONCAT(P.ADDR, ' ', P.DTL_ADDR) AS RTPYR_FULL_ADDR /* 납부자 전체 주소 */ + , CONCAT(P.ADDR, ' ', P.DTL_ADDR) AS RTPYR_FULL_ADDR + , P.ZIP AS RTPYR_ZIP , C.DEL_YN , C.RGTR , C.REG_DT diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01110-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01110-info.jsp index a25444f5..b9ff1a0b 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01110-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01110-info.jsp @@ -10,7 +10,7 @@
- +