diff --git a/pom.xml b/pom.xml index 084354d5..ac215e06 100644 --- a/pom.xml +++ b/pom.xml @@ -185,6 +185,11 @@ 3.5.3 + + cokr.xit.app + app-support + 0.0.1-SNAPSHOT + diff --git a/src/main/java/cokr/xit/fims/cmmn/FimsPrintOption.java b/src/main/java/cokr/xit/fims/cmmn/FimsPrintOption.java new file mode 100644 index 00000000..f6f8ad29 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/FimsPrintOption.java @@ -0,0 +1,16 @@ +package cokr.xit.fims.cmmn; + +import cokr.xit.applib.PrintOption; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class FimsPrintOption extends PrintOption { + + /** + * 업무구분 + */ + private String taskSeCd; + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/OutsourcingFileMaker.java b/src/main/java/cokr/xit/fims/cmmn/OutsourcingFileMaker.java index 9c08d8d3..2d4e6ab4 100644 --- a/src/main/java/cokr/xit/fims/cmmn/OutsourcingFileMaker.java +++ b/src/main/java/cokr/xit/fims/cmmn/OutsourcingFileMaker.java @@ -25,13 +25,13 @@ import cokr.xit.foundation.data.DataObject; public class OutsourcingFileMaker { protected String printKorName; - protected PrintOption printOption; + protected FimsPrintOption printOption; protected List data; protected List printStngItems; protected String resultZipFilePath; - public OutsourcingFileMaker(String printKorName, PrintOption printOption, List printStngItems, + public OutsourcingFileMaker(String printKorName, FimsPrintOption printOption, List printStngItems, List data){ this.printKorName = printKorName; this.printOption = printOption; diff --git a/src/main/java/cokr/xit/fims/cmmn/Print.java b/src/main/java/cokr/xit/fims/cmmn/Print.java deleted file mode 100644 index 6a684db0..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/Print.java +++ /dev/null @@ -1,113 +0,0 @@ -package cokr.xit.fims.cmmn; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import cokr.xit.foundation.UserInfo; - -public class Print { - - public Print(){ - SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss"); - this.printRequestDt = ymdhmsFormat.format(new Date()); - } - - protected String printRequestDt; - - protected UserInfo printRequestUserInfo; - - protected int fileNameIndex = 0; - - protected String extension; - - protected String formatName; - - protected String formatKorName; - - public String setExtension(String extension) { - return this.extension = extension; - } - - public String getFormatName() { - return this.formatName; - } - - public void setFormatName(String formatName) { - this.formatName = formatName; - } - - public String getFormatKorName() { - return this.formatKorName; - } - - public void setFormatKorName(String formatKorName) { - this.formatKorName = formatKorName; - } - - public UserInfo getPrintRequestUserInfo() { - return this.printRequestUserInfo; - } - - public void setPrintRequestUserInfo(UserInfo printRequestUserInfo) { - this.printRequestUserInfo = printRequestUserInfo; - } - - public String getPrintRequestDt() { - return this.printRequestDt; - } - - public void setPrintRequestDt(String printRequestDt) { - this.printRequestDt = printRequestDt; - } - - - public int getFileNameIndex() { - return this.fileNameIndex; - } - public int setFileNameIndex(int fileNameIndex) { - return this.fileNameIndex = fileNameIndex; - } - - - public boolean getPrivateInfoYn(PrintOption printOption) { - - boolean privateInfoYn = true; - if(printOption != null && printOption.getPrivateInfoYn() != null && printOption.getPrivateInfoYn().equals("N")) { - privateInfoYn = false; - } - return privateInfoYn; - } - - public Map getGlobalVariable(PrintOption printOption) { - - Map map = new HashMap(); - if(printOption != null && printOption.getGlobalVariable() != null && !printOption.getGlobalVariable().isEmpty()) { - map = printOption.getGlobalVariable(); - } - return map; - } - - public String pathForNewFile(){ - - SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss"); - String currentTime = ymdhmsFormat.format(new Date()); - String year = currentTime.substring(0, 4); - String month = currentTime.substring(4, 6); - String day = currentTime.substring(6, 8); - String formatFileResultRootPath = "files" + File.separator + "temp" + File.separator + "print"; - String formatFileResultFolderPath = formatFileResultRootPath - + File.separator + year + File.separator + month + File.separator + day; - File formatFileResultFolder = new File(formatFileResultFolderPath); - if(!formatFileResultFolder.exists()) { - formatFileResultFolder.mkdirs(); - } - String resultPath = formatFileResultFolderPath + File.separator + currentTime +"_"+ this.getFileNameIndex() + "."+this.extension; - - this.setFileNameIndex(this.getFileNameIndex()+1); - - return resultPath; - } -} diff --git a/src/main/java/cokr/xit/fims/cmmn/PrintOption.java b/src/main/java/cokr/xit/fims/cmmn/PrintOption.java deleted file mode 100644 index 13dd2ff1..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/PrintOption.java +++ /dev/null @@ -1,32 +0,0 @@ -package cokr.xit.fims.cmmn; - -import java.util.Map; - -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -public class PrintOption { - - /** - * 개인정보 표시 여부 - */ - private String privateInfoYn; - - /** - * 용지구분 - */ - private String paperSeCd; - - /** - * 업무구분 - */ - private String taskSeCd; - - /** - * 전역 변수 - */ - private Map globalVariable; - -} diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/HwpMerge.java b/src/main/java/cokr/xit/fims/cmmn/hwp/HwpMerge.java deleted file mode 100644 index fc6d992a..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/HwpMerge.java +++ /dev/null @@ -1,32 +0,0 @@ -package cokr.xit.fims.cmmn.hwp; -import kr.dogfoot.hwplib.object.HWPFile; -import kr.dogfoot.hwplib.object.bodytext.ParagraphListInterface; -import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph; -import kr.dogfoot.hwplib.tool.paragraphadder.ParagraphAdder; - -public class HwpMerge { - - /**한글파일을 병합한다. - * @param attachHWPFile 기준파일 마지막 페이지에 붙일 파일, baseHWPFile 기준 파일 - * @return - */ - public static void appendToLast(HWPFile attachHWPFile, HWPFile baseHWPFile) throws Exception { - - if (attachHWPFile != null && baseHWPFile != null) { - - Paragraph[] ps = attachHWPFile.getBodyText().getSectionList().get(0).getParagraphs(); - - ParagraphListInterface baseSection = baseHWPFile.getBodyText().getLastSection(); - - ParagraphAdder paraAdder = new ParagraphAdder(baseHWPFile, baseSection); - - for(int i=0; i find = ControlFinder.find(writer.getFile(), (control, paragrpah, section) -> { - if(control.getType().equals(ControlType.Table)) { - ArrayList rl = ((ControlTable)control).getRowList(); - if(rl.size() == 1) { - ArrayList cl = rl.get(0).getCellList(); - if(cl.size() == 1) { - String fn = cl.get(0).getListHeader().getFieldName(); - if(fn != null && !fn.equals("")) { - if(fn.equals("직인")) { - return true; - } - } - } - } - } - return false; - }); - - if(find != null && !find.isEmpty()) { - ControlTable tableForOffcs = (ControlTable) find.get(0); - Cell cell = tableForOffcs.getRowList().get(0).getCellList().get(0); - return cell; - } - - return null; - } -} diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java index f89c4260..b037884e 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java @@ -2,8 +2,9 @@ package cokr.xit.fims.cmmn.hwp.format; import java.util.List; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.format.HWPFormat; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -13,7 +14,7 @@ import cokr.xit.foundation.data.DataObject; */ public class CrdnConfirm extends HWPFormat { - public CrdnConfirm(Print print, PrintOption printOption, List dataObjectList) { + public CrdnConfirm(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = dataObjectList.size(); this.formatFilePath = "template/hwp/crdnConfirm.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnList.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnList.java index 549df78a..7f47870a 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnList.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnList.java @@ -4,8 +4,9 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.IntStream; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.format.HWPFormat; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -15,7 +16,7 @@ import cokr.xit.foundation.data.DataObject; */ public class CrdnList extends HWPFormat { - public CrdnList(Print print, PrintOption printOption, List dataObjectList) { + public CrdnList(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = 1; this.formatFilePath = "template/hwp/crdnList.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CvlcptOrgn.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CvlcptOrgn.java index 5040f361..b9503ceb 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CvlcptOrgn.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CvlcptOrgn.java @@ -1,13 +1,13 @@ package cokr.xit.fims.cmmn.hwp.format; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.format.HWPFormat; import cokr.xit.base.docs.hwp.HWPWriter; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; import kr.dogfoot.hwplib.object.HWPFile; @@ -16,7 +16,7 @@ import kr.dogfoot.hwplib.object.HWPFile; public class CvlcptOrgn extends HWPFormat { private List data2 = null; - public CvlcptOrgn(Print print, PrintOption printOption, List dataObjectList) { + public CvlcptOrgn(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = 1; this.formatFilePath = "template/hwp/cvlcptOrgnl_text.hwp"; @@ -52,7 +52,7 @@ public class CvlcptOrgn extends HWPFormat { } @Override - public HashMap makeFile(){ + public HWPFormat makeFile(){ HWPFile hwpFile = HWPWriter.classpath(this.formatFilePath); this.writer = new HWPWriter(hwpFile); @@ -82,7 +82,9 @@ public class CvlcptOrgn extends HWPFormat { } } - return getResult(); + this.merge(); + + return this; } @@ -92,7 +94,6 @@ public class CvlcptOrgn extends HWPFormat { if(this.formatFilePath.equals("template/hwp/cvlcptOrgnl_text.hwp")) { - DataObject one = data.get(0); writer.setValue("신청자", one.string("CVLCPT_APLCNT_NM")); diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsnList.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsnList.java index 8795826a..23fb53e5 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsnList.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/DlbrDecsnList.java @@ -3,13 +3,14 @@ package cokr.xit.fims.cmmn.hwp.format; import java.util.ArrayList; import java.util.List; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.format.HWPFormat; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.foundation.data.DataObject; public class DlbrDecsnList extends HWPFormat { - public DlbrDecsnList(Print print, PrintOption printOption, List dataObjectList) { + public DlbrDecsnList(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = dataObjectList.size(); this.formatFilePath = "template/hwp/opnnDlbrDecsnForm.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/HWPFormat.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/HWPFormat.java deleted file mode 100644 index a3e02697..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/HWPFormat.java +++ /dev/null @@ -1,105 +0,0 @@ -package cokr.xit.fims.cmmn.hwp.format; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import cokr.xit.base.docs.hwp.HWPWriter; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; -import cokr.xit.fims.cmmn.hwp.HwpMerge; -import cokr.xit.foundation.data.DataObject; -import kr.dogfoot.hwplib.object.HWPFile; -import kr.dogfoot.hwplib.reader.HWPReader; - - -public abstract class HWPFormat { - protected HWPWriter writer; - - protected Print print; - protected PrintOption printOption; - protected List data; - - protected String formatFilePath; - - protected int currentRunCount; - protected int maxRunCount; - protected List resultFilesPath; - - public HWPFormat(Print print, PrintOption printOption, List dataObjectList) { - this.resultFilesPath = new ArrayList(); - this.currentRunCount = 0; - this.data = dataObjectList; - this.printOption = printOption; - this.print = print; - this.print.setExtension("hwp"); - } - - public HashMap makeFile(){ - - while(currentRunCount != maxRunCount) { - HWPFile hwpFile = HWPWriter.classpath(this.formatFilePath); - this.writer = new HWPWriter(hwpFile); - runAsWriter(); - String tempPath = this.print.pathForNewFile(); - writer.write(tempPath); - resultFilesPath.add(tempPath); - - writer = null; - currentRunCount++; - } - - return getResult(); - }; - - - protected abstract void runAsWriter(); - - protected HashMap getResult(){ - HashMap result = new HashMap(); - - String downlaodFileName = this.print.getFormatKorName()+"_"+this.print.getPrintRequestDt()+".hwp"; - - if(resultFilesPath.size() >= 2) { - - try { - String basePath = resultFilesPath.get(0); - HWPFile baseFile = HWPReader.fromFile(basePath); - - - for(int i=2; i <= resultFilesPath.size();i++) { - String attachPath = resultFilesPath.get(i-1); - HWPFile attachFile = HWPReader.fromFile(attachPath); - HwpMerge.appendToLast(attachFile, baseFile); - } - - kr.dogfoot.hwplib.writer.HWPWriter.toFile(baseFile, basePath); - } catch (Exception e) { - throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); - } - - for(int i=2; i <= resultFilesPath.size();i++) { - if(!(new File(resultFilesPath.get(i-1))).delete()) { - throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); - } - } - } - - String resultFilePath = resultFilesPath.get(0); - HWPFile resultFile = HWPWriter.filepath(resultFilePath); - writer = new HWPWriter(resultFile); - result.put("download", writer.getDownloadable().setFilename(downlaodFileName)); - result.put("downloadData", data); - result.put("dataNames", getDownloadDataNames()); - - new File(resultFilePath).delete(); - - return result; - }; - - public abstract List getDownloadDataNames(); - - - -} diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/RcvmtConfirm.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/RcvmtConfirm.java index c820a226..2c73e3e1 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/RcvmtConfirm.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/RcvmtConfirm.java @@ -3,8 +3,9 @@ package cokr.xit.fims.cmmn.hwp.format; import java.util.ArrayList; import java.util.List; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.format.HWPFormat; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -14,7 +15,7 @@ import cokr.xit.foundation.data.DataObject; */ public class RcvmtConfirm extends HWPFormat { - public RcvmtConfirm(Print print, PrintOption printOption, List dataObjectList) { + public RcvmtConfirm(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = dataObjectList.size(); diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java index e877df51..cabe6126 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java @@ -9,10 +9,11 @@ import java.util.stream.IntStream; import org.egovframe.rte.fdl.string.EgovStringUtil; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.OffcsCellFinder; +import cokr.xit.applib.hwp.format.HWPFormat; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; -import cokr.xit.fims.cmmn.hwp.OffcsCellFinder; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -24,7 +25,7 @@ import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph; */ public class ReportOnClaims extends HWPFormat { - public ReportOnClaims(Print print, PrintOption printOption, List dataObjectList) { + public ReportOnClaims(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = 1; this.formatFilePath = "template/hwp/reportOnClaims.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/RequestForDelivery.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/RequestForDelivery.java index 1f0dc68b..9ac84856 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/RequestForDelivery.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/RequestForDelivery.java @@ -9,10 +9,11 @@ import java.util.stream.IntStream; import org.egovframe.rte.fdl.string.EgovStringUtil; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.OffcsCellFinder; +import cokr.xit.applib.hwp.format.HWPFormat; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; -import cokr.xit.fims.cmmn.hwp.OffcsCellFinder; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -24,7 +25,7 @@ import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph; */ public class RequestForDelivery extends HWPFormat { - public RequestForDelivery(Print print, PrintOption printOption, List dataObjectList) { + public RequestForDelivery(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = 1; this.formatFilePath = "template/hwp/requestForDelivery.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java index a476956d..176daacd 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java @@ -8,16 +8,17 @@ import java.util.stream.IntStream; import org.egovframe.rte.fdl.string.EgovStringUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; -import cokr.xit.fims.cmmn.hwp.OffcsCellFinder; +import cokr.xit.applib.Print; +import cokr.xit.applib.hwp.OffcsCellFinder; +import cokr.xit.applib.hwp.format.HWPFormat; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.foundation.data.DataObject; import kr.dogfoot.hwplib.object.bodytext.control.table.Cell; import kr.dogfoot.hwplib.object.bodytext.paragraph.Paragraph; public class SvbtcList extends HWPFormat { - public SvbtcList(Print print, PrintOption printOption, List dataObjectList) { + public SvbtcList(Print print, FimsPrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); this.maxRunCount = 1; this.formatFilePath = "template/hwp/svbtcList.hwp"; diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Advntce.java b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Advntce.java index 9fbd7670..cb98051b 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Advntce.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Advntce.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.applib.Print; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -84,7 +84,7 @@ public class Advntce extends PDFPrintFormat { public Advntce() { super(); } - public Advntce(Print print, PrintOption printOption, + public Advntce(Print print, FimsPrintOption printOption, DataObject otptBscStng, List otptArtclStngList, String paperSeCd, List data){ super(print,printOption,otptBscStng,otptArtclStngList,paperSeCd, data); this.print.setFormatKorName("사전통지서"); @@ -95,7 +95,7 @@ public class Advntce extends PDFPrintFormat { */ @Override public String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { String result = ""; if(forPost) { @@ -244,7 +244,7 @@ public class Advntce extends PDFPrintFormat { */ @Override public String getValueForPost(String otptArtclNm, String defaultValue, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { String result = ""; switch(otptArtclNm) { @@ -292,7 +292,7 @@ public class Advntce extends PDFPrintFormat { @Override public List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { List result = new ArrayList(); switch(otptArtclNm) { diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Nht.java b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Nht.java index 24a4eac0..d4824d04 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Nht.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/Nht.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import cokr.xit.applib.Print; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.mngt.FactionUtil; import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; @@ -94,7 +94,7 @@ public class Nht extends PDFPrintFormat { super(); } - public Nht(Print print, PrintOption printOption, + public Nht(Print print, FimsPrintOption printOption, DataObject otptBscStng, List otptArtclStngList, String paperSeCd, List data) { super(print,printOption,otptBscStng,otptArtclStngList,paperSeCd, data); this.print.setFormatKorName("고지서"); @@ -107,7 +107,7 @@ public class Nht extends PDFPrintFormat { */ @Override public String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { String result = ""; if(forPost) { @@ -319,7 +319,7 @@ public class Nht extends PDFPrintFormat { */ @Override public String getValueForPost(String otptArtclNm, String defaultValue, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { String result = ""; switch(otptArtclNm) { @@ -366,7 +366,7 @@ public class Nht extends PDFPrintFormat { @Override public List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print) { + DataObject dataObject, FimsPrintOption printOption, Print print) { List result = new ArrayList(); switch(otptArtclNm) { diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java index 9e99bf5a..7ac5b445 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java @@ -18,9 +18,9 @@ import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode; import org.egovframe.rte.fdl.string.EgovStringUtil; import org.springframework.core.io.ClassPathResource; +import cokr.xit.applib.Print; import cokr.xit.fims.cmmn.CmmnUtil; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.cmmn.Pstn; import cokr.xit.fims.cmmn.PstnAndSize; import cokr.xit.fims.cmmn.Size; @@ -35,7 +35,7 @@ public abstract class PDFPrintFormat { protected PDFWriter writer; protected Print print; - protected PrintOption printOption; + protected FimsPrintOption printOption; protected List data; protected DataObject otptBscStng; @@ -50,7 +50,7 @@ public abstract class PDFPrintFormat { initDefaultStng(); } - public PDFPrintFormat(Print print, PrintOption printOption, + public PDFPrintFormat(Print print, FimsPrintOption printOption, DataObject otptBscStng, List otptArtclStngList, String paperSeCd, List data) { initDefaultStng(); this.data = data; @@ -147,16 +147,16 @@ public abstract class PDFPrintFormat { * 출력요소에 매핑될 값을 반환한다. */ public abstract String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print); + DataObject dataObject, FimsPrintOption printOption, Print print); public abstract List getMappingValues(String otptArtclNm, String defaultValue, boolean forPost, - DataObject dataObject, PrintOption printOption, Print print); + DataObject dataObject, FimsPrintOption printOption, Print print); /** * 우편물 출력요소에 매핑될 값을 반환한다. */ public abstract String getValueForPost(String otptArtclNm, String defaultValue, - DataObject dataObject, PrintOption printOption, Print print); + DataObject dataObject, FimsPrintOption printOption, Print print); /** * 시군구별 출력설정요소에 속성(요소 유형, 출력설명, 출력물 내 유일 요소 여부, 우편물 관련 요소 여부, 기본값)을 추가한다. diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java index 082c0bf5..1b6ff804 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.Print; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -24,8 +25,7 @@ import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.web.ApplicationController; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.cmmn.hwp.format.CvlcptOrgn; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.xls.FormatMaker; @@ -218,7 +218,7 @@ public class Cvlc01Controller extends ApplicationController { @RequestMapping(name="민원내역 원본 한글 파일 생성", value=METHOD_URL.makeFileFromHwpFormat) public ModelAndView makeFileFromHwpFormat(CrdnQuery query) { - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); UserInfo userInfo = currentUser(); factionBean.initUserInfo(userInfo); @@ -263,8 +263,7 @@ public class Cvlc01Controller extends ApplicationController { } CvlcptOrgn hwpFormat = new CvlcptOrgn(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); - + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); return mav; diff --git a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java index 791e9606..4615c01a 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.Print; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -24,8 +25,7 @@ import cokr.xit.base.file.service.FileService; import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.web.ApplicationController; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.cmmn.hwp.format.DlbrDecsnList; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.xls.FormatMaker; @@ -379,12 +379,12 @@ public class Excl02Controller extends ApplicationController { Print print = new Print(); print.setPrintRequestUserInfo(userInfo); - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); List dataObjectList = opnnSbmsnService.getOpnnSbmsnDlbrDecsns(req); DlbrDecsnList hwpFormat = new DlbrDecsnList(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); diff --git a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index 233cedfe..91781acb 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.Print; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -26,8 +27,7 @@ import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.OtptStngQuery; import cokr.xit.fims.cmmn.OutsourcingFileMaker; import cokr.xit.fims.cmmn.OutsourcingStngQuery; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.cmmn.dao.OtptStngMapper; import cokr.xit.fims.cmmn.hwp.format.SvbtcList; import cokr.xit.fims.cmmn.pdf.print.format.Advntce; @@ -1661,7 +1661,7 @@ public class Sndb01Controller extends ApplicationController { Print print = new Print(); print.setPrintRequestUserInfo(userInfo); - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); req.setSggCd((String)userInfo.getInfo().get("sggCd")); req.setDeptCd((String)userInfo.getInfo().get("deptCd")); @@ -1669,7 +1669,7 @@ public class Sndb01Controller extends ApplicationController { List dataObjectList = svbtcBean.getSvbtcPrint(req); SvbtcList hwpFormat = new SvbtcList(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); return mav; @@ -1816,7 +1816,7 @@ public class Sndb01Controller extends ApplicationController { */ @Task @RequestMapping(name="사전통지발송 현황 사전통지서 pdf 파일 생성", value=METHOD_URL.makeAdvntcePdf) - public ModelAndView makeAdvntcePdf(PrintOption printOption, SndbQuery req) { + public ModelAndView makeAdvntcePdf(FimsPrintOption printOption, SndbQuery req) { // ModelAndView mav = new ModelAndView("downloadView"); @@ -1917,7 +1917,7 @@ public class Sndb01Controller extends ApplicationController { */ @Task @RequestMapping(name="사전통지발송 현황 사전통지서 외주 파일 생성", value=METHOD_URL.makeAdvntceOutsourcing) - public ModelAndView makeAdvntceOutsourcing(PrintOption printOption, SndbQuery req) { + public ModelAndView makeAdvntceOutsourcing(FimsPrintOption printOption, SndbQuery req) { ModelAndView mav = new ModelAndView("downloadView"); String taskSeCd = ""; diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 4ce208eb..bee80fbb 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.Print; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -27,11 +28,10 @@ import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnUtil; +import cokr.xit.fims.cmmn.FimsPrintOption; import cokr.xit.fims.cmmn.OtptStngQuery; import cokr.xit.fims.cmmn.OutsourcingFileMaker; import cokr.xit.fims.cmmn.OutsourcingStngQuery; -import cokr.xit.fims.cmmn.Print; -import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.cmmn.dao.OtptStngMapper; import cokr.xit.fims.cmmn.hwp.format.CrdnConfirm; import cokr.xit.fims.cmmn.hwp.format.CrdnList; @@ -454,7 +454,7 @@ public class Sprt01Controller extends ApplicationController { @RequestMapping(name="단속 내역서 한글 파일 생성", value=METHOD_URL.makeCrdnListFileFromHwpFormat) public ModelAndView makeCrdnListFileFromHwpFormat(String privateInfoYn, String... crdnIds) { - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); printOption.setPrivateInfoYn(privateInfoYn); UserInfo userInfo = currentUser(); factionBean.initUserInfo(userInfo); @@ -467,7 +467,7 @@ public class Sprt01Controller extends ApplicationController { CrdnList hwpFormat = new CrdnList(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); @@ -480,7 +480,7 @@ public class Sprt01Controller extends ApplicationController { @RequestMapping(name="단속 확인서 한글 파일 생성", value=METHOD_URL.makeCrdnConfirmFileFromHwpFormat) public ModelAndView makeCrdnConfirmFileFromHwpFormat(String... crdnIds) { - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); UserInfo userInfo = currentUser(); factionBean.initUserInfo(userInfo); @@ -512,8 +512,7 @@ public class Sprt01Controller extends ApplicationController { } CrdnConfirm hwpFormat = new CrdnConfirm(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); - + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); @@ -537,7 +536,7 @@ public class Sprt01Controller extends ApplicationController { * @return hwp파일 */ @RequestMapping(name="교부청구서 한글 파일 생성", value=METHOD_URL.makeRequestForDeliveryFileFromHwpFormat) - public ModelAndView makeRequestForDeliveryFileFromHwpFormat(PrintOption printOption, String globalVariableInfo, String... crdnIds) { + public ModelAndView makeRequestForDeliveryFileFromHwpFormat(FimsPrintOption printOption, String globalVariableInfo, String... crdnIds) { DataObject sggStngInfo = stngBean.getStng("sgg"); DataObject deptStngInfo = stngBean.getStng("dept"); @@ -569,7 +568,7 @@ public class Sprt01Controller extends ApplicationController { RequestForDelivery hwpFormat = new RequestForDelivery(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); @@ -580,7 +579,7 @@ public class Sprt01Controller extends ApplicationController { * @return 채권신고서 hwp파일 */ @RequestMapping(name="채권신고서 한글 파일 생성", value=METHOD_URL.makeReportOnClaimsFileFromHwpFormat) - public ModelAndView makeReportOnClaimsFileFromHwpFormat(PrintOption printOption, String globalVariableInfo, String... crdnIds) { + public ModelAndView makeReportOnClaimsFileFromHwpFormat(FimsPrintOption printOption, String globalVariableInfo, String... crdnIds) { DataObject sggStngInfo = stngBean.getStng("sgg"); DataObject deptStngInfo = stngBean.getStng("dept"); @@ -612,7 +611,7 @@ public class Sprt01Controller extends ApplicationController { ReportOnClaims hwpFormat = new ReportOnClaims(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); return mav; @@ -629,7 +628,7 @@ public class Sprt01Controller extends ApplicationController { Print print = new Print(); print.setPrintRequestUserInfo(userInfo); - PrintOption printOption = new PrintOption(); + FimsPrintOption printOption = new FimsPrintOption(); printOption.setGlobalVariable(new HashMap()); SprtQuery sprtQuery = new SprtQuery(); @@ -637,7 +636,7 @@ public class Sprt01Controller extends ApplicationController { List dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); RcvmtConfirm hwpFormat = new RcvmtConfirm(print, printOption, dataObjectList); - HashMap result = hwpFormat.makeFile(); + HashMap result = hwpFormat.makeFile().andDownload(); ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); @@ -661,7 +660,12 @@ public class Sprt01Controller extends ApplicationController { * @return 사전통지서 PDF파일 */ @RequestMapping(name="사전통지서 pdf 파일 생성", value=METHOD_URL.makeAdvntcePdf) - public ModelAndView makeAdvntcePdf(String[] crdnIds, Sndng sndng, PrintOption printOption) { + public ModelAndView makeAdvntcePdf(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { + UserInfo userInfo = currentUser(); + factionBean.initUserInfo(userInfo); + + sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); + ModelAndView mav = new ModelAndView("downloadView"); SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds); @@ -728,8 +732,6 @@ public class Sprt01Controller extends ApplicationController { Print print = new Print(); - UserInfo userInfo = currentUser(); - factionBean.initUserInfo(userInfo); print.setPrintRequestUserInfo(userInfo); //출력물 기본 설정 @@ -778,7 +780,12 @@ public class Sprt01Controller extends ApplicationController { * @return 사전통지서 압축파일 */ @RequestMapping(name="사전통지서 외주 파일 생성", value=METHOD_URL.makeAdvntceOutsourcing) - public ModelAndView makeAdvntceOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) { + public ModelAndView makeAdvntceOutsourcing(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { + UserInfo userInfo = currentUser(); + factionBean.initUserInfo(userInfo); + + sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); + ModelAndView mav = new ModelAndView("downloadView"); SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds); @@ -890,7 +897,13 @@ public class Sprt01Controller extends ApplicationController { * @return 고지서 PDF파일 */ @RequestMapping(name="고지서 pdf 파일 생성", value=METHOD_URL.makeNhtPdf) - public ModelAndView makeNhtPdf(String[] crdnIds, Sndng sndng, PrintOption printOption) { + public ModelAndView makeNhtPdf(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { + + UserInfo userInfo = currentUser(); + factionBean.initUserInfo(userInfo); + + sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); + ModelAndView mav = new ModelAndView("downloadView"); SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds); @@ -960,8 +973,6 @@ public class Sprt01Controller extends ApplicationController { Print print = new Print(); - UserInfo userInfo = currentUser(); - factionBean.initUserInfo(userInfo); print.setPrintRequestUserInfo(userInfo); //출력물 기본 설정 @@ -1009,7 +1020,12 @@ public class Sprt01Controller extends ApplicationController { * @return 고지서 압축파일 */ @RequestMapping(name="고지서 외주 파일 생성", value=METHOD_URL.makeNhtOutsourcing) - public ModelAndView makeNhtOutsourcing(String[] crdnIds, Sndng sndng, PrintOption printOption) { + public ModelAndView makeNhtOutsourcing(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { + UserInfo userInfo = currentUser(); + factionBean.initUserInfo(userInfo); + + sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); + ModelAndView mav = new ModelAndView("downloadView"); SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds);