교부청구서,채권신고서 출력 추가

main
이범준 12 months ago
parent 1d5cb3d038
commit 8b7e75dc61

@ -317,4 +317,8 @@ public class CmmnUtil {
return result.toString();
}
public static String convertNumberToHangul(int number) {
String numStr = Integer.toString(number);
return convertNumberToHangul(numStr);
}
}

@ -11,7 +11,7 @@ public class FactionUtil {
if(instNm.endsWith("구") || instNm.endsWith("군")) {
instNm += "청";
}
if(!jang) {
if(jang) {
instNm += "장";
}
return instNm;

@ -1,14 +1,9 @@
package cokr.xit.fims.cmmn.hwp;
import java.util.ArrayList;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface;
import kr.dogfoot.hwplib.object.bodytext.control.Control;
import kr.dogfoot.hwplib.object.bodytext.control.ControlType;
import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph;
import kr.dogfoot.hwplib.object.bodytext.paragraph.ParagraphList;
import kr.dogfoot.hwplib.tool.objectfinder.CellFinder;
import kr.dogfoot.hwplib.tool.objectfinder.ControlFilter;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphMerger;
@ -20,16 +15,18 @@ public class AddUtil {
*/
public static void appendToLast(HWPFile attachHWPFile, HWPFile baseHWPFile) throws Exception {
if (attachHWPFile != null && baseHWPFile != null) {
Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
if (attachHWPFile != null && baseHWPFile != null) {
Paragraph[] ps = attachHWPFile.getBodyText().getSectionList().get(0).getParagraphs();
ParagraphListInterface baseSection = baseHWPFile.getBodyText().getSectionList().get(0);
ParagraphListInterface baseSection = baseHWPFile.getBodyText().getLastSection();
ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, baseSection);
paraAdder.add(attachHWPFile, attachParagraph);
for(int i=0; i<ps.length; i++) {
Paragraph p = ps[i];
paraAdder.add(attachHWPFile, p);
}
}
}
@ -42,45 +39,15 @@ public class AddUtil {
ParagraphList cpl = CellFinder.findAll(baseHWPFile, cellFieldName).get(0).getParagraphList();
boolean isEmptyCell = true;
Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
if(cpl.getParagraphCount() >= 1) {
ArrayList<Control> cl = cpl.getParagraph(0).getControlList();
if(cl != null && cl.size() != 0) {
ControlFilter tableFilter = (control, paragrpah, section) -> {
ControlType ct = control.getType();
if(ct.getCtrlId() == ControlType.Table.getCtrlId()) {
return true;
} else {
return false;
}
};
for(Control c : cl) {
boolean matched = tableFilter.isMatched(c, null, null);
if(matched) {
isEmptyCell = false;
}
}
}
}
if(isEmptyCell) {
cpl.deleteAllParagraphs();
}
ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, cpl);
paraAdder.add(attachHWPFile, attachParagraph);
if(!isEmptyCell) {
ParagraphList cpl0 = CellFinder.findAll(baseHWPFile, cellFieldName).get(0).getParagraphList();
ParagraphMerger paraMerger = new ParagraphMerger();
paraMerger.merge(cpl0.getParagraph(1), cpl0.getParagraph(0));
cpl0.deleteParagraph(1);
}
ParagraphList cpl0 = CellFinder.findAll(baseHWPFile, cellFieldName).get(0).getParagraphList();
ParagraphMerger paraMerger = new ParagraphMerger();
paraMerger.merge(cpl0.getParagraph(1), cpl0.getParagraph(0));
cpl0.deleteParagraph(1);
}
}

@ -47,11 +47,12 @@ public class InsertingImageCell {
public static void IMPL_InsertPicture(HWPFile hwpFile, String fieldName, String imgFilePath) throws IOException {
if(imgFilePath != null && !imgFilePath.equals("")) {
InsertingImageCell tii = new InsertingImageCell();
tii.insertShapeWithImage(hwpFile, fieldName, imgFilePath);
File file = new File(imgFilePath);
if(file.exists()) {
InsertingImageCell tii = new InsertingImageCell();
tii.insertShapeWithImage(hwpFile, fieldName, imgFilePath);
}
}
}
private final String imageFileExt = "jpg";
@ -69,6 +70,7 @@ public class InsertingImageCell {
private void insertShapeWithImage(HWPFile hwpFile, String fieldName, String imgFilePath) throws IOException {
this.hwpFile = hwpFile;
this.fieldName = fieldName;
this.imageFilePath = imgFilePath;

@ -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")));
}

@ -14,6 +14,8 @@ public class SprtQuery extends CmmnQuery {
private String[] cvlcptDscsnIDs;
// ID
private String crdnId; // 단속 ID
private String[] crdnIDs;
private String rtpyrId; // 납부자 ID
private String levyExclId; // 부과 제외 ID
private String opnnId; // 의견 ID
@ -66,6 +68,16 @@ public class SprtQuery extends CmmnQuery {
return self();
}
public String[] getCrdnIDs() {
return ifEmpty(crdnIDs, () -> null);
}
public <T extends SprtQuery> T setCrdnIDs(String... crdnIDs) {
this.crdnIDs = crdnIDs;
return self();
}
public String getRtpyrId() {
return ifEmpty(rtpyrId, () -> null);
}

@ -20,6 +20,7 @@ import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnListMapper;
import cokr.xit.fims.sprt.PrintOption;
import cokr.xit.fims.sprt.SprtQuery;
import cokr.xit.fims.sprt.dao.IntegrationSearchMapper;
import cokr.xit.fims.sprt.service.Sprt01Service;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.component.AbstractServiceBean;
@ -57,6 +58,9 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
@Resource(name = "stngBean")
protected StngBean stngBean;
@Resource(name = "integrationSearchMapper")
protected IntegrationSearchMapper integrationSearchMapper;
@Override
public List<DataObject> getIntegrationDataList(SprtQuery query) {
return sprt01Bean.getIntegrationDataList(query);
@ -80,6 +84,9 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
factionBean.initUserInfo(userInfo);
printUtil.setPrintRequestUserInfo(userInfo);
DataObject sggStngInfo = stngBean.getStng("sgg");
DataObject deptStngInfo = stngBean.getStng("dept");
List<DataObject> dataObjectList = null;
if(formatName.equals("crdnList")) {
@ -111,21 +118,33 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
}
} else if(formatName.equals("requestForDelivery")) {
//TODO :
//query.set();
//dataObjectList = Mapper.selectList(query);
SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIDs(crdnIds);
dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
DataObject stngInfo = stngBean.getStng("dept");
Map<String, String> globalVariable = printOption.getGlobalVariable();
globalVariable.put("dtbnBankNm", stngInfo.string("DTBN_BANK_NM"));
globalVariable.put("dtbnActno", stngInfo.string("DTBN_ACTNO"));
globalVariable.put("dtbnBankNm", deptStngInfo.string("DTBN_BANK_NM"));
globalVariable.put("dtbnActno", deptStngInfo.string("DTBN_ACTNO"));
globalVariable.put("offcsFilePath", sggStngInfo.string("OFFCS_FILE_PATH"));
printOption.setGlobalVariable(globalVariable);
} else if(formatName.equals("reportOnClaims")) {
//TODO :
//query.set();
//dataObjectList = Mapper.selectList(query);
SprtQuery sprtQuery = new SprtQuery();
sprtQuery.setCrdnIDs(crdnIds);
dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery);
Map<String, String> globalVariable = printOption.getGlobalVariable();
String deptNm = (String) printUtil.getPrintRequestUserInfo().getInfo().get("deptNm");
String deptAddr = sggStngInfo.string("INST_FULL_ADDR") + " " + deptNm;
globalVariable.put("deptAddr", deptAddr);
globalVariable.put("deptTelno", deptStngInfo.string("DEPT_TELNO"));
globalVariable.put("deptFxno", deptStngInfo.string("DEPT_FXNO"));
globalVariable.put("offcsFilePath", sggStngInfo.string("OFFCS_FILE_PATH"));
printOption.setGlobalVariable(globalVariable);
}
int totalDataCount = dataObjectList.size();
@ -136,7 +155,6 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
try {
int dataIndex = 0;
for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) {
//새 파일 생성

@ -13,6 +13,8 @@ SELECT USER_ID
<select id="selectDeptStng" parameterType="string" resultType="dataobject">
/* 부서 설정정보 조회 stngMapper.selectDeptStng) */
SELECT DEPT_CD
, DEPT_TELNO <!-- 부서 전화번호 -->
, DEPT_FXNO <!-- 부서 팩스번호 -->
, DTBN_BANK_NM <!-- 교부 은행 명 -->
, DTBN_ACTNO <!-- 교부 계좌번호 -->
FROM TB_DEPT_INFO
@ -22,6 +24,11 @@ SELECT DEPT_CD
<select id="selectSggStng" parameterType="string" resultType="dataobject">
/* 시군구 설정정보 조회 stngMapper.selectSggStng) */
SELECT SGG_CD
, (CASE
WHEN INST_DADDR IS NULL OR INST_DADDR = ''
THEN INST_ADDR
ELSE CONCAT(INST_ADDR,' ',INST_DADDR)
END) AS INST_FULL_ADDR <!-- 기관 전체 주소 -->
, OFFCS_FILE_PATH <!-- 직인 파일 경로 -->
, OFFCS_FILE_NM <!-- 직인 파일 명 -->
FROM TB_SGG_INFO

@ -159,6 +159,9 @@ LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID)
LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID AND L.DEL_YN = 'N') /* 부과 대장 */
LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N') /* 수납 대장 */
WHERE C.DEL_YN = 'N'
<if test='crdnIDs != null'>
AND C.CRDN_ID IN (<foreach collection="crdnIDs" item="CRDN_ID" separator=",">#{CRDN_ID}</foreach>)
</if>
<if test='sggCd != null'>
AND C.SGG_CD = #{sggCd}
</if>

Loading…
Cancel
Save