우편번호,등기번호에 하이픈 문자(-) 추가하는 메소드 추가

main
이범준 7 months ago
parent fa89bf46ef
commit 08da87490d

@ -310,22 +310,6 @@ public class CmmnUtil {
return yyyyMMddFormat.format(cal.getTime()); return yyyyMMddFormat.format(cal.getTime());
} }
/**
* .
* @param dateStr
* @return
*/
public static String getDayOfWeek(String dateStr) {
int y = Integer.parseInt(dateStr.substring(0,4));
int m = Integer.parseInt(dateStr.substring(4,6));
int d = Integer.parseInt(dateStr.substring(6,8));
LocalDate date = LocalDate.of(y, m, d);
DayOfWeek dayOfWeek = date.getDayOfWeek();
String dow = dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN);
return dow;
}
public static String dateNFormat(String dateStr, String pattern) { public static String dateNFormat(String dateStr, String pattern) {
if(dateStr.length() == 8) { if(dateStr.length() == 8) {
return CmmnUtil.date8Format(dateStr, pattern); return CmmnUtil.date8Format(dateStr, pattern);
@ -354,6 +338,42 @@ public class CmmnUtil {
return dataFormats.format(pattern, date); return dataFormats.format(pattern, date);
} }
/**'-' .
* @param zipCode '-'
* @return '-'
*/
public static String zipCodeFormat(String zipCode) {
if(zipCode != null && zipCode.length() == 6) {
return zipCode.substring(0,3)+"-"+zipCode.substring(3);
}
return zipCode;
}
/**'-' .
* @param rgNo '-'
* @return '-'
*/
public static String rgNoFormat(String rgNo) {
if(rgNo != null && rgNo.length() == 13) {
return rgNo.substring(0,5)+"-"+rgNo.substring(5);
}
return rgNo;
}
/**
* .
* @param dateStr
* @return
*/
public static String getDayOfWeek(String dateStr) {
int y = Integer.parseInt(dateStr.substring(0,4));
int m = Integer.parseInt(dateStr.substring(4,6));
int d = Integer.parseInt(dateStr.substring(6,8));
LocalDate date = LocalDate.of(y, m, d);
DayOfWeek dayOfWeek = date.getDayOfWeek();
String dow = dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN);
return dow;
}
/** . /** .
* @param number * @param number

@ -153,15 +153,11 @@ public class OutsourcingFileMaker {
String formatting = printStngItem.string("FORMATTING"); String formatting = printStngItem.string("FORMATTING");
switch (formatting) { switch (formatting) {
case "zip(hypen)": { case "zip(hypen)": {
if(artclValue.length() == 6) { artclValue = CmmnUtil.zipCodeFormat(artclValue);
artclValue = artclValue.substring(0,3)+"-"+artclValue.substring(3);
}
break; break;
} }
case "rgNo(hypen)": { case "rgNo(hypen)": {
if(artclValue.length() == 13) { artclValue = CmmnUtil.rgNoFormat(artclValue);
artclValue = artclValue.substring(0,5)+"-"+artclValue.substring(5);
}
break; break;
} }
case "amount(comma)": { case "amount(comma)": {

Loading…
Cancel
Save