배경이미지 출력 수정

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.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<String, String> 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" -> {

@ -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<DataObject> dataObjectList = new ArrayList<DataObject>();
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();
PDDocument doc = new PDDocument();//pdf문서 생성
//폰트 로드
@ -350,26 +340,38 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
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<DefaultOtptArtclStng> prototypeStngList = pdfFormat.getPrototypeStngs();
otptStngQuery.setSggCd(printUserSggCd);
otptStngQuery.setTaskSeCd(taskSeCd);
otptStngQuery.setSndngSeCd(sndngSeCd);
otptStngQuery.setPaperSeCd(paperSeCd);
//출력물 기본 설정
DataObject otptBscStng = otptStngMapper.selectOtptBscStng(otptStngQuery);
if(otptBscStng == null) {
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);
//출력요소별 속성 정보 추가

@ -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();

Loading…
Cancel
Save