SDATE 로직 추가

This commit is contained in:
25W0103
2025-12-09 10:54:53 +09:00
parent 5852ac8fa4
commit 76f1b245aa
@@ -133,6 +133,10 @@ public class RemoteTransfer {
}
String rmtFileTrsmtPathName = vo.getRecvDir().replaceAll("#APP#", tarAppCode);
rmtFileTrsmtPathName = getPathDateTrans(rmtFileTrsmtPathName);// 20251209
logger.debug("RemoteTransfer rmtFileTrsmtPathName:"+rmtFileTrsmtPathName);
String rmtTrsmtFileName = procCode + "_" + instCode + "_" + fileName;
loginfo.setRmtFileTrsmtPathName(rmtFileTrsmtPathName);
loginfo.setRmtTrsmtFileName(rmtTrsmtFileName);
@@ -311,6 +315,34 @@ public class RemoteTransfer {
return "S:수신 성공[" + fullFileName +"]";
}
public String getPathDateTrans(String inPath) {
String today = DatetimeUtil.getCurrentDate();
if(inPath.lastIndexOf("#SDATE#") > -1) {
inPath = inPath.replaceAll("#SDATE#", today);
}
if(inPath.lastIndexOf("#SDATE-1#") > -1) {
inPath = inPath.replaceAll("#SDATE-1#", getDayAddedDate(today, -1));
}
if(inPath.lastIndexOf("#SDATE_YYYYMM#") > -1) {
inPath = inPath.replaceAll("#SDATE_YYYYMM#", today.substring(0,6));
}
if(inPath.lastIndexOf("#SDATE_YYYY#") > -1) {
inPath = inPath.replaceAll("#SDATE_YYYY#", today.substring(0,4));
}
if(inPath.lastIndexOf("#SDATE_MM#") > -1) {
inPath = inPath.replaceAll("#SDATE_MM#", today.substring(4,6));
}
if(inPath.lastIndexOf("#SDATE_DD#") > -1) {
inPath = inPath.replaceAll("#SDATE_DD#", today.substring(6,8));
}
if(inPath.lastIndexOf("#ODATE#") > -1) {
inPath = inPath.replaceAll("#ODATE#", today);
}
return inPath;
}
}