한글 출력 pdf출력 수정
parent
ded0e973f0
commit
5e40fc10d9
@ -0,0 +1,62 @@
|
|||||||
|
package cokr.xit.fims.cmmn;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.UserInfo;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
|
||||||
|
public class PrintUtil {
|
||||||
|
|
||||||
|
public PrintUtil(){
|
||||||
|
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
this.printRequestDt = ymdhmsFormat.format(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int fileNameIndex = 0;
|
||||||
|
|
||||||
|
protected String printRequestDt;
|
||||||
|
|
||||||
|
protected UserInfo printRequestUserInfo;
|
||||||
|
|
||||||
|
public UserInfo getPrintRequestUserInfo() {
|
||||||
|
return this.printRequestUserInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
public void setPrintRequestUserInfo(UserInfo printRequestUserInfo) {
|
||||||
|
this.printRequestUserInfo = printRequestUserInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
public float mmToPt(float mm) {
|
||||||
|
return mm * 2.83465f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getTotalDataCount(List<DataObject> dataObjectList) {
|
||||||
|
int totalDataCount = dataObjectList.size();
|
||||||
|
return totalDataCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getPrivateInfoYn(PrintOption printOption) {
|
||||||
|
|
||||||
|
boolean privateInfoYn = true;
|
||||||
|
if(printOption != null && printOption.getPrivateInfoYn() != null && printOption.getPrivateInfoYn().equals("N")) {
|
||||||
|
privateInfoYn = false;
|
||||||
|
}
|
||||||
|
return privateInfoYn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,String> getGlobalVariable(PrintOption printOption) {
|
||||||
|
|
||||||
|
Map<String,String> map = new HashMap<String,String>();
|
||||||
|
if(printOption != null && printOption.getGlobalVariable() != null && !printOption.getGlobalVariable().isEmpty()) {
|
||||||
|
map = printOption.getGlobalVariable();
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public interface HWPFormatWriter {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 포맷 형식별 기초 설정 적용.
|
||||||
|
* @param hwpPrintUtil
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void setting(HWPPrintUtil hwpPrintUtil);
|
||||||
|
|
||||||
|
/** 한글파일 공통사항 적용
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList,
|
||||||
|
PrintOption printOption, HWPPrintUtil hwpPrintUtil);
|
||||||
|
|
||||||
|
/** 데이터 건별 한글파일 처리
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile, DataObject dataObject,
|
||||||
|
HWPPrintUtil hwpPrintUtil);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp.format;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
||||||
|
import cokr.xit.fims.cmmn.FactionUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.ClickHereEditor;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPFormatWriter;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPPrintUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public class CrdnConfirm implements HWPFormatWriter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setting(HWPPrintUtil hwpPrintUtil) {
|
||||||
|
hwpPrintUtil.setFormatName("crdnConfirm");
|
||||||
|
hwpPrintUtil.setFormatKorName("단속확인서");
|
||||||
|
|
||||||
|
hwpPrintUtil.setFormatType("info");
|
||||||
|
hwpPrintUtil.setRecordPerPartFile(1);
|
||||||
|
|
||||||
|
hwpPrintUtil.setBaseFormatFilePath("format/crdnConfirm.hwp");
|
||||||
|
hwpPrintUtil.setAttachFormatFilePath("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList, PrintOption printOption,
|
||||||
|
HWPPrintUtil hwpPrintUtil) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile,
|
||||||
|
DataObject dataObject, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
||||||
|
|
||||||
|
baseFileEditor.set("과태료", dataObject.string("TASK_SE_NM"));
|
||||||
|
baseFileEditor.set("차량번호", dataObject.string("VHRNO"));
|
||||||
|
String crdnYmdTm = dataObject.string("CRDN_YMD_TM");
|
||||||
|
crdnYmdTm = CmmnUtil.yyyy_mm_dd_hh_mm_ss(crdnYmdTm);
|
||||||
|
baseFileEditor.set("단속일시", crdnYmdTm);
|
||||||
|
|
||||||
|
baseFileEditor.set("위반내용", dataObject.string("VLTN_ARTCL"));
|
||||||
|
baseFileEditor.set("단속장소", dataObject.string("CRDN_PLC"));
|
||||||
|
baseFileEditor.set("단속동", dataObject.string("CRDN_STDG_NM"));
|
||||||
|
baseFileEditor.set("단속조", dataObject.string("TEAM_NM"));
|
||||||
|
baseFileEditor.set("소유자", dataObject.string("RTPYR_NM"));
|
||||||
|
baseFileEditor.set("주소", dataObject.string("RTPYR_FULL_ADDR"));
|
||||||
|
baseFileEditor.set("우편번호", dataObject.string("RTPYR_ZIP"));
|
||||||
|
|
||||||
|
String printRequestYmd = hwpPrintUtil.getPrintRequestDt().substring(0, 8);
|
||||||
|
String yyyy = printRequestYmd.substring(0, 4);
|
||||||
|
String mm = printRequestYmd.substring(4, 6);
|
||||||
|
String dd = printRequestYmd.substring(6, 8);
|
||||||
|
String ymd = yyyy+"년 "+mm+"월 "+dd+"일";
|
||||||
|
baseFileEditor.set("연월일", ymd);
|
||||||
|
|
||||||
|
String instNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
||||||
|
instNm = FactionUtil.getInstituteLeader(instNm, false);
|
||||||
|
baseFileEditor.set("발신", instNm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(!dataObject.string("PHOTO1").equals("")) {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "왼쪽위사진", dataObject.string("PHOTO1"));
|
||||||
|
}
|
||||||
|
if(!dataObject.string("PHOTO2").equals("")) {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "오른쪽위사진", dataObject.string("PHOTO2"));
|
||||||
|
}
|
||||||
|
if(!dataObject.string("PHOTO3").equals("")) {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "왼쪽아래사진", dataObject.string("PHOTO3"));
|
||||||
|
}
|
||||||
|
if(!dataObject.string("PHOTO4").equals("")) {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "오른쪽아래사진", dataObject.string("PHOTO4"));
|
||||||
|
}
|
||||||
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp.format;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
||||||
|
import cokr.xit.fims.cmmn.FactionUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.ClickHereEditor;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPFormatWriter;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPPrintUtil;
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataFormat;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public class CrdnList implements HWPFormatWriter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setting(HWPPrintUtil hwpPrintUtil) {
|
||||||
|
hwpPrintUtil.setFormatName("crdnList");
|
||||||
|
hwpPrintUtil.setFormatKorName("단속내역서");
|
||||||
|
|
||||||
|
hwpPrintUtil.setFormatType("list");
|
||||||
|
hwpPrintUtil.setRecordPerPartFile(6);
|
||||||
|
|
||||||
|
hwpPrintUtil.setBaseFormatFilePath("format/crdnList_root.hwp");
|
||||||
|
hwpPrintUtil.setAttachFormatFilePath("format/crdnList_inner.hwp");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList,
|
||||||
|
PrintOption printOption, HWPPrintUtil hwpPrintUtil
|
||||||
|
) {
|
||||||
|
|
||||||
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
||||||
|
|
||||||
|
String globalRtpyrNm = dataObjectList.get(0).string("RTPYR_NM");
|
||||||
|
String globalRtpyrNo = dataObjectList.get(0).string("RTPYR_NO");
|
||||||
|
String globalRtpyrFullAddr = dataObjectList.get(0).string("RTPYR_FULL_ADDR");
|
||||||
|
int globalTotalAmount = dataObjectList.stream().mapToInt(i -> i.number("LEVY_AMT").intValue()).sum();
|
||||||
|
|
||||||
|
//상단
|
||||||
|
baseFileEditor.set("성명", globalRtpyrNm);
|
||||||
|
if(hwpPrintUtil.getPrivateInfoYn(printOption)) {
|
||||||
|
baseFileEditor.set("주민번호", globalRtpyrNo);
|
||||||
|
} else {
|
||||||
|
baseFileEditor.set("주민번호", "*************");
|
||||||
|
}
|
||||||
|
|
||||||
|
baseFileEditor.set("주소", globalRtpyrFullAddr);
|
||||||
|
baseFileEditor.set("총건수", CmmnUtil.addCommaToNumber(hwpPrintUtil.getTotalDataCount(dataObjectList)));
|
||||||
|
baseFileEditor.set("총금액", CmmnUtil.addCommaToNumber(globalTotalAmount));
|
||||||
|
baseFileEditor.set("출력일시", CmmnUtil.yyyy_mm_dd_hh_mm_ss(hwpPrintUtil.getPrintRequestDt()));
|
||||||
|
|
||||||
|
String instNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
||||||
|
instNm = FactionUtil.getLastWord(instNm);
|
||||||
|
instNm = FactionUtil.getInstituteLeader(instNm, false);
|
||||||
|
baseFileEditor.set("발신", instNm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile,
|
||||||
|
DataObject dataObject, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor attachFileEditor = new ClickHereEditor(attachFile);
|
||||||
|
|
||||||
|
attachFileEditor.set("과태료", dataObject.string("TASK_SE_NM"));
|
||||||
|
attachFileEditor.set("시군구명", dataObject.string("SGG_NM"));
|
||||||
|
String crdnYmdTm = dataObject.string("CRDN_YMD_TM");
|
||||||
|
crdnYmdTm = CmmnUtil.yyyy_mm_dd_hh_mm_ss(crdnYmdTm);
|
||||||
|
attachFileEditor.set("단속일시", crdnYmdTm);
|
||||||
|
attachFileEditor.set("단속장소", dataObject.string("CRDN_PLC"));
|
||||||
|
attachFileEditor.set("차량번호", dataObject.string("VHRNO"));
|
||||||
|
attachFileEditor.set("대체차량번호", dataObject.string("RPM_SZR_VHRNO"));
|
||||||
|
attachFileEditor.set("고지번호", dataObject.string("GOJI_NO"));
|
||||||
|
attachFileEditor.set("금액", CmmnUtil.addCommaToNumber(dataObject.string("LEVY_AMT")));
|
||||||
|
attachFileEditor.set("가상계좌번호", dataObject.string("VR_ACTNO"));
|
||||||
|
attachFileEditor.set("전자납부번호", dataObject.string("EPAYNO"));
|
||||||
|
attachFileEditor.set("처리상태", dataObject.string("CRDN_STTS_NM"));
|
||||||
|
String crdnSttsChgDt = dataObject.string("CRDN_STTS_CHG_DT");
|
||||||
|
crdnSttsChgDt = DataFormat.yyyy_mm_dd(crdnSttsChgDt.substring(0, 8));
|
||||||
|
attachFileEditor.set("처리일자", crdnSttsChgDt);
|
||||||
|
attachFileEditor.set("납부기한", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD")));
|
||||||
|
attachFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD")));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp.format;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
||||||
|
import cokr.xit.fims.cmmn.FactionUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.ClickHereEditor;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPFormatWriter;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPPrintUtil;
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataFormat;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public class RcvmtConfirm implements HWPFormatWriter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setting(HWPPrintUtil hwpPrintUtil) {
|
||||||
|
hwpPrintUtil.setFormatName("rcvmtConfirm");
|
||||||
|
hwpPrintUtil.setFormatKorName("납부확인서");
|
||||||
|
|
||||||
|
hwpPrintUtil.setFormatType("info");
|
||||||
|
hwpPrintUtil.setRecordPerPartFile(1);
|
||||||
|
|
||||||
|
hwpPrintUtil.setBaseFormatFilePath("format/rcvmtConfirm.hwp");
|
||||||
|
hwpPrintUtil.setAttachFormatFilePath("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList, PrintOption printOption,
|
||||||
|
HWPPrintUtil hwpPrintUtil) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile,
|
||||||
|
DataObject dataObject, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
||||||
|
|
||||||
|
baseFileEditor.set("위반명1", dataObject.string("TASK_SE_NM"));
|
||||||
|
baseFileEditor.set("위반명2", dataObject.string("TASK_SE_NM"));
|
||||||
|
baseFileEditor.set("위반차량", dataObject.string("VHRNO"));
|
||||||
|
baseFileEditor.set("대체차량", dataObject.string("RPM_SZR_VHRNO"));
|
||||||
|
baseFileEditor.set("위반금액", CmmnUtil.addCommaToNumber(dataObject.string("FFNLG_AMT")));
|
||||||
|
baseFileEditor.set("단속일자", DataFormat.yyyy_mm_dd(dataObject.string("CRDN_YMD")));
|
||||||
|
baseFileEditor.set("단속장소", dataObject.string("CRDN_PLC"));
|
||||||
|
baseFileEditor.set("소유자", dataObject.string("RTPYR_NM"));
|
||||||
|
baseFileEditor.set("주민번호", dataObject.string("RTPYR_NO"));
|
||||||
|
baseFileEditor.set("주소", dataObject.string("RTPYR_FULL_ADDR"));
|
||||||
|
baseFileEditor.set("고지번호", dataObject.string("GOJI_NO"));
|
||||||
|
baseFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD")));
|
||||||
|
baseFileEditor.set("수납금액", CmmnUtil.addCommaToNumber(dataObject.string("RCVMT_AMT")));
|
||||||
|
|
||||||
|
baseFileEditor.set("연월일시분초", CmmnUtil.yyyy_mm_dd_hh_mm_ss(hwpPrintUtil.getPrintRequestDt()));
|
||||||
|
baseFileEditor.set("확인자", hwpPrintUtil.getPrintRequestUserInfo().getName());
|
||||||
|
|
||||||
|
String instNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
||||||
|
instNm = FactionUtil.getInstituteLeader(instNm, false);
|
||||||
|
baseFileEditor.set("발신", instNm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp.format;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
||||||
|
import cokr.xit.fims.cmmn.FactionUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.ClickHereEditor;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPFormatWriter;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPPrintUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataFormat;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public class ReportOnClaims implements HWPFormatWriter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setting(HWPPrintUtil hwpPrintUtil) {
|
||||||
|
hwpPrintUtil.setFormatName("채권신고서");
|
||||||
|
hwpPrintUtil.setFormatKorName("reportOnClaims");
|
||||||
|
|
||||||
|
hwpPrintUtil.setFormatType("list");
|
||||||
|
hwpPrintUtil.setRecordPerPartFile(7);
|
||||||
|
|
||||||
|
hwpPrintUtil.setBaseFormatFilePath("format/reportOnClaims_root.hwp");
|
||||||
|
hwpPrintUtil.setAttachFormatFilePath("format/reportOnClaims_inner.hwp");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList, PrintOption printOption,
|
||||||
|
HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
Map<String,String> globalVariable = hwpPrintUtil.getGlobalVariable(printOption);
|
||||||
|
|
||||||
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
||||||
|
|
||||||
|
baseFileEditor.set("주소", globalVariable.get("deptAddr"));
|
||||||
|
baseFileEditor.set("전화", globalVariable.get("deptTelno"));
|
||||||
|
baseFileEditor.set("팩스", globalVariable.get("deptFxno"));
|
||||||
|
baseFileEditor.set("담당자", hwpPrintUtil.getPrintRequestUserInfo().getName());
|
||||||
|
|
||||||
|
baseFileEditor.set("사건번호", globalVariable.get("caseNo"));
|
||||||
|
baseFileEditor.set("체납자성명", globalVariable.get("rtpyrNm"));
|
||||||
|
baseFileEditor.set("체납자번호", globalVariable.get("rtpyrNo"));
|
||||||
|
baseFileEditor.set("체납자주소", globalVariable.get("rtpyrFullAddr"));
|
||||||
|
|
||||||
|
int sumOfList = dataObjectList.stream().mapToInt(item -> item.number("SUM_AMT").intValue()).sum();
|
||||||
|
|
||||||
|
baseFileEditor.set("채권청구액", CmmnUtil.addCommaToNumber(sumOfList));
|
||||||
|
baseFileEditor.set("합계금액", CmmnUtil.addCommaToNumber(sumOfList));
|
||||||
|
baseFileEditor.set("합계금액한글", CmmnUtil.convertNumberToHangul(sumOfList));
|
||||||
|
|
||||||
|
String printRequestYmd = hwpPrintUtil.getPrintRequestDt().substring(0, 8);
|
||||||
|
String yyyy = printRequestYmd.substring(0, 4);
|
||||||
|
String mm = printRequestYmd.substring(4, 6);
|
||||||
|
String dd = printRequestYmd.substring(6, 8);
|
||||||
|
String ymd = yyyy+"년 "+mm+"월 "+dd+"일";
|
||||||
|
baseFileEditor.set("연월일", ymd);
|
||||||
|
|
||||||
|
String instNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
||||||
|
instNm = FactionUtil.getLastWord(instNm);
|
||||||
|
instNm = FactionUtil.getInstituteLeader(instNm, false);
|
||||||
|
baseFileEditor.set("발신", instNm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "직인", globalVariable.get("offcsFilePath"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile,
|
||||||
|
DataObject dataObject, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor attachFileEditor = new ClickHereEditor(attachFile);
|
||||||
|
|
||||||
|
attachFileEditor.set("년도", dataObject.string("FYR"));
|
||||||
|
attachFileEditor.set("과세번호", dataObject.string("GOJI_NO"));
|
||||||
|
attachFileEditor.set("법정기일", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD")));
|
||||||
|
attachFileEditor.set("세목", dataObject.string("TXITM_NM"));
|
||||||
|
attachFileEditor.set("세액", CmmnUtil.addCommaToNumber(dataObject.string("LEVY_PCPTAX")));
|
||||||
|
attachFileEditor.set("가산금", CmmnUtil.addCommaToNumber(dataObject.string("LEVY_ADAMT")));
|
||||||
|
attachFileEditor.set("합계", CmmnUtil.addCommaToNumber(dataObject.string("SUM_AMT")));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package cokr.xit.fims.cmmn.hwp.format;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
||||||
|
import cokr.xit.fims.cmmn.FactionUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.ClickHereEditor;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPFormatWriter;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.HWPPrintUtil;
|
||||||
|
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
|
||||||
|
import cokr.xit.fims.sprt.PrintOption;
|
||||||
|
import cokr.xit.foundation.data.DataFormat;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
import kr.dogfoot.hwplib.object.HWPFile;
|
||||||
|
|
||||||
|
public class RequestForDelivery implements HWPFormatWriter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setting(HWPPrintUtil hwpPrintUtil) {
|
||||||
|
hwpPrintUtil.setFormatName("교부청구서");
|
||||||
|
hwpPrintUtil.setFormatKorName("requestForDelivery");
|
||||||
|
|
||||||
|
hwpPrintUtil.setFormatType("list");
|
||||||
|
hwpPrintUtil.setRecordPerPartFile(7);
|
||||||
|
|
||||||
|
hwpPrintUtil.setBaseFormatFilePath("format/requestForDelivery_root.hwp");
|
||||||
|
hwpPrintUtil.setAttachFormatFilePath("format/requestForDelivery_inner.hwp");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeGlobalInfo(HWPFile baseFile, List<DataObject> dataObjectList,
|
||||||
|
PrintOption printOption, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
||||||
|
|
||||||
|
Map<String,String> globalVariable = hwpPrintUtil.getGlobalVariable(printOption);
|
||||||
|
|
||||||
|
baseFileEditor.set("문서번호", globalVariable.get("docNo"));
|
||||||
|
baseFileEditor.set("사건번호", globalVariable.get("caseNo"));
|
||||||
|
baseFileEditor.set("수신", globalVariable.get("receiver"));
|
||||||
|
baseFileEditor.set("체납자성명", globalVariable.get("rtpyrNm"));
|
||||||
|
baseFileEditor.set("체납자번호", globalVariable.get("rtpyrNo"));
|
||||||
|
baseFileEditor.set("차량번호", globalVariable.get("vhrno"));
|
||||||
|
baseFileEditor.set("주소", globalVariable.get("rtpyrFullAddr"));
|
||||||
|
|
||||||
|
int sumOfList = dataObjectList.stream().mapToInt(item -> item.number("SUM_AMT").intValue()).sum();
|
||||||
|
|
||||||
|
baseFileEditor.set("합계금액", CmmnUtil.addCommaToNumber(sumOfList));
|
||||||
|
baseFileEditor.set("교부청구금액", CmmnUtil.addCommaToNumber(sumOfList));
|
||||||
|
baseFileEditor.set("교부청구금액한글", CmmnUtil.convertNumberToHangul(sumOfList));
|
||||||
|
|
||||||
|
baseFileEditor.set("개설은행", globalVariable.get("dtbnBankNm"));
|
||||||
|
baseFileEditor.set("계좌번호", globalVariable.get("dtbnActno"));
|
||||||
|
|
||||||
|
String instNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("instNm");
|
||||||
|
String deptNm = (String) hwpPrintUtil.getPrintRequestUserInfo().getInfo().get("deptNm");
|
||||||
|
baseFileEditor.set("예금주", instNm + " " + deptNm);
|
||||||
|
|
||||||
|
String printRequestYmd = hwpPrintUtil.getPrintRequestDt().substring(0, 8);
|
||||||
|
String yyyy = printRequestYmd.substring(0, 4);
|
||||||
|
String mm = printRequestYmd.substring(4, 6);
|
||||||
|
String dd = printRequestYmd.substring(6, 8);
|
||||||
|
String ymd = yyyy+"년 "+mm+"월 "+dd+"일";
|
||||||
|
baseFileEditor.set("연월일", ymd);
|
||||||
|
|
||||||
|
instNm = FactionUtil.getLastWord(instNm);
|
||||||
|
instNm = FactionUtil.getInstituteLeader(instNm, false);
|
||||||
|
baseFileEditor.set("발신", instNm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
InsertingImageCell.IMPL_InsertPicture(baseFile, "직인", globalVariable.get("offcsFilePath"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSingleDataInfo(HWPFile baseFile, HWPFile attachFile,
|
||||||
|
DataObject dataObject, HWPPrintUtil hwpPrintUtil) {
|
||||||
|
|
||||||
|
ClickHereEditor attachFileEditor = new ClickHereEditor(attachFile);
|
||||||
|
|
||||||
|
attachFileEditor.set("징수과목", dataObject.string("TXITM_NM"));
|
||||||
|
attachFileEditor.set("고지번호", dataObject.string("GOJI_NO"));
|
||||||
|
attachFileEditor.set("과태료계", CmmnUtil.addCommaToNumber(dataObject.string("SUM_AMT")));
|
||||||
|
attachFileEditor.set("법정기일", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD")));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cokr.xit.fims.cmmn.pdf;
|
||||||
|
|
||||||
|
public class PDFCoordinate {
|
||||||
|
private float x;
|
||||||
|
private float y;
|
||||||
|
private float maxY;
|
||||||
|
public PDFCoordinate(float xpt, float ypt, float maxY) {
|
||||||
|
this.x = xpt;
|
||||||
|
this.y = ypt;
|
||||||
|
this.maxY = maxY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float[] offset() {
|
||||||
|
return new float[] {x, -y};
|
||||||
|
}
|
||||||
|
|
||||||
|
public float[] absolute() {
|
||||||
|
return new float[] {x, maxY-y};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cokr.xit.fims.cmmn.pdf.format;
|
||||||
|
|
||||||
|
public class Advntce {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cokr.xit.fims.sprt;
|
||||||
|
|
||||||
|
import cokr.xit.fims.cmmn.CmmnQuery;
|
||||||
|
|
||||||
|
public class OtptStngQuery extends CmmnQuery {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//발송구분코드
|
||||||
|
private String sndngSeCd;
|
||||||
|
|
||||||
|
//출력용지구분코드
|
||||||
|
private String otptPaperSeCd;
|
||||||
|
|
||||||
|
public String getSndngSeCd() {
|
||||||
|
return ifEmpty(sndngSeCd, () -> null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T extends OtptStngQuery> T setSndngSeCd(String sndngSeCd) {
|
||||||
|
this.sndngSeCd = sndngSeCd;
|
||||||
|
return self();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOtptPaperSeCd() {
|
||||||
|
return ifEmpty(otptPaperSeCd, () -> null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T extends OtptStngQuery> T setOtptPaperSeCd(String otptPaperSeCd) {
|
||||||
|
this.otptPaperSeCd = otptPaperSeCd;
|
||||||
|
return self();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package cokr.xit.fims.sprt.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
|
||||||
|
|
||||||
|
import cokr.xit.fims.sprt.OtptStngQuery;
|
||||||
|
import cokr.xit.foundation.component.AbstractMapper;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
|
||||||
|
@Mapper("otptStngMapper")
|
||||||
|
public interface OtptStngMapper extends AbstractMapper {
|
||||||
|
|
||||||
|
/**지정한 조건에 따라 출력물 설정을 조회한다..<br />
|
||||||
|
* @param query 출력물 설정 조회 조건
|
||||||
|
* @return 출력물 설정 항목
|
||||||
|
*/
|
||||||
|
List<DataObject> selectOtptStngList(OtptStngQuery query);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cokr.xit.fims.sprt.dao.OtptStngMapper">
|
||||||
|
|
||||||
|
<select id="" parameterType="cokr.xit.fims.sprt.OtptStngQuery" resultType="dataobject">
|
||||||
|
/* 출력 설정 조회(otptStngMapper.selectOtptStngList) */
|
||||||
|
SELECT OTPT_FORM_ID
|
||||||
|
, SGG_CD
|
||||||
|
, TASK_SE_CD
|
||||||
|
, SNDNG_SE_CD
|
||||||
|
, OTPT_PAPER_SE_CD
|
||||||
|
, COL_NM
|
||||||
|
, OTPT_NM
|
||||||
|
, OTPT_BSC_VL
|
||||||
|
, LEFT_PSTN
|
||||||
|
, TOP_PSTN
|
||||||
|
, WIDTH_SZ
|
||||||
|
, HEIGHT_SZ
|
||||||
|
, FONT_NM
|
||||||
|
, FONT_SZ
|
||||||
|
, FONT_COLOR
|
||||||
|
, FONT_STYLE
|
||||||
|
FROM TB_OTPT_FORM
|
||||||
|
WHERE USE_YN = 'Y'
|
||||||
|
AND SGG_CD = #{sggCd}
|
||||||
|
AND TASK_SE_CD = #{taskSeCd}
|
||||||
|
AND SNDNG_SE_CD = #{sndngSeCd}
|
||||||
|
AND OTPT_PAPER_SE_CD = #{otptPaperSeCd}
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue