PRN 파일 확장자명으로 수정

main
박성영 1 week ago
parent d738063b50
commit 3eff7edc9d

@ -130,7 +130,7 @@ public class CarFfnlgTrgtController {
// TODO : ECU-KR -> UTF-8 변환
byte[] utfFileBytes = content.getBytes(StandardCharsets.UTF_8);
String fileName = URLEncoder.encode("유효기간경과_과태료부과대상_리스트.txt", "UTF-8");
String fileName = URLEncoder.encode("유효기간경과_과태료부과대상_리스트.prn", "UTF-8");
// 응답 헤더 설정 (텍스트 파일, UTF-8 인코딩)
response.setContentType("text/plain; charset=UTF-8");
@ -156,7 +156,7 @@ public class CarFfnlgTrgtController {
* @return
*/
@GetMapping("/uploadPopup.do")
@Operation(summary = "파일 업로드 팝업", description = "TXT 파일 업로드 팝업 화면을 제공합니다.")
@Operation(summary = "파일 업로드 팝업", description = "TXT, PRN 파일 업로드 팝업 화면을 제공합니다.")
public ModelAndView uploadPopup() {
log.debug("파일 업로드 팝업 화면 요청");
@ -174,11 +174,11 @@ public class CarFfnlgTrgtController {
* @return
*/
@PostMapping("/upload.ajax")
@Operation(summary = "TXT 파일 업로드", description = "TXT 파일을 업로드하고 파싱하여 DB에 저장합니다. 한 건이라도 실패 시 전체 롤백됩니다.")
@Operation(summary = "TXT, PRN 파일 업로드", description = "TXT, PRN 파일을 업로드하고 파싱하여 DB에 저장합니다. 한 건이라도 실패 시 전체 롤백됩니다.")
public ResponseEntity<?> upload(
@Parameter(description = "TXT 파일") @RequestParam("file") MultipartFile file) {
@Parameter(description = "TXT, PRN 파일") @RequestParam("file") MultipartFile file) {
log.info("TXT 파일 업로드 요청 - 파일명: {}", file != null ? file.getOriginalFilename() : "null");
log.info("TXT, PRN 파일 업로드 요청 - 파일명: {}", file != null ? file.getOriginalFilename() : "null");
try {
// 세션에서 사용자 ID 가져오기
@ -217,11 +217,11 @@ public class CarFfnlgTrgtController {
} catch (RuntimeException e) {
// 데이터 처리 중 오류 발생 - 전체 롤백됨
log.error("TXT 파일 업로드 중 오류 발생 - 전체 롤백", e);
log.error("TXT, PRN 파일 업로드 중 오류 발생 - 전체 롤백", e);
return ApiResponseUtil.error(e.getMessage());
} catch (Exception e) {
// 예상치 못한 오류
log.error("TXT 파일 업로드 중 예상치 못한 오류 발생", e);
log.error("TXT, PRN 파일 업로드 중 예상치 못한 오류 발생", e);
return ApiResponseUtil.error("파일 업로드 중 오류가 발생했습니다: " + e.getMessage());
}
}

@ -105,8 +105,8 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
// 파일 확장자 검증
String originalFilename = file.getOriginalFilename();
if (originalFilename == null || !originalFilename.toLowerCase().endsWith(".txt")) {
throw new IllegalArgumentException("TXT 파일만 업로드 가능합니다. 선택된 파일: " + originalFilename);
if (originalFilename == null || (!originalFilename.toLowerCase().endsWith(".txt") && !originalFilename.toLowerCase().endsWith(".prn"))) {
throw new IllegalArgumentException("TXT, PRN 파일만 업로드 가능합니다. 선택된 파일: " + originalFilename);
}
// 파일 크기 검증 (50MB 제한)

@ -50,9 +50,9 @@ public class ComparisonRemarkBuilder {
//sb.append(" - 접수번호: ").append(StringUtil.nvl(ledgerRecord.getAplyRcptNo())).append("\n");
// 4. 비교 기간
sb.append("\n■ 비교 기간\n");
//sb.append("\n■ 비교 기간\n");
//sb.append(" - 유효기간만료일: ").append(DateUtil.formatDateString(vldPrdExpryYmd)).append("\n");
sb.append(" - 검사종료일자: ").append(DateUtil.formatDateString(inspEndYmd)).append("\n");
//sb.append(" - 검사종료일자: ").append(DateUtil.formatDateString(inspEndYmd)).append("\n");
return sb.toString();
}
@ -95,8 +95,8 @@ public class ComparisonRemarkBuilder {
sb.append(" - 특별사항: ").append(StringUtil.nvl(ledgerRecord.getSpcablMttr())).append("\n");
// 4. 비교 기간
sb.append("\n■ 비교 기간\n");
sb.append(" - 검사종료일자: ").append(DateUtil.formatDateString(inspEndYmd)).append("\n");
//sb.append("\n■ 비교 기간\n");
//sb.append(" - 검사종료일자: ").append(DateUtil.formatDateString(inspEndYmd)).append("\n");
return sb.toString();
}

@ -138,7 +138,7 @@ file:
max-size: 10 # 단일 파일 최대 크기 (MB)
max-total-size: 100 # 총 파일 최대 크기 (MB)
max-files: 10 # 최대 파일 개수
allowed-extensions: txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
allowed-extensions: prn,txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
real-file-delete: true # 실제 파일 삭제 여부
sub-dirs:
api-target-list-txt-file: api/target # api 조회 대상 파일

@ -147,7 +147,7 @@ file:
max-size: 10 # 단일 파일 최대 크기 (MB)
max-total-size: 100 # 총 파일 최대 크기 (MB)
max-files: 10 # 최대 파일 개수
allowed-extensions: txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
allowed-extensions: prn,txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
real-file-delete: false # 실제 파일 삭제 여부
sub-dirs:
api-target-list-txt-file: api/target # api 조회 대상 파일

@ -139,7 +139,7 @@ file:
max-size: 10 # 단일 파일 최대 크기 (MB)
max-total-size: 100 # 총 파일 최대 크기 (MB)
max-files: 10 # 최대 파일 개수
allowed-extensions: txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
allowed-extensions: prn,txt,hwp,jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip
real-file-delete: true # 실제 파일 삭제 여부
sub-dirs:
api-target-list-txt-file: api/target # api 조회 대상 파일

@ -9,10 +9,10 @@
<section id="section8" class="main_bars">
<div class="bgs-main">
<section id="section5">
<div class="sub_title">과태료 대상 목록</div>
<button type="button" id="registerBtn" class="newbtn bg1">TXT 등록</button>
<div class="sub_title"> &gt; 지연 과태료 대상 목록</div>
<button type="button" id="registerBtn" class="newbtn bg1">PRN 등록</button>
<button type="button" id="downloadBtn" class="newbtn bg3 iconz">
<span class="mdi mdi-file-document"></span>TXT 다운로드
<span class="mdi mdi-file-document"></span>PRN 다운로드
</button>
<button type="button" id="excelDownloadBtn" class="newbtn bg3 iconz">
<span class="mdi mdi-microsoft-excel"></span>엑셀 다운로드

@ -8,7 +8,7 @@
<div class="popup_wrap">
<div class="popup_inner">
<div class="popup_tit">
<h2 class="tit">과태료 대상 TXT 파일 업로드</h2>
<h2 class="tit">과태료 대상 PRN 파일 업로드</h2>
<a href="#" class="pop-x-btn modalclose" id="btnCloseTop"></a>
</div>
@ -21,17 +21,17 @@
<col style="width: 80%;" />
</colgroup>
<tr>
<th class="th"><span class="required">*</span> TXT 파일</th>
<th class="th"><span class="required">*</span> PRN 파일</th>
<td>
<div class="file-input-row">
<input type="file" id="txtFile" name="txtFile" accept=".txt" class="file_input" />
<input type="file" id="txtFile" name="txtFile" accept=".txt,.prn" class="file_input" />
<span class="file-input-text">파일을 선택하세요</span>
<button type="button" id="btnClearFile" class="btn_delete_file" style="display: none;" title="파일 삭제">
<i class="material-icons">close</i>
</button>
</div>
<div class="file-info" style="margin-top: 10px; color: #666; font-size: 13px;">
※ TXT 파일만 업로드 가능합니다. (최대 50MB)
※ TXT, PRN 파일만 업로드 가능합니다. (최대 50MB)
</div>
</td>
</tr>
@ -207,8 +207,8 @@ function uploadFile() {
// 중요로직: 파일 확장자 검증
var fileName = file.name;
var fileExt = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
if (fileExt !== 'txt') {
alert("TXT 파일만 업로드 가능합니다.");
if (fileExt !== 'txt' && fileExt !== 'prn') {
alert("TXT, PRN 파일만 업로드 가능합니다.");
return;
}
@ -339,7 +339,7 @@ function clearFileInput() {
$btnClear.hide();
// 파일 정보 초기화
$('.file-info').html('※ TXT 파일만 업로드 가능합니다. (최대 50MB)');
$('.file-info').html('※ TXT, PRN 파일만 업로드 가능합니다. (최대 50MB)');
}
/**

Loading…
Cancel
Save