|
|
|
|
@ -152,7 +152,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
String errorMsg = String.format("[라인 %d] 데이터가 불완전합니다. 2줄 1세트 형식이 필요합니다.", i + 1);
|
|
|
|
|
errorMessages.add(errorMsg);
|
|
|
|
|
// 한 건이라도 실패하면 전체 롤백
|
|
|
|
|
throw new RuntimeException(buildErrorMessage(errorMessages));
|
|
|
|
|
throw new MessageException(buildErrorMessage(errorMessages));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String secondLine = allLines.get(i + 1);
|
|
|
|
|
@ -163,7 +163,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
|
|
|
|
|
if (vo == null) {
|
|
|
|
|
// 파싱 실패 시 전체 롤백
|
|
|
|
|
throw new RuntimeException(buildErrorMessage(errorMessages));
|
|
|
|
|
throw new MessageException(buildErrorMessage(errorMessages));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 필수 필드 검증
|
|
|
|
|
@ -172,7 +172,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
if (!validationErrors.isEmpty()) {
|
|
|
|
|
errorMessages.addAll(validationErrors);
|
|
|
|
|
// 검증 실패 시 전체 롤백
|
|
|
|
|
throw new RuntimeException(buildErrorMessage(errorMessages));
|
|
|
|
|
throw new MessageException(buildErrorMessage(errorMessages));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 차량번호 중복 체크
|
|
|
|
|
@ -185,7 +185,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
dataLineNumber, vo.getVhclno(), vo.getInspYmd());
|
|
|
|
|
errorMessages.add(errorMsg);
|
|
|
|
|
// 중복 체크 실패 시 전체 롤백
|
|
|
|
|
throw new RuntimeException(buildErrorMessage(errorMessages));
|
|
|
|
|
throw new MessageException(buildErrorMessage(errorMessages));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 업무 처리 상태 및 등록자 설정
|
|
|
|
|
@ -204,7 +204,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
String errorMsg = String.format("[데이터 %d] 데이터 저장 실패 - 차량번호: %s", dataLineNumber, vo.getVhclno());
|
|
|
|
|
errorMessages.add(errorMsg);
|
|
|
|
|
// DB 저장 실패 시 전체 롤백
|
|
|
|
|
throw new RuntimeException(buildErrorMessage(errorMessages));
|
|
|
|
|
throw new MessageException(buildErrorMessage(errorMessages));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2줄 1세트이므로 다음 줄 건너뛰기
|
|
|
|
|
@ -226,7 +226,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
result.put("successCount", 0);
|
|
|
|
|
result.put("failCount", 0);
|
|
|
|
|
result.put("errorMessages", errorMessages);
|
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
|
} catch (MessageException e) {
|
|
|
|
|
// 데이터 처리 중 오류 발생 시 전체 롤백
|
|
|
|
|
log.error("TXT 파일 업로드 중 오류 발생 - 전체 롤백 처리", e);
|
|
|
|
|
throw e; // 트랜잭션 롤백을 위해 예외 재발생
|
|
|
|
|
@ -299,7 +299,7 @@ public class CarFfnlgTrgtServiceImpl extends EgovAbstractServiceImpl implements
|
|
|
|
|
|
|
|
|
|
return sb.toString().getBytes(encoding);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException("다운로드 파일 생성 중 오류: " + e.getMessage(), e);
|
|
|
|
|
throw new MessageException("다운로드 파일 생성 중 오류: " + e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|