|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package cokr.xit.fims.cmmn.pdf.format;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
|
import cokr.xit.fims.cmmn.FactionUtil;
|
|
|
|
|
import cokr.xit.fims.cmmn.pdf.PDFFormat;
|
|
|
|
|
import cokr.xit.fims.cmmn.pdf.PDFPrintUtil;
|
|
|
|
|
import cokr.xit.fims.sprt.PrintOption;
|
|
|
|
@ -12,32 +14,249 @@ import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
public class Advntce extends PDFFormat {
|
|
|
|
|
|
|
|
|
|
public Advntce(){
|
|
|
|
|
addForPost(
|
|
|
|
|
text("postReceiverAddr","").post().a4(0, 0).letter(0, 0),
|
|
|
|
|
text("postReceiverDtlAddr","").post().a4(0, 0).letter(0, 0),
|
|
|
|
|
text("postReceiverZip","").a4(0, 0).letter(0, 0),
|
|
|
|
|
text("postReceiver","").a4(0, 0).letter(0, 0),
|
|
|
|
|
|
|
|
|
|
image("postSenderLogo","").a4(10, 0).letter(0, 0).size(0, 0),
|
|
|
|
|
text("postSenderInst","").a4(10, 10).letter(0, 0),
|
|
|
|
|
text("postSenderDept","").a4(50, 10).letter(0, 0),
|
|
|
|
|
text("postSenderAddr","").a4(10, 20).letter(0, 0),
|
|
|
|
|
text("postSenderDtlAddr","").a4(10, 30).letter(0, 0),
|
|
|
|
|
text("postSenderZip","").a4(10, 40).letter(0, 0),
|
|
|
|
|
text("postSenderTel","").a4(10, 50).letter(0, 0),
|
|
|
|
|
text("postSenderFax","").a4(50, 50).letter(0, 0)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
add(
|
|
|
|
|
text("CRDN_YMD","").a4(105, 150).letter(0, 0),
|
|
|
|
|
text("VHRNO","").a4(30, 30).letter(0, 0)
|
|
|
|
|
image("background","").a4(0, 0).letter(0, 0).size(0, 0),
|
|
|
|
|
image("photo1","").a4(0, 0).letter(0, 0).size(0, 0),
|
|
|
|
|
|
|
|
|
|
text("rtpyrNm",""),
|
|
|
|
|
text("rtpyrNo",""),
|
|
|
|
|
text("rtpyrAddr",""),
|
|
|
|
|
text("rtpyrDtlAddr",""),
|
|
|
|
|
text("rtpyrFullAddr",""),
|
|
|
|
|
|
|
|
|
|
text("vhrno",""),
|
|
|
|
|
text("crdnYmd",""),
|
|
|
|
|
text("crdnYmdTm",""),
|
|
|
|
|
text("crdnPlc",""),
|
|
|
|
|
text("ffnlgCarmdlNm",""),
|
|
|
|
|
text("vltnArtcl",""),
|
|
|
|
|
text("vltnLawNm",""),
|
|
|
|
|
text("crdnSn",""),
|
|
|
|
|
|
|
|
|
|
//image("OFFCS1","OFFCS").a4(0, 0).letter(0, 0).size(0, 0),
|
|
|
|
|
//image("OFFCS2","OFFCS").a4(0, 0).letter(0, 0).size(0, 0),
|
|
|
|
|
//image("OFFCS3","OFFCS").a4(0, 0).letter(0, 0).size(0, 0)
|
|
|
|
|
text("amt",""),
|
|
|
|
|
text("untilYmd",""),
|
|
|
|
|
|
|
|
|
|
text("vrActno",""),
|
|
|
|
|
text("vrActno1",""),
|
|
|
|
|
text("vrActno2",""),
|
|
|
|
|
text("vrActno3",""),
|
|
|
|
|
text("vrActno4",""),
|
|
|
|
|
text("vrActno5",""),
|
|
|
|
|
text("vrActno6",""),
|
|
|
|
|
text("vrActno7",""),
|
|
|
|
|
text("vrActno8",""),
|
|
|
|
|
text("vrActno9",""),
|
|
|
|
|
text("vrActno10",""),
|
|
|
|
|
text("epayNo",""),
|
|
|
|
|
|
|
|
|
|
text("otptYmd",""),
|
|
|
|
|
text("offcsText",""),
|
|
|
|
|
image("offcs","").size(20, 20)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getMappingValue(String otptNm, String defaultValue,
|
|
|
|
|
public String getMappingValue(String otptNm, String defaultValue, boolean forPost,
|
|
|
|
|
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
|
|
|
|
|
|
|
|
|
|
String result = "";
|
|
|
|
|
if(forPost) {
|
|
|
|
|
return this.getValueForPost(otptNm, defaultValue, dataObject, printOption, pdfPrintUtil);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch(otptNm) {
|
|
|
|
|
case "VHRNO" -> {
|
|
|
|
|
case "background" -> {
|
|
|
|
|
result = dataObject.string("");
|
|
|
|
|
}
|
|
|
|
|
case "photo1" -> {
|
|
|
|
|
result = dataObject.string("CRDN_PHOTO1");
|
|
|
|
|
}
|
|
|
|
|
case "photo2" -> {
|
|
|
|
|
result = dataObject.string("CRDN_PHOTO2");
|
|
|
|
|
}
|
|
|
|
|
case "photo3" -> {
|
|
|
|
|
result = dataObject.string("CRDN_PHOTO3");
|
|
|
|
|
}
|
|
|
|
|
case "photo4" -> {
|
|
|
|
|
result = dataObject.string("CRDN_PHOTO4");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "rtpyrNm" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_NM");
|
|
|
|
|
}
|
|
|
|
|
case "rtpyrNo" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_NO");
|
|
|
|
|
}
|
|
|
|
|
case "rtpyrAddr" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_ADDR");
|
|
|
|
|
}
|
|
|
|
|
case "rtpyrDtlAddr" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_DTL_ADDR");
|
|
|
|
|
}
|
|
|
|
|
case "rtpyrFullAddr" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_FULL_ADDR");
|
|
|
|
|
}
|
|
|
|
|
case "rtpyrZip" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_ZIP");
|
|
|
|
|
}
|
|
|
|
|
case "vhrno" -> {
|
|
|
|
|
result = dataObject.string("VHRNO");
|
|
|
|
|
}
|
|
|
|
|
case "CRDN_YMD" -> {
|
|
|
|
|
result = DataFormat.yyyy_mm_dd("CRDN_YMD");
|
|
|
|
|
case "crdnYmd" -> {
|
|
|
|
|
result = DataFormat.yyyy_mm_dd(dataObject.string("CRDN_YMD"));
|
|
|
|
|
}
|
|
|
|
|
case "crdnYmdTm" -> {
|
|
|
|
|
result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM"));
|
|
|
|
|
}
|
|
|
|
|
case "crdnPlc" -> {
|
|
|
|
|
result = dataObject.string("CRDN_PLC");
|
|
|
|
|
}
|
|
|
|
|
case "ffnlgCarmdlNm" -> {
|
|
|
|
|
result = dataObject.string("FFNLG_CARMDL_NM");
|
|
|
|
|
}
|
|
|
|
|
case "vltnArtcl" -> {
|
|
|
|
|
result = dataObject.string("VLTN_ARTCL");
|
|
|
|
|
}
|
|
|
|
|
case "vltnLawNm" -> {
|
|
|
|
|
result = dataObject.string("VLTN_LAW_NM");
|
|
|
|
|
}
|
|
|
|
|
case "crdnSn" -> {
|
|
|
|
|
result = dataObject.string("CRDN_SN");
|
|
|
|
|
}
|
|
|
|
|
case "amt" -> {
|
|
|
|
|
result = CmmnUtil.addCommaToNumber(dataObject.string(""));
|
|
|
|
|
}
|
|
|
|
|
case "untilYmd" -> {
|
|
|
|
|
result = DataFormat.yyyy_mm_dd(dataObject.string(""));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "vrActno" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno1" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO1");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno2" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO2");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno3" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO3");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno4" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO4");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno5" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO5");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno6" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO6");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno7" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO7");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno8" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO8");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno9" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO9");
|
|
|
|
|
}
|
|
|
|
|
case "vrActno10" -> {
|
|
|
|
|
result = dataObject.string("VR_ACTNO10");
|
|
|
|
|
}
|
|
|
|
|
case "epayNo" -> {
|
|
|
|
|
result = dataObject.string("EPAY_NO");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "otptYmd" -> {
|
|
|
|
|
result = DataFormat.yyyy_mm_dd(pdfPrintUtil.getPrintRequestDt().substring(0,8));
|
|
|
|
|
}
|
|
|
|
|
case "otptDt" -> {
|
|
|
|
|
result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(pdfPrintUtil.getPrintRequestDt());
|
|
|
|
|
}
|
|
|
|
|
case "otptYYYY" -> {
|
|
|
|
|
result = pdfPrintUtil.getPrintRequestDt().substring(0,4);
|
|
|
|
|
}
|
|
|
|
|
case "otptMM" -> {
|
|
|
|
|
result = pdfPrintUtil.getPrintRequestDt().substring(4,6);
|
|
|
|
|
}
|
|
|
|
|
case "otptDD" -> {
|
|
|
|
|
result = pdfPrintUtil.getPrintRequestDt().substring(6,8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "offcsText" -> {
|
|
|
|
|
String instNm = (String) pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
|
|
|
|
instNm = FactionUtil.getLastWord(instNm);
|
|
|
|
|
instNm = FactionUtil.getInstituteLeader(instNm, true);
|
|
|
|
|
result = instNm;
|
|
|
|
|
}
|
|
|
|
|
case "offcs" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("offcsFilePath");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getValueForPost(String otptNm, String defaultValue,
|
|
|
|
|
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
switch(otptNm) {
|
|
|
|
|
case "postReceiverAddr" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_ADDR");
|
|
|
|
|
}
|
|
|
|
|
case "postReceiverDtlAddr" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_DTL_ADDR");
|
|
|
|
|
}
|
|
|
|
|
case "postReceiverZip" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_ZIP");
|
|
|
|
|
}
|
|
|
|
|
case "postReceiver" -> {
|
|
|
|
|
result = dataObject.string("RTPYR_NM");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderLogo" -> {
|
|
|
|
|
result = dataObject.string("");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderInst" -> {
|
|
|
|
|
result = (String)pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderDept" -> {
|
|
|
|
|
result = (String)pdfPrintUtil.getPrintRequestUserInfo().getInfo().get("deptNm");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderAddr" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("instAddr");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderDtlAddr" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("instDaddr");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderZip" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("isntZip");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderTel" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("deptTelno");
|
|
|
|
|
}
|
|
|
|
|
case "postSenderFax" -> {
|
|
|
|
|
result = printOption.getGlobalVariable().get("deptFxno");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|