등록기간 종료 처리

This commit is contained in:
2025-05-27 00:11:15 +00:00
parent 4f8281ccb3
commit 2e95f2c854
2 changed files with 15 additions and 1 deletions

View File

@@ -115,6 +115,18 @@ public class CommonUtils {
return result;
}
public static Date stringToDate(String dd, String pattern) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date result = null;
try {
result = sdf.parse(dd);
System.out.println(sdf.format(result));
} catch (ParseException e) {
throw new RuntimeException(e);
}
return result;
}
public static String generateFileName() {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSSS");

View File

@@ -69,7 +69,9 @@ public class EstimateServiceImpl implements EstimateService {
Prcs prcs = optionalPrcs.get();
Date now = new Date();
if(CommonUtils.stringToDate(prcs.getRegEdat()).getTime() <= now.getTime()) throw new CustomMessageException(CustomMessageException.CusMessage.builder()
Date end = CommonUtils.stringToDate(prcs.getRegEdat(), "yyyy-MM-dd");
System.out.println(end.getTime() +"///"+ now.getTime());
if(end.getTime() <= now.getTime()) throw new CustomMessageException(CustomMessageException.CusMessage.builder()
.code("999999")
.message("등록기간이 종료 되었습니다.")
.build());