배경이미지 출력 수정

main
이범준 11 months ago
parent fab0d51e63
commit 9b0d62ba86

@ -2,6 +2,7 @@ package cokr.xit.fims.cmmn.pdf.format;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.FactionUtil; import cokr.xit.fims.cmmn.FactionUtil;
@ -95,9 +96,13 @@ public class Advntce extends PDFFormat {
return this.getValueForPost(otptArtclNm, defaultValue, dataObject, printOption, pdfPrintUtil); return this.getValueForPost(otptArtclNm, defaultValue, dataObject, printOption, pdfPrintUtil);
} }
Map<String, String> globalVariable = printOption.getGlobalVariable();
switch(otptArtclNm) { switch(otptArtclNm) {
case "background" -> { case "background" -> {
result = dataObject.string(""); if(globalVariable.get("bcrnImgPath") != null) {
result = globalVariable.get("bcrnImgPath");
}
} }
case "rprsCrdnPhoto" -> { //대표사진 case "rprsCrdnPhoto" -> { //대표사진
result = dataObject.string("CRDN_PHOTO1"); result = dataObject.string("CRDN_PHOTO1");
@ -214,7 +219,7 @@ public class Advntce extends PDFFormat {
result = instNm; result = instNm;
} }
case "offcs" -> { case "offcs" -> {
result = printOption.getGlobalVariable().get("offcsFilePath"); result = globalVariable.get("offcsFilePath");
} }
case "undefined" -> { case "undefined" -> {

@ -276,6 +276,26 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
if(formatName.equals("advntce")) { if(formatName.equals("advntce")) {
pdfFormat = new 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<DataObject> dataObjectList = new ArrayList<DataObject>(); List<DataObject> dataObjectList = new ArrayList<DataObject>();
if(crdnIds.length == 1 && crdnIds[0].equals("sample")) { if(crdnIds.length == 1 && crdnIds[0].equals("sample")) {
@ -305,38 +325,8 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
} }
} }
DataObject userStngInfo = stngBean.getStng("user");
DataObject sggStngInfo = stngBean.getStng("sgg");
DataObject deptStngInfo = stngBean.getStng("dept");
Map<String, String> globalVariable = printOption.getGlobalVariable();
if(globalVariable == null) {
globalVariable = new HashMap<String, String>();
}
globalVariable.put("offcsFilePath", sggStngInfo.string("OFFCS_FILE_PATH"));
globalVariable.put("logoFilePath", sggStngInfo.string("LOGO_FILE_PATH"));
globalVariable.put("instAddr", sggStngInfo.string("INST_ADDR"));
globalVariable.put("instDaddr", sggStngInfo.string("INST_DADDR"));
globalVariable.put("instZip", sggStngInfo.string("INST_ZIP"));
globalVariable.put("deptTelno", deptStngInfo.string("DEPT_TELNO"));
globalVariable.put("deptFxno", deptStngInfo.string("DEPT_FXNO"));
printOption.setGlobalVariable(globalVariable);
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(); String resultFilePath = pdfPrintUtil.filePathForNewFile();
PDDocument doc = new PDDocument();//pdf문서 생성 PDDocument doc = new PDDocument();//pdf문서 생성
//폰트 로드 //폰트 로드
@ -350,26 +340,38 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
paper = PDRectangle.LETTER; paper = PDRectangle.LETTER;
} }
//출력물 기본 설정
OtptStngQuery otptStngQuery = new OtptStngQuery(); OtptStngQuery otptStngQuery = new OtptStngQuery();
otptStngQuery.setSggCd((String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("sggCd")); otptStngQuery.setSggCd(printUserSggCd);
otptStngQuery.setTaskSeCd(printOption.getTaskSeCd()); otptStngQuery.setTaskSeCd(taskSeCd);
String sndngSeCd = "";
if(formatName.equals("advntce")) {
sndngSeCd = "02";
}
List<DefaultOtptArtclStng> prototypeStngList = pdfFormat.getPrototypeStngs();
otptStngQuery.setSndngSeCd(sndngSeCd); otptStngQuery.setSndngSeCd(sndngSeCd);
otptStngQuery.setPaperSeCd(paperSeCd); otptStngQuery.setPaperSeCd(paperSeCd);
//출력물 기본 설정
DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery); DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery);
if(otptBscStng == null) { if(otptBscStng == null) {
otptBscStng = new DataObject(); otptBscStng = new DataObject();
} }
//
Map<String, String> globalVariable = printOption.getGlobalVariable();
if(globalVariable == null) {
globalVariable = new HashMap<String, String>();
}
globalVariable.put("offcsFilePath", sggStngInfo.string("OFFCS_FILE_PATH"));
globalVariable.put("logoFilePath", sggStngInfo.string("LOGO_FILE_PATH"));
globalVariable.put("instAddr", sggStngInfo.string("INST_ADDR"));
globalVariable.put("instDaddr", sggStngInfo.string("INST_DADDR"));
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<DefaultOtptArtclStng> prototypeStngList = pdfFormat.getPrototypeStngs();
try {
//출력 요소별 설정 //출력 요소별 설정
List<DataObject> otptArtclStngList = otptStngMapper.selectOtptArtclStngList(otptStngQuery); List<DataObject> otptArtclStngList = otptStngMapper.selectOtptArtclStngList(otptStngQuery);
//출력요소별 속성 정보 추가 //출력요소별 속성 정보 추가

@ -505,7 +505,7 @@ public class Sprt01Controller extends ApplicationController {
+File.separator+sggCd; +File.separator+sggCd;
String ext = FilenameUtils.getExtension(backgroundFile.getOriginalFilename()); 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); File workDir = new File(bgPath);
workDir.mkdirs(); workDir.mkdirs();

Loading…
Cancel
Save