단속내역서 수정

main
이범준 12 months ago
parent d883a6bcb0
commit 77c203a1b9

@ -5,11 +5,12 @@ import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface; import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface;
import kr.dogfoot.hwplib.object.bodytext.control.Control; import kr.dogfoot.hwplib.object.bodytext.control.Control;
import kr.dogfoot.hwplib.object.bodytext.control.ControlType; import kr.dogfoot.hwplib.object.bodytext.control.ControlType;
import kr.dogfoot.hwplib.object.bodytext.control.table.Cell;
import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph; import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph;
import kr.dogfoot.hwplib.object.bodytext.paragraph.ParagraphList; 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.objectfinder.ControlFilter;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder; import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder;
import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphMerger;
public class AddUtil { public class AddUtil {
@ -37,14 +38,14 @@ public class AddUtil {
* @param attachHWPFile , baseHWPFile , cell * @param attachHWPFile , baseHWPFile , cell
* @return * @return
*/ */
public static void insertTableInCell(HWPFile attachHWPFile, HWPFile baseHWPFile, Cell cell) throws Exception { public static void insertTableInCell(HWPFile attachHWPFile, HWPFile baseHWPFile, String cellFieldName) throws Exception {
Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
ParagraphList cpl = CellFinder.findAll(baseHWPFile, cellFieldName).get(0).getParagraphList();
boolean isEmptyCell = true; boolean isEmptyCell = true;
ParagraphList cpl = cell.getParagraphList(); Paragraph attachParagraph = attachHWPFile.getBodyText().getSectionList().get(0).getParagraph(0);
if(cpl.getParagraphCount() >= 1) { if(cpl.getParagraphCount() >= 1) {
ArrayList<Control> cl = cpl.getParagraph(0).getControlList(); ArrayList<Control> cl = cpl.getParagraph(0).getControlList();
if(cl != null && cl.size() != 0) { if(cl != null && cl.size() != 0) {
@ -73,5 +74,13 @@ public class AddUtil {
ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, cpl); ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, cpl);
paraAdder.add(attachHWPFile, attachParagraph); 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);
}
} }
} }

@ -3,7 +3,6 @@ package cokr.xit.fims.cmmn.hwp;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -16,9 +15,7 @@ import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataFormat;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile; import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.object.bodytext.control.table.Cell;
import kr.dogfoot.hwplib.reader.HWPReader; import kr.dogfoot.hwplib.reader.HWPReader;
import kr.dogfoot.hwplib.tool.objectfinder.CellFinder;
import kr.dogfoot.hwplib.writer.HWPWriter; import kr.dogfoot.hwplib.writer.HWPWriter;
public class PrintUtil { public class PrintUtil {
@ -113,7 +110,14 @@ public class PrintUtil {
this.recordPerPartFile = 6; this.recordPerPartFile = 6;
break; break;
} }
case "requestForDelivery": {
this.recordPerPartFile = 7;
break;
}
case "reportOnClaims": {
this.recordPerPartFile = 7;
break;
}
} }
} }
@ -130,7 +134,18 @@ public class PrintUtil {
this.attachFormatFilePath = "format/crdnList_inner.hwp"; this.attachFormatFilePath = "format/crdnList_inner.hwp";
break; break;
} }
case "requestForDelivery": {
this.formatKorName = "교부청구서";
this.baseFormatFilePath = "format/requestForDelivery_root.hwp";
this.attachFormatFilePath = "format/requestForDelivery_inner.hwp";
break;
}
case "reportOnClaims": {
this.formatKorName = "채권신고서";
this.baseFormatFilePath = "format/reportOnClaims_root.hwp";
this.attachFormatFilePath = "format/reportOnClaims_inner.hwp";
break;
}
} }
} }
@ -210,6 +225,15 @@ public class PrintUtil {
} }
baseFileEditor.set("발신", instNm); baseFileEditor.set("발신", instNm);
} }
else if(this.formatName.equals("requestForDelivery")){
//TODO :
//파라미터 : 문서번호,사건번호
//체납자성명,체납자번호,차량번호,주소,교부청구금액,교부청구금액한글,
}
else if(this.formatName.equals("reportOnClaims")){
//TODO :
}
} }
/** . /** .
@ -244,13 +268,16 @@ public class PrintUtil {
attachFileEditor.set("납부기한", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD"))); attachFileEditor.set("납부기한", DataFormat.yyyy_mm_dd(dataObject.string("DUDT_YMD")));
attachFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD"))); attachFileEditor.set("수납일자", DataFormat.yyyy_mm_dd(dataObject.string("RCVMT_YMD")));
} }
else if(this.formatName.equals("requestForDelivery")){
//TODO :
}
ArrayList<Cell> cellList = CellFinder.findAll(baseFile, "내부"); else if(this.formatName.equals("reportOnClaims")){
Cell cell = cellList.get(0); //TODO :
}
AddUtil.insertTableInCell(attachFormatFile, baseFile, cell); AddUtil.insertTableInCell(attachFormatFile, baseFile, "내부");
} else { } else {

@ -106,6 +106,14 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
} }
} }
} else if(formatName.equals("requestForDelivery")) {
//TODO :
//query.set();
//dataObjectList = Mapper.selectList(query);
} else if(formatName.equals("reportOnClaims")) {
//TODO :
//query.set();
//dataObjectList = Mapper.selectList(query);
} }
int totalDataCount = dataObjectList.size(); int totalDataCount = dataObjectList.size();

@ -290,11 +290,11 @@ public class Sprt01Controller extends ApplicationController {
*/ */
public ModelAndView makeCrdnListFileFromHwpFormat(String privateInfoYn, String[] crdnIds) { public ModelAndView makeCrdnListFileFromHwpFormat(String privateInfoYn, String[] crdnIds) {
Map<String,String> result = null; Map<String,String> result = null;
String format = "crdnList";
PrintOption printOption = new PrintOption(); PrintOption printOption = new PrintOption();
printOption.setPrivateInfoYn(privateInfoYn); printOption.setPrivateInfoYn(privateInfoYn);
result = sprt01Service.makeFileFromHwpFormat("list", format, printOption ,crdnIds); result = sprt01Service.makeFileFromHwpFormat("list", "crdnList", printOption ,crdnIds);
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result); mav.addAllObjects(result);
@ -306,10 +306,10 @@ public class Sprt01Controller extends ApplicationController {
*/ */
public ModelAndView makeCrdnConfirmFileFromHwpFormat(String[] crdnIds) { public ModelAndView makeCrdnConfirmFileFromHwpFormat(String[] crdnIds) {
Map<String,String> result = null; Map<String,String> result = null;
String format = "crdnConfirm";
PrintOption printOption = new PrintOption(); PrintOption printOption = new PrintOption();
result = sprt01Service.makeFileFromHwpFormat("info", format, printOption, crdnIds); result = sprt01Service.makeFileFromHwpFormat("info", "crdnConfirm", printOption, crdnIds);
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result); mav.addAllObjects(result);
@ -334,8 +334,8 @@ public class Sprt01Controller extends ApplicationController {
public ModelAndView makeRequestForDeliveryFileFromHwpFormat(PrintOption printOption, String[] crdnIds) { public ModelAndView makeRequestForDeliveryFileFromHwpFormat(PrintOption printOption, String[] crdnIds) {
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
//TODO : 교부청구서 한글 파일 작성 Map<String,String> result = sprt01Service.makeFileFromHwpFormat("list", "requestForDelivery", printOption, crdnIds);
mav.addAllObjects(result);
return mav; return mav;
} }
@ -345,7 +345,8 @@ public class Sprt01Controller extends ApplicationController {
public ModelAndView makeReportOnClaimsFileFromHwpFormat(PrintOption printOption, String[] crdnIds) { public ModelAndView makeReportOnClaimsFileFromHwpFormat(PrintOption printOption, String[] crdnIds) {
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
//TODO : 채권신고서 한글 파일 작성 Map<String,String> result = sprt01Service.makeFileFromHwpFormat("list", "reportOnClaims", printOption, crdnIds);
mav.addAllObjects(result);
return mav; return mav;
} }

Loading…
Cancel
Save