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 bc7718cf..46b932cb 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 @@ -2,6 +2,7 @@ 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; @@ -95,9 +96,13 @@ public class Advntce extends PDFFormat { return this.getValueForPost(otptArtclNm, defaultValue, dataObject, printOption, pdfPrintUtil); } + Map globalVariable = printOption.getGlobalVariable(); + switch(otptArtclNm) { case "background" -> { - result = dataObject.string(""); + if(globalVariable.get("bcrnImgPath") != null) { + result = globalVariable.get("bcrnImgPath"); + } } case "rprsCrdnPhoto" -> { //대표사진 result = dataObject.string("CRDN_PHOTO1"); @@ -214,7 +219,7 @@ public class Advntce extends PDFFormat { result = instNm; } case "offcs" -> { - result = printOption.getGlobalVariable().get("offcsFilePath"); + result = globalVariable.get("offcsFilePath"); } case "undefined" -> { 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 e47e9db0..ad10e0ee 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 @@ -276,6 +276,26 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv if(formatName.equals("advntce")) { pdfFormat = new Advntce(); } + String sndngSeCd = ""; + if(formatName.equals("advntce")) { + sndngSeCd = "02"; + } + + String paperSeCd = printOption.getPaperSeCd(); + String taskSeCd = printOption.getTaskSeCd(); + + DataObject userStngInfo = stngBean.getStng("user"); + DataObject sggStngInfo = stngBean.getStng("sgg"); + DataObject deptStngInfo = stngBean.getStng("dept"); + + + PDFPrintUtil pdfPrintUtil = new PDFPrintUtil(); + UserInfo userInfo = currentUser(); + factionBean.initUserInfo(userInfo); + pdfPrintUtil.setPrintRequestUserInfo(userInfo); + String printUserSggCd = (String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("sggCd"); + pdfPrintUtil.setting(paperSeCd); + List dataObjectList = new ArrayList(); if(crdnIds.length == 1 && crdnIds[0].equals("sample")) { @@ -305,10 +325,33 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv } } - DataObject userStngInfo = stngBean.getStng("user"); - DataObject sggStngInfo = stngBean.getStng("sgg"); - DataObject deptStngInfo = stngBean.getStng("dept"); + String resultFilePath = pdfPrintUtil.filePathForNewFile(); + PDDocument doc = new PDDocument();//pdf문서 생성 + + //폰트 로드 + Map fontMap = pdfPrintUtil.getFontMap(doc); + + //용지 크기 설정 + PDRectangle paper = null; + if(paperSeCd.equals("01")) { + paper = PDRectangle.A4; + } else { + paper = PDRectangle.LETTER; + } + + //출력물 기본 설정 + OtptStngQuery otptStngQuery = new OtptStngQuery(); + otptStngQuery.setSggCd(printUserSggCd); + otptStngQuery.setTaskSeCd(taskSeCd); + otptStngQuery.setSndngSeCd(sndngSeCd); + otptStngQuery.setPaperSeCd(paperSeCd); + DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery); + if(otptBscStng == null) { + otptBscStng = new DataObject(); + } + + // Map globalVariable = printOption.getGlobalVariable(); if(globalVariable == null) { globalVariable = new HashMap(); @@ -320,55 +363,14 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv globalVariable.put("instZip", sggStngInfo.string("INST_ZIP")); globalVariable.put("deptTelno", deptStngInfo.string("DEPT_TELNO")); globalVariable.put("deptFxno", deptStngInfo.string("DEPT_FXNO")); + if(!otptBscStng.string("BCRN_IMG_PATH").equals("")) { + globalVariable.put("bcrnImgPath", otptBscStng.string("BCRN_IMG_PATH")); + } printOption.setGlobalVariable(globalVariable); + List prototypeStngList = pdfFormat.getPrototypeStngs(); try { - String paperSeCd = printOption.getPaperSeCd(); - PDFPrintUtil pdfPrintUtil = new PDFPrintUtil(); - UserInfo userInfo = currentUser(); - factionBean.initUserInfo(userInfo); - pdfPrintUtil.setPrintRequestUserInfo(userInfo); - - // - pdfPrintUtil.setting(paperSeCd); - - - String resultFilePath = pdfPrintUtil.filePathForNewFile(); - - - PDDocument doc = new PDDocument();//pdf문서 생성 - - //폰트 로드 - Map fontMap = pdfPrintUtil.getFontMap(doc); - - //용지 크기 설정 - PDRectangle paper = null; - if(paperSeCd.equals("01")) { - paper = PDRectangle.A4; - } else { - paper = PDRectangle.LETTER; - } - - OtptStngQuery otptStngQuery = new OtptStngQuery(); - otptStngQuery.setSggCd((String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("sggCd")); - otptStngQuery.setTaskSeCd(printOption.getTaskSeCd()); - - String sndngSeCd = ""; - if(formatName.equals("advntce")) { - sndngSeCd = "02"; - } - - List prototypeStngList = pdfFormat.getPrototypeStngs(); - - otptStngQuery.setSndngSeCd(sndngSeCd); - otptStngQuery.setPaperSeCd(paperSeCd); - - //출력물 기본 설정 - DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery); - if(otptBscStng == null) { - otptBscStng = new DataObject(); - } //출력 요소별 설정 List otptArtclStngList = otptStngMapper.selectOtptArtclStngList(otptStngQuery); 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 e4ea2912..79662731 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -505,7 +505,7 @@ public class Sprt01Controller extends ApplicationController { +File.separator+sggCd; String ext = FilenameUtils.getExtension(backgroundFile.getOriginalFilename()); - String fileName = otptForm.getTaskSeCd()+"-"+otptForm.getSndngSeCd()+"-"+otptForm.getTaskSeCd()+"."+ext; + String fileName = otptForm.getTaskSeCd()+"-"+otptForm.getSndngSeCd()+"-"+otptForm.getPaperSeCd()+"."+ext; File workDir = new File(bgPath); workDir.mkdirs();