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

병합
HYOJIN bugfix/ISSUE-75-fix-period-recollection 에서 develop 로 2 commits 를 머지했습니다 2026-03-23 17:13:51 +09:00
Showing only changes of commit 694d89f579 - Show all commits

파일 보기

@ -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);
}