사전통지서 외주요청파일 서식 항목별 포맷팅 설정 추가

main
이범준 8 months ago
parent a9a8b7c780
commit 755c6fb391

@ -150,7 +150,39 @@ public class OutsourcingFileWriter {
//포매팅 //포매팅
if(!printStngItem.string("FORMATTING").equals("")) { if(!printStngItem.string("FORMATTING").equals("")) {
//TODO : 등기번호,우편번호,금액,날짜 String formatting = printStngItem.string("FORMATTING");
switch (formatting) {
case "zip(hypen)": {
if(artclValue.length() == 6) {
artclValue = artclValue.substring(0,3)+"-"+artclValue.substring(3);
}
break;
}
case "rgNo(hypen)": {
if(artclValue.length() == 13) {
artclValue = artclValue.substring(0,5)+"-"+artclValue.substring(5);
}
break;
}
case "amount(comma)": {
artclValue = CmmnUtil.addCommaToNumber(artclValue);
break;
}
default:
if(formatting.startsWith("date(")) {
String dtlFormatting = formatting.substring(5, formatting.length()-1);
if(dtlFormatting.contains("~") && artclValue.contains("~")) {
String from = CmmnUtil.dateNFormat(artclValue.split("~",-1)[0], dtlFormatting.split("~",-1)[0]);
String to = CmmnUtil.dateNFormat(artclValue.split("~",-1)[1], dtlFormatting.split("~",-1)[1]);
artclValue = from + "~" + to;
} else {
artclValue = CmmnUtil.dateNFormat(artclValue, dtlFormatting);
}
}
}
} }
//공백 패딩 방향 //공백 패딩 방향

@ -39,6 +39,7 @@ import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.CommentSupport; import cokr.xit.base.file.xls.XLSWriter.CommentSupport;
import cokr.xit.fims.sndb.service.bean.SndngBean; import cokr.xit.fims.sndb.service.bean.SndngBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.util.DateFormats;
public class CmmnUtil { public class CmmnUtil {
@ -336,6 +337,34 @@ public class CmmnUtil {
+ " " + dateStr.substring(8, 10) + ":" + dateStr.substring(10, 12) + ":" + dateStr.substring(12, 14); + " " + dateStr.substring(8, 10) + ":" + dateStr.substring(10, 12) + ":" + dateStr.substring(12, 14);
} }
public static String dateNFormat(String dateStr, String pattern) {
if(dateStr.length() == 8) {
return CmmnUtil.date8Format(dateStr, pattern);
} else if(dateStr.length() == 12) {
return CmmnUtil.date12Format(dateStr, pattern);
} else if(dateStr.length() == 14) {
return CmmnUtil.date14Format(dateStr, pattern);
} else {
return dateStr;
}
}
public static String date8Format(String dateStr, String pattern) {
DateFormats dataFormats = new DateFormats();
Date date = dataFormats.parse("yyyyMMdd", dateStr);
return dataFormats.format(pattern, date);
}
public static String date12Format(String dateStr, String pattern) {
DateFormats dataFormats = new DateFormats();
Date date = dataFormats.parse("yyyyMMddHHmm", dateStr);
return dataFormats.format(pattern, date);
}
public static String date14Format(String dateStr, String pattern) {
DateFormats dataFormats = new DateFormats();
Date date = dataFormats.parse("yyyyMMddHHmmss", dateStr);
return dataFormats.format(pattern, date);
}
/** . /** .
* @param str * @param str
* @return * @return

@ -114,7 +114,22 @@
<button type="button" class="btn btn-xs btn-outline-dark h-px-25 px-1">▶</button> <button type="button" class="btn btn-xs btn-outline-dark h-px-25 px-1">▶</button>
</td> </td>
<td data-col="formatting" class="text-center"> <td data-col="formatting" class="text-center">
<input type="text" class="form-control w-px-300" /> <select class="form-select w-automin">
<option value="">없음</option>
<optgroup label="날짜">
<option value="date(yyyy.MM.dd)">연.월.일</option>
<option value="date(yyyy.MM.dd HH:mm)">연.월.일 시:분</option>
<option value="date(yyyy-MM-dd~yyyy-MM-dd)">연-월-일~연-월-일</option>
</optgroup>
<optgroup label="금액">
<option value="amount(comma)">콤마(,) 표시</option>
</optgroup>
<optgroup label="기타">
<option value="zip(hypen)">우편번호 하이픈(-) 표시</option>
<option value="rgNo(hypen)">등기번호 하이픈(-) 표시</option>
</optgroup>
</select>
</td> </td>
<td class="dummy-td"></td> <td class="dummy-td"></td>
</tr> </tr>

Loading…
Cancel
Save