fix(shipdetail): 기간 설정 재수집 시 RECOLLECT 모드 분기 오류 수정

기간 재수집(executor=MANUAL)에서 실패건 재수집(AUTO_RETRY/MANUAL_RETRY)
로직을 타면서 sourceJobExecutionId 없이 0건 종료되던 문제 수정.
실패건 재수집만 DB 조회, 기간 재수집은 Maritime API 호출로 분기.

Closes #75

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
HYOJIN 2026-03-23 17:09:19 +09:00
부모 c4ad3c2f42
커밋 694d89f579

파일 보기

@ -28,7 +28,8 @@ import java.util.stream.Collectors;
/**
* 선박제원정보 변경 IMO 목록 조회 Tasklet.
* NORMAL 모드: Maritime API에서 변경된 IMO 번호 조회
* RECOLLECT 모드: DB에서 실패 IMO 번호 조회
* RECOLLECT + 실패건 재수집(AUTO_RETRY/MANUAL_RETRY): DB에서 실패 IMO 번호 조회
* RECOLLECT + 기간 재수집(MANUAL ): Maritime API에서 설정된 기간의 IMO 번호 조회
* 조회 결과를 JobExecutionContext에 저장하여 Partitioner가 사용할 있게 .
*/
@Slf4j
@ -64,11 +65,17 @@ public class ShipDetailImoFetchTasklet implements Tasklet {
String executionMode = jobExecution.getJobParameters()
.getString("executionMode", "NORMAL");
String executor = jobExecution.getJobParameters().getString("executor", "");
boolean isFailedRecordRetry = "AUTO_RETRY".equals(executor) || "MANUAL_RETRY".equals(executor);
List<String> imoNumbers;
if ("RECOLLECT".equals(executionMode)) {
if ("RECOLLECT".equals(executionMode) && isFailedRecordRetry) {
// 실패건 재수집: DB에서 실패 IMO 조회
imoNumbers = fetchRecollectImoNumbers(jobExecution);
} else {
// NORMAL 모드 또는 기간 재수집: Maritime API에서 IMO 조회
// BatchDateService가 executionMode에 따라 적절한 날짜 범위를 결정
imoNumbers = fetchChangedImoNumbers(jobExecution);
}