From 8758738b85de52bebee060e628efb6dfe74af2e2 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 7 Dec 2023 09:09:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=9C=EB=A0=A5=EB=AC=BC=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=A0=91=EB=8A=94?= =?UTF-8?q?=EC=84=A0=20=EC=B6=9C=EB=A0=A5=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java | 41 ++++++++++++++----- .../xit/fims/cmmn/pdf/format/Advntce.java | 24 +++++------ .../sprt/service/bean/Sprt01ServiceBean.java | 31 ++++++++++---- .../js/fims/framework/cmm/componentization.js | 2 +- 4 files changed, 66 insertions(+), 32 deletions(-) diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java index 80859f1e..f9386e24 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java @@ -8,6 +8,7 @@ import java.util.Map; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPageContentStream; +import org.apache.pdfbox.pdmodel.common.PDRectangle; import org.apache.pdfbox.pdmodel.font.PDType0Font; import org.apache.pdfbox.pdmodel.graphics.color.PDColor; import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; @@ -128,24 +129,42 @@ public class PDFPrintUtil extends PrintUtil { } } - public void renderFoldLine(PDPageContentStream contentStream, float paperWidth, float paperHeight) { - float foldHeight = 712/3; + public void renderFoldLine(PDPageContentStream contentStream, PDRectangle paper, String foldCode) { + if(foldCode.equals("") && !foldCode.equals("01") && !foldCode.equals("02")) { + return; + } + + float paperWidth = paper.getWidth(); - float bottomFold = foldHeight; //하단접는곳 - float topFold = foldHeight * 2; //상단접는곳 + float partHeight; + if(foldCode.equals("01")) { + if(paper.A4.equals(paper)) { + partHeight = 99; + } else { + partHeight = 93; + } + } else { + partHeight = 93; + } - if(paperHeight == 841.8898f) { - bottomFold += 130f; - topFold += 130f; + float margin = 0; + if(foldCode.equals("02")) { + margin = 18; } + float bottomFold = margin + partHeight; //하단접는곳 + float topFold = margin + (partHeight * 2); //상단접는곳 + + float bottomFold_pt = mmToPt(bottomFold); + float topFold_pt = mmToPt(topFold); + try { contentStream.setLineDashPattern(new float[]{3,1}, 0); - contentStream.moveTo(0, topFold); - contentStream.lineTo(paperWidth, topFold); + contentStream.moveTo(0, topFold_pt); + contentStream.lineTo(paperWidth, topFold_pt); contentStream.stroke(); - contentStream.moveTo(0, bottomFold); - contentStream.lineTo(paperWidth, bottomFold); + contentStream.moveTo(0, bottomFold_pt); + contentStream.lineTo(paperWidth, bottomFold_pt); contentStream.stroke(); contentStream.setLineDashPattern(new float[]{}, 0); } catch (IOException e) { 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 819cd218..0b8eb082 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 @@ -15,19 +15,19 @@ public class Advntce extends PDFFormat { public Advntce(){ addForPost( - image("postSenderLogo","우편물송신자로고","").a4(10, 0).letter(0, 0).size(0, 0), - text("postSenderInst","우편물송신자기관","").a4(10, 5).letter(0, 0), - text("postSenderDept","우편물송신자부서","").a4(50, 5).letter(0, 0), - text("postSenderAddr","우편물송신자주소","").a4(10, 15).letter(0, 0), - text("postSenderDtlAddr","우편물송신자상세주소","").a4(10, 25).letter(0, 0), - text("postSenderZip","우편물송신자우편번호","").a4(10, 35).letter(0, 0), - text("postSenderTel","우편물송신자전화번호","").a4(10, 45).letter(0, 0), - text("postSenderFax","우편물송신자팩스번호","").a4(50, 45).letter(0, 0), + 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(0, 0).size(90, 0).align("right"), - text("postReceiverDtlAddr","우편물수신자상세주소","").a4(100, 50).letter(0, 0).size(90, 0).align("right"), - text("postReceiver","우편물수신자명","").a4(100, 60).letter(0, 0).size(90, 0).align("right"), - text("postReceiverZip","우편물수신자우편번호","").a4(100, 70).letter(0, 0).size(90, 0).align("right") + 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( 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 93093b89..f4f27d1c 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 @@ -65,8 +65,6 @@ import kr.dogfoot.hwplib.writer.HWPWriter; @Service("sprt01Service") public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Service { - private Object object; - /** 업무지원 Bean */ @Resource(name="sprt01Bean") protected Sprt01Bean sprt01Bean; @@ -333,9 +331,6 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv paper = PDRectangle.LETTER; } - float paperWidth = paper.getWidth(); - float paperHeight = paper.getHeight(); - OtptStngQuery otptStngQuery = new OtptStngQuery(); otptStngQuery.setSggCd((String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("sggCd")); otptStngQuery.setTaskSeCd(printOption.getTaskSeCd()); @@ -350,6 +345,13 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv otptStngQuery.setSndngSeCd(sndngSeCd); otptStngQuery.setPaperSeCd(paperSeCd); + //출력물 기본 설정 + DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery); + if(otptBscStng == null) { + otptBscStng = new DataObject(); + } + + //출력 요소별 설정 List otptArtclStngList = otptStngMapper.selectOtptArtclStngList(otptStngQuery); pdfFormat.appendOtptAttribute(otptArtclStngList); @@ -378,12 +380,19 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv // 컨텐츠 스트림 열기 PDPageContentStream contentStream = new PDPageContentStream(doc, page); - //접는곳 점선 그리기 - pdfPrintUtil.renderFoldLine(contentStream, paperWidth, paperHeight); - + boolean completeFoldLine = false; for(DataObject otptArtclStng : otptArtclStngList) { String otptArtclNm = otptArtclStng.string("OTPT_ARTCL_NM"); + + if(!otptArtclNm.equals("background") && !completeFoldLine) { + //접는곳 점선 그리기 + if(!otptBscStng.string("FOLD_LINE_PSTN_SE_CD").equals("")) { + pdfPrintUtil.renderFoldLine(contentStream, paper, otptBscStng.string("FOLD_LINE_PSTN_SE_CD")); + } + completeFoldLine = true; + } + DefaultOtptArtclStng prototypeStng = prototypeStngList.stream() .filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0); @@ -414,6 +423,12 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv } + if(!completeFoldLine) { + if(!otptBscStng.string("FOLD_LINE_PSTN_SE_CD").equals("")) { + pdfPrintUtil.renderFoldLine(contentStream, paper, otptBscStng.string("FOLD_LINE_PSTN_SE_CD")); + } + } + contentStream.close(); } diff --git a/src/main/webapp/resources/js/fims/framework/cmm/componentization.js b/src/main/webapp/resources/js/fims/framework/cmm/componentization.js index 7cdeaf33..50d47f9c 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/componentization.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/componentization.js @@ -196,7 +196,7 @@ function fnMakeScrollableTable(tableScrollEl, thisScrollendEvent){ } }; - var io = new IntersectionObserver(ioCallbackFunc, {threshold : 0.5}); + var io = new IntersectionObserver(ioCallbackFunc, {threshold : 0}); io.observe(more); }