diff --git a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java index cfd0aa90..70133db4 100644 --- a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java +++ b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java @@ -19,6 +19,7 @@ import org.egovframe.rte.fdl.string.EgovStringUtil; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.Hangul; import cokr.xit.fims.cmmn.PrintOption; +import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; import net.lingala.zip4j.ZipFile; @@ -167,7 +168,7 @@ public class OutsourcingFileWriter { break; } case "amount(comma)": { - artclValue = CmmnUtil.addCommaToNumber(artclValue); + artclValue = DataFormat.n_nn0(artclValue); break; } default: diff --git a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java index a0db5923..6329915d 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java @@ -9,7 +9,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.DayOfWeek; import java.time.LocalDate; @@ -333,16 +332,6 @@ public class CmmnUtil { return dow; } - /**'-'와 ':'로 구분된 날짜(yyyy-MM-dd hh:mm:ss)를 반환한다. - * @param dateStr '-',':'이 없는 날짜 - * @return '-'와 ':'로로 구분된 날짜 - */ - public static String yyyy_mm_dd_hh_mm_ss(String dateStr) { - if (dateStr == null || dateStr.equals("")) return ""; - - return dateStr.substring(0, 4) + "-" + dateStr.substring(4, 6) + "-" + dateStr.substring(6, 8) - + " " + dateStr.substring(8, 10) + ":" + dateStr.substring(10, 12) + ":" + dateStr.substring(12, 14); - } public static String dateNFormat(String dateStr, String pattern) { if(dateStr.length() == 8) { @@ -372,22 +361,6 @@ public class CmmnUtil { return dataFormats.format(pattern, date); } - /** 숫자형 문자열에 세자리 마다 콤마를 찍어 반환한다. - * @param str 숫자형 문자열 - * @return 콤마가 표시된 숫자형 문자열 - */ - public static String addCommaToNumber(String str) { - if (str == null || str.equals("")) return ""; - - int number = Integer.parseInt(str); - DecimalFormat decFormat = new DecimalFormat("###,###"); - return decFormat.format(number); - } - - public static String addCommaToNumber(int number) { - DecimalFormat decFormat = new DecimalFormat("###,###"); - return decFormat.format(number); - } /** 숫자를 한글로 표시한다. * @param number 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 aa92ac78..a1066660 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 @@ -3,10 +3,10 @@ package cokr.xit.fims.cmmn.hwp.format; import java.util.List; 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.mngt.FactionUtil; +import cokr.xit.foundation.data.DataFormat; import cokr.xit.foundation.data.DataObject; import kr.dogfoot.hwplib.object.HWPFile; @@ -48,7 +48,7 @@ public class CrdnConfirm extends HWPFormat { DataObject newObj = (DataObject) new DataObject() .set("과태료", one.string("TASK_SE_NM")) .set("차량번호", one.string("VHRNO")) - .set("단속일시", CmmnUtil.yyyy_mm_dd_hh_mm_ss(one.string("CRDN_YMD_TM"))) + .set("단속일시", DataFormat.yyyy_mm_dd_hh_mm_ss(one.string("CRDN_YMD_TM"))) .set("위반내용", one.string("VLTN_ARTCL")) .set("단속장소", one.string("CRDN_PLC")) .set("단속동", one.string("CRDN_STDG_NM")) 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 bbf26961..b165d49f 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 @@ -5,7 +5,6 @@ import java.util.List; import java.util.stream.IntStream; 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.mngt.FactionUtil; @@ -58,7 +57,7 @@ public class CrdnList extends HWPFormat { String globalRtpyrFullAddr = data.get(0).string("RTPYR_FULL_ADDR"); int globalTotalAmount = data.stream().mapToInt(i -> i.number("LEVY_AMT").intValue()).sum(); - writer.setValue("출력일시", CmmnUtil.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt())); + writer.setValue("출력일시", DataFormat.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt())); writer.setValue("성명", globalRtpyrNm); if(print.getPrivateInfoYn(printOption)) { writer.setValue("주민번호", globalRtpyrNo); @@ -78,7 +77,7 @@ public class CrdnList extends HWPFormat { return (DataObject) new DataObject() .set("과태료", one.string("TASK_SE_NM")) .set("시군구명", one.string("SGG_NM")) - .set("단속일시", CmmnUtil.yyyy_mm_dd_hh_mm_ss(one.string("CRDN_YMD_TM"))) + .set("단속일시", DataFormat.yyyy_mm_dd_hh_mm_ss(one.string("CRDN_YMD_TM"))) .set("단속장소", one.string("CRDN_PLC")) .set("차량번호", one.string("VHRNO")) .set("대체차량번호", one.string("RPM_SZR_VHRNO")) 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 c71bc6ec..d93c2387 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 @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; 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.mngt.FactionUtil; @@ -60,7 +59,7 @@ public class RcvmtConfirm extends HWPFormat { .set("위반명2", one.string("TASK_SE_NM")) .set("위반차량", one.string("VHRNO")) .set("대체차량", one.string("RPM_SZR_VHRNO")) - .set("위반금액", CmmnUtil.addCommaToNumber(one.string("FFNLG_AMT"))) + .set("위반금액", DataFormat.n_nn0(one.string("FFNLG_AMT"))) .set("단속일자", DataFormat.yyyy_mm_dd(one.string("CRDN_YMD"))) .set("단속장소", one.string("CRDN_PLC")) .set("소유자", one.string("RTPYR_NM")) @@ -68,8 +67,8 @@ public class RcvmtConfirm extends HWPFormat { .set("주소", one.string("RTPYR_FULL_ADDR")) .set("고지번호", one.string("GOJI_NO")) .set("수납일자", DataFormat.yyyy_mm_dd(one.string("RCVMT_YMD"))) - .set("수납금액", CmmnUtil.addCommaToNumber(one.string("RCVMT_AMT"))) - .set("연월일시분초", CmmnUtil.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt())) + .set("수납금액", DataFormat.n_nn0(one.string("RCVMT_AMT"))) + .set("연월일시분초", DataFormat.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt())) .set("확인자", print.getPrintRequestUserInfo().getName()) .set("발신", instNm) ; 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 af918a5b..1813675c 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 @@ -78,8 +78,8 @@ public class ReportOnClaims extends HWPFormat { writer.setValue("체납자번호", EgovStringUtil.null2void(globalVariable.get("rtpyrNo"))); writer.setValue("체납자주소", EgovStringUtil.null2void(globalVariable.get("rtpyrFullAddr"))); int sumOfList = data.stream().mapToInt(item -> item.number("SUM_AMT").intValue()).sum(); - writer.setValue("채권청구액", CmmnUtil.addCommaToNumber(sumOfList)); - writer.setValue("합계금액", CmmnUtil.addCommaToNumber(sumOfList)); + writer.setValue("채권청구액", DataFormat.n_nn0(sumOfList)); + writer.setValue("합계금액", DataFormat.n_nn0(sumOfList)); writer.setValue("합계금액한글", CmmnUtil.convertNumberToHangul(sumOfList)); String printRequestYmd = print.getPrintRequestDt().substring(0, 8); @@ -101,9 +101,9 @@ public class ReportOnClaims extends HWPFormat { .set("과세번호", one.string("GOJI_NO")) .set("법정기일", DataFormat.yyyy_mm_dd(one.string("DUDT_YMD"))) .set("세목", one.string("TXITM_NM")) - .set("세액", CmmnUtil.addCommaToNumber(one.string("LEVY_PCPTAX"))) - .set("가산금", CmmnUtil.addCommaToNumber(one.string("LEVY_ADAMT"))) - .set("합계", CmmnUtil.addCommaToNumber(one.string("SUM_AMT"))); + .set("세액", DataFormat.n_nn0(one.string("LEVY_PCPTAX"))) + .set("가산금", DataFormat.n_nn0(one.string("LEVY_ADAMT"))) + .set("합계", DataFormat.n_nn0(one.string("SUM_AMT"))); return newObj; }).toList(); writer.table(0, 9, 2).setValues(list); 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 9553c575..639b8ad7 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 @@ -78,8 +78,8 @@ public class RequestForDelivery extends HWPFormat { writer.setValue("주소", EgovStringUtil.null2void(globalVariable.get("rtpyrFullAddr"))); int sumOfList = data.stream().mapToInt(item -> item.number("SUM_AMT").intValue()).sum(); - writer.setValue("합계금액", CmmnUtil.addCommaToNumber(sumOfList)); - writer.setValue("교부청구금액", CmmnUtil.addCommaToNumber(sumOfList)); + writer.setValue("합계금액", DataFormat.n_nn0(sumOfList)); + writer.setValue("교부청구금액", DataFormat.n_nn0(sumOfList)); writer.setValue("교부청구금액한글", CmmnUtil.convertNumberToHangul(sumOfList)); writer.setValue("개설은행", EgovStringUtil.null2void(globalVariable.get("dtbnBankNm"))); writer.setValue("계좌번호", EgovStringUtil.null2void(globalVariable.get("dtbnActno"))); @@ -104,7 +104,7 @@ public class RequestForDelivery extends HWPFormat { DataObject newObj = (DataObject) new DataObject() .set("징수과목", one.string("TXITM_NM")) .set("고지번호", one.string("GOJI_NO")) - .set("과태료계", CmmnUtil.addCommaToNumber(one.string("SUM_AMT"))) + .set("과태료계", DataFormat.n_nn0(one.string("SUM_AMT"))) .set("법정기일", DataFormat.yyyy_mm_dd(one.string("DUDT_YMD"))) ; return newObj; 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 6a2e560a..eb2997f7 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,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.mngt.FactionUtil; @@ -142,7 +141,7 @@ public class Advntce extends PDFPrintFormat { result = DataFormat.yyyy_mm_dd(dataObject.string("CRDN_YMD")); } case "crdnYmdTm" -> { - result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM")); + result = DataFormat.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM")); } case "crdnPlc" -> { result = dataObject.string("CRDN_PLC"); @@ -163,7 +162,7 @@ public class Advntce extends PDFPrintFormat { result = dataObject.string("FFNLG_CRDN_AMT"); } case "advntceAmt" -> { - result = CmmnUtil.addCommaToNumber(dataObject.string("ADVNTCE_AMT")); + result = DataFormat.n_nn0(dataObject.string("ADVNTCE_AMT")); } case "advntceDudtYmd" -> { result = DataFormat.yyyy_mm_dd(dataObject.string("ADVNTCE_DUDT_YMD")); @@ -210,7 +209,7 @@ public class Advntce extends PDFPrintFormat { result = DataFormat.yyyy_mm_dd(print.getPrintRequestDt().substring(0,8)); } case "otptDt" -> { - result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt()); + result = DataFormat.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt()); } case "otptYYYY" -> { result = print.getPrintRequestDt().substring(0,4); 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 5101d1b3..a6a5f4fd 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 @@ -147,7 +147,7 @@ public class Nht extends PDFPrintFormat { result = DataFormat.yyyy_mm_dd(dataObject.string("CRDN_YMD")); } case "crdnYmdTm" -> { - result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM")); + result = DataFormat.yyyy_mm_dd_hh_mm_ss(dataObject.string("CRDN_YMD_TM")); } case "crdnPlc" -> { result = dataObject.string("CRDN_PLC"); @@ -276,7 +276,7 @@ public class Nht extends PDFPrintFormat { result = DataFormat.yyyy_mm_dd(print.getPrintRequestDt().substring(0,8)); } case "otptDt" -> { - result = CmmnUtil.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt()); + result = DataFormat.yyyy_mm_dd_hh_mm_ss(print.getPrintRequestDt()); } case "otptYYYY" -> { result = print.getPrintRequestDt().substring(0,4);