배치 파라메터 수정
This commit is contained in:
parent
282fa9bfb0
commit
5faedebb8b
@ -2,7 +2,6 @@ package com.interplug.qcast.batch.master;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.interplug.qcast.biz.displayItem.DisplayItemService;
|
import com.interplug.qcast.biz.displayItem.DisplayItemService;
|
||||||
import com.interplug.qcast.biz.displayItem.dto.ItemSyncRequest;
|
|
||||||
import com.interplug.qcast.biz.displayItem.dto.ItemSyncResponse;
|
import com.interplug.qcast.biz.displayItem.dto.ItemSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -59,13 +58,11 @@ public class MaterialConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
@StepScope
|
@StepScope
|
||||||
public ListItemReader<ItemSyncResponse> materialReader() throws Exception {
|
public ListItemReader<ItemSyncResponse> materialReader() throws Exception {
|
||||||
ItemSyncRequest itemSyncRequest = new ItemSyncRequest();
|
|
||||||
itemSyncRequest.setAllYn("N");
|
|
||||||
this.itemSyncList =
|
this.itemSyncList =
|
||||||
interfaceQsp.callApiData(
|
interfaceQsp.callApiData(
|
||||||
HttpMethod.GET,
|
HttpMethod.GET,
|
||||||
qspInterfaceUrl,
|
qspInterfaceUrl + "?allYn=N",
|
||||||
itemSyncRequest,
|
null,
|
||||||
new TypeReference<List<ItemSyncResponse>>() {});
|
new TypeReference<List<ItemSyncResponse>>() {});
|
||||||
return (itemSyncList != null)
|
return (itemSyncList != null)
|
||||||
? new ListItemReader<>(itemSyncList)
|
? new ListItemReader<>(itemSyncList)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.interplug.qcast.batch.master;
|
|||||||
|
|
||||||
import com.interplug.qcast.biz.displayItem.DisplayItemService;
|
import com.interplug.qcast.biz.displayItem.DisplayItemService;
|
||||||
import com.interplug.qcast.biz.displayItem.dto.PriceItemSyncResponse;
|
import com.interplug.qcast.biz.displayItem.dto.PriceItemSyncResponse;
|
||||||
import com.interplug.qcast.biz.displayItem.dto.PriceSyncRequest;
|
|
||||||
import com.interplug.qcast.biz.displayItem.dto.PriceSyncResponse;
|
import com.interplug.qcast.biz.displayItem.dto.PriceSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -45,12 +44,9 @@ public class PriceJobConfiguration implements JobExecutionListener {
|
|||||||
public void beforeJob(JobExecution jobExecution) {
|
public void beforeJob(JobExecution jobExecution) {
|
||||||
log.info("Job 시작: 초기화 메서드 호출 중...");
|
log.info("Job 시작: 초기화 메서드 호출 중...");
|
||||||
try {
|
try {
|
||||||
PriceSyncRequest priceSyncRequest = new PriceSyncRequest();
|
|
||||||
priceSyncRequest.setAllYn("Y");
|
|
||||||
|
|
||||||
this.priceSyncResponse =
|
this.priceSyncResponse =
|
||||||
interfaceQsp.callApiData(
|
interfaceQsp.callApiData(
|
||||||
HttpMethod.GET, qspInterfaceUrl, priceSyncRequest, PriceSyncResponse.class);
|
HttpMethod.GET, qspInterfaceUrl + "?allYn=N", null, PriceSyncResponse.class);
|
||||||
log.info("API 호출 완료, 항목 수: {}", this.priceSyncResponse.getModulePriceList().size());
|
log.info("API 호출 완료, 항목 수: {}", this.priceSyncResponse.getModulePriceList().size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("priceSyncResponse 갱신 중 오류: {}", e.getMessage());
|
log.error("priceSyncResponse 갱신 중 오류: {}", e.getMessage());
|
||||||
@ -132,14 +128,14 @@ public class PriceJobConfiguration implements JobExecutionListener {
|
|||||||
@StepScope
|
@StepScope
|
||||||
public ListItemReader<PriceItemSyncResponse> modulePriceListReader() {
|
public ListItemReader<PriceItemSyncResponse> modulePriceListReader() {
|
||||||
return createReader(
|
return createReader(
|
||||||
priceSyncResponse != null ? priceSyncResponse.getModulePriceList() : null, "store");
|
priceSyncResponse != null ? priceSyncResponse.getModulePriceList() : null, "module");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@StepScope
|
@StepScope
|
||||||
public ListItemReader<PriceItemSyncResponse> bosPriceListReader() {
|
public ListItemReader<PriceItemSyncResponse> bosPriceListReader() {
|
||||||
return createReader(
|
return createReader(
|
||||||
priceSyncResponse != null ? priceSyncResponse.getBosPriceList() : null, "user");
|
priceSyncResponse != null ? priceSyncResponse.getBosPriceList() : null, "bos");
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user