feature/jp-0331 #526

Open
jungpyo2001 wants to merge 998 commits from feature/jp-0331 into main
Showing only changes of commit 8ce07e71df - Show all commits

View File

@ -6,6 +6,7 @@ import com.interplug.qcast.biz.displayItem.dto.BomSyncResponse;
import com.interplug.qcast.util.InterfaceQsp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecutionListener;
@ -62,9 +63,16 @@ public class BomConfiguration implements JobExecutionListener {
this.bomSyncList =
interfaceQsp.callApiData(
HttpMethod.GET, qspInterfaceUrl, null, new TypeReference<List<BomSyncResponse>>() {});
return (bomSyncList != null)
? new ListItemReader<>(bomSyncList)
: new ListItemReader<>(Collections.emptyList());
if (bomSyncList == null) {
return new ListItemReader<>(Collections.emptyList());
}
// 2026-05-20 청크 경계에서 같은 A/D 분리되어 A 먼저 MERGE
// 다음 청크의 D 그것을 삭제해버리는 리스크를 차단하기 위해,
// 전체 리스트를 statCd='D' 우선으로 정렬한다. (Spring Batch 청크를 순차 처리하므로
// 모든 D 청크가 끝난 뒤에 A/U 청크가 시작되어 전역적으로 'A 이김' 보장됨)
bomSyncList.sort(
Comparator.comparingInt((BomSyncResponse b) -> "D".equals(b.getStatCd()) ? 0 : 1));
return new ListItemReader<>(bomSyncList);
}
@Bean