|
|
|
@ -34,6 +34,8 @@ public class PrintUtil {
|
|
|
|
|
|
|
|
|
|
private int totalPartFileCount;
|
|
|
|
|
|
|
|
|
|
private int fileNameIndex;
|
|
|
|
|
|
|
|
|
|
public String getFormatType() {
|
|
|
|
|
return this.formatType;
|
|
|
|
|
}
|
|
|
|
@ -173,7 +175,8 @@ public class PrintUtil {
|
|
|
|
|
if(!formatFileResultFolder.exists()) {
|
|
|
|
|
formatFileResultFolder.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
String resultHwpPath = formatFileResultFolderPath + File.separator + currentTime + ".hwp";
|
|
|
|
|
String resultHwpPath = formatFileResultFolderPath
|
|
|
|
|
+ File.separator + currentTime + "_" + (this.fileNameIndex++) + ".hwp";
|
|
|
|
|
|
|
|
|
|
HWPWriter.toFile(baseFormatFile, resultHwpPath);
|
|
|
|
|
return resultHwpPath;
|
|
|
|
@ -191,11 +194,11 @@ public class PrintUtil {
|
|
|
|
|
public void setGlobalInfo(PrintOption printOption, List<DataObject> dataObjectList, HWPFile baseFile) {
|
|
|
|
|
int totalDataCount = dataObjectList.size();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean privateInfoYn = true;
|
|
|
|
|
if(printOption.getPrivateInfoYn() != null && printOption.getPrivateInfoYn().equals("N")) {
|
|
|
|
|
privateInfoYn = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, String> globalVariable = printOption.getGlobalVariable();
|
|
|
|
|
|
|
|
|
|
if(this.formatName.equals("crdnList")){
|
|
|
|
@ -225,13 +228,85 @@ public class PrintUtil {
|
|
|
|
|
baseFileEditor.set("발신", instNm);
|
|
|
|
|
}
|
|
|
|
|
else if(this.formatName.equals("requestForDelivery")){
|
|
|
|
|
//TODO :
|
|
|
|
|
//파라미터 : 문서번호,사건번호
|
|
|
|
|
//체납자성명,체납자번호,차량번호,주소,교부청구금액,교부청구금액한글,
|
|
|
|
|
|
|
|
|
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
|
|
|
|
|
|
|
|
|
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) this.printRequestUserInfo.getInfo().get("instNm");
|
|
|
|
|
String deptNm = (String) this.printRequestUserInfo.getInfo().get("deptNm");
|
|
|
|
|
baseFileEditor.set("예금주", instNm + " " + deptNm);
|
|
|
|
|
|
|
|
|
|
String printRequestYmd = this.printRequestDt.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("한글 파일 출력 중 오류가 발생하였습니다.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(this.formatName.equals("reportOnClaims")){
|
|
|
|
|
//TODO :
|
|
|
|
|
|
|
|
|
|
ClickHereEditor baseFileEditor = new ClickHereEditor(baseFile);
|
|
|
|
|
|
|
|
|
|
baseFileEditor.set("주소", globalVariable.get("deptAddr"));
|
|
|
|
|
baseFileEditor.set("전화", globalVariable.get("deptTelno"));
|
|
|
|
|
baseFileEditor.set("팩스", globalVariable.get("deptFxno"));
|
|
|
|
|
baseFileEditor.set("담당자", this.printRequestUserInfo.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 = this.printRequestDt.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) this.printRequestUserInfo.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("한글 파일 출력 중 오류가 발생하였습니다.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -268,11 +343,22 @@ public class PrintUtil {
|
|
|
|
|
attachFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD")));
|
|
|
|
|
}
|
|
|
|
|
else if(this.formatName.equals("requestForDelivery")){
|
|
|
|
|
//TODO :
|
|
|
|
|
|
|
|
|
|
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")));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if(this.formatName.equals("reportOnClaims")){
|
|
|
|
|
//TODO :
|
|
|
|
|
|
|
|
|
|
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")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|