PDF출력 다운로드 로그 추가

main
이범준 9 months ago
parent d4eccdacda
commit 1bc6685a42

@ -56,20 +56,57 @@ public class PDFWriter {
} }
} }
public void setFormat(PDFPrintFormat format) {
this.format = format;
};
public void setPrint(Print print) { public void setPrint(Print print) {
this.print = print; this.print = print;
}; };
public void setFormat(PDFPrintFormat format) {
this.format = format;
}
public PDFPrintFormat getFormat() {
return this.format;
}
public void setOtptBscStng(DataObject otptBscStng) { public void setOtptBscStng(DataObject otptBscStng) {
this.otptBscStng = otptBscStng; this.otptBscStng = otptBscStng;
}; }
public void setOtptArtclStngList(List<DataObject> otptArtclStngList) { public void setOtptArtclStngList(List<DataObject> otptArtclStngList) {
this.otptArtclStngList = otptArtclStngList; this.otptArtclStngList = otptArtclStngList;
}; }
public List<DataObject> getOtptArtclStngList() {
return this.otptArtclStngList;
}
/**
* .
*/
public List<DefaultOtptArtclStng> filterUsedArtcls() {
List<String> otptArtclNmList = this.otptArtclStngList.stream().map((item) -> { return item.string("OTPT_ARTCL_NM"); }).toList();
List<DefaultOtptArtclStng> result = this.getFormat().getPrototypeStngs().stream()
.filter((item) -> {
return otptArtclNmList.contains(item.getOtptArtclNm());
}).toList();
return result;
}
/**
* .
*/
public List<String> filterDownloadDataNames() {
List<String> result = this.filterUsedArtcls().stream()
.filter((item) -> {
return item.isDownloadData();
})
.map(DefaultOtptArtclStng::getDscrp).toList();
return result;
}
public Map<String, Object> makePdfFile(String formatType, String formatName, PrintOption printOption, List<DataObject> dataObjectList) { public Map<String, Object> makePdfFile(String formatType, String formatName, PrintOption printOption, List<DataObject> dataObjectList) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

@ -29,6 +29,7 @@ public class DefaultOtptArtclStng {
this.forPost = false; this.forPost = false;
this.unique = false; this.unique = false;
this.downloadData = true;
} }
/** /**
@ -57,6 +58,14 @@ public class DefaultOtptArtclStng {
return this; return this;
} }
/**
* .
*/
public DefaultOtptArtclStng offLog() {
this.downloadData = false;
return this;
}
/** /**
* . * .
*/ */
@ -119,6 +128,7 @@ public class DefaultOtptArtclStng {
private String otptBscVl; //기본값 private String otptBscVl; //기본값
private boolean unique; //출력물 내 유일 요소 여부 private boolean unique; //출력물 내 유일 요소 여부
private boolean forPost; //우편물 관련 요소 여부 private boolean forPost; //우편물 관련 요소 여부
private boolean downloadData; //다운로드 이력 기재 항목 여부
private String dscrp; //출력항목 설명 private String dscrp; //출력항목 설명
private String otptArtclNm; //출력항목명 private String otptArtclNm; //출력항목명

@ -78,16 +78,16 @@ public class Advntce extends PDFPrintFormat {
text("vrActno10","가상계좌번호10",""), text("vrActno10","가상계좌번호10",""),
text("epayNo","전자납부번호",""), text("epayNo","전자납부번호",""),
text("otptYmd","출력일자",""), text("otptYmd","출력일자","").offLog(),
text("otptDt","출력일시",""), text("otptDt","출력일시","").offLog(),
text("otptYYYY","출력년도",""), text("otptYYYY","출력년도","").offLog(),
text("otptMM","출력월",""), text("otptMM","출력월","").offLog(),
text("otptDD","출력일",""), text("otptDD","출력일","").offLog(),
text("offcsText","관인명",""), text("offcsText","관인명","").offLog(),
image("offcs","관인이미지","").size(20, 20), image("offcs","관인이미지","").size(20, 20).offLog(),
text("undefined","(미정)","미정항목") text("undefined","(미정)","미정항목").offLog()
); );
} }

@ -83,16 +83,16 @@ public class Nht extends PDFPrintFormat {
text("vrActno10","가상계좌번호10",""), text("vrActno10","가상계좌번호10",""),
text("epayNo","전자납부번호",""), text("epayNo","전자납부번호",""),
text("otptYmd","출력일자",""), text("otptYmd","출력일자","").offLog(),
text("otptDt","출력일시",""), text("otptDt","출력일시","").offLog(),
text("otptYYYY","출력년도",""), text("otptYYYY","출력년도","").offLog(),
text("otptMM","출력월",""), text("otptMM","출력월","").offLog(),
text("otptDD","출력일",""), text("otptDD","출력일","").offLog(),
text("offcsText","관인명",""), text("offcsText","관인명","").offLog(),
image("offcs","관인이미지","").size(20, 20), image("offcs","관인이미지","").size(20, 20).offLog(),
text("undefined","(미정)","미정항목") text("undefined","(미정)","미정항목").offLog()
); );
} }

@ -1745,7 +1745,8 @@ public class Sndb01Controller extends ApplicationController {
Map<String, Object> result = pdfWriter.makePdfFile("info", "advntce", printOption, dataObjectList); Map<String, Object> result = pdfWriter.makePdfFile("info", "advntce", printOption, dataObjectList);
mav.addAllObjects(result); mav.addAllObjects(result);
mav.addObject("downloadData", dataObjectList);
mav.addObject("dataNames", pdfWriter.filterDownloadDataNames());
return mav; return mav;
} }

@ -755,7 +755,8 @@ public class Sprt01Controller extends ApplicationController {
Map<String, Object> result = pdfWriter.makePdfFile("info", "advntce", printOption, dataObjectList); Map<String, Object> result = pdfWriter.makePdfFile("info", "advntce", printOption, dataObjectList);
mav.addAllObjects(result); mav.addAllObjects(result);
mav.addObject("downloadData", dataObjectList);
mav.addObject("dataNames", pdfWriter.filterDownloadDataNames());
return mav; return mav;
} }
@ -911,7 +912,8 @@ public class Sprt01Controller extends ApplicationController {
Map<String, Object> result = pdfWriter.makePdfFile("info", "nht", printOption, dataObjectList); Map<String, Object> result = pdfWriter.makePdfFile("info", "nht", printOption, dataObjectList);
mav.addAllObjects(result); mav.addAllObjects(result);
mav.addObject("downloadData", dataObjectList);
mav.addObject("dataNames", pdfWriter.filterDownloadDataNames());
return mav; return mav;
} }

Loading…
Cancel
Save