Merge pull request 'java 버전 맞춤2' (#453) from dev into dev-deploy
Reviewed-on: #453
This commit is contained in:
commit
b2aaa85642
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||||||
import com.interplug.qcast.biz.estimate.EstimateService;
|
import com.interplug.qcast.biz.estimate.EstimateService;
|
||||||
import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse;
|
import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.batch.core.Job;
|
import org.springframework.batch.core.Job;
|
||||||
@ -74,7 +75,7 @@ public class PlanConfrimConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
public ItemWriter<PlanSyncResponse> planConfirmWriter() {
|
public ItemWriter<PlanSyncResponse> planConfirmWriter() {
|
||||||
return items -> {
|
return items -> {
|
||||||
estimateService.setPlanConfirmSyncSave((List<PlanSyncResponse>) items.getItems());
|
estimateService.setPlanConfirmSyncSave(new ArrayList<>(items.getItems()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ 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.BomSyncResponse;
|
import com.interplug.qcast.biz.displayItem.dto.BomSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.batch.core.Job;
|
import org.springframework.batch.core.Job;
|
||||||
@ -74,7 +75,7 @@ public class BomConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
public ItemWriter<BomSyncResponse> bomWriter() {
|
public ItemWriter<BomSyncResponse> bomWriter() {
|
||||||
return items -> {
|
return items -> {
|
||||||
displayItemService.setBomSyncSave((List<BomSyncResponse>) items.getItems());
|
displayItemService.setBomSyncSave(new ArrayList<>(items.getItems()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ public class MaterialConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
public ItemWriter<ItemSyncResponse> materialWriter() {
|
public ItemWriter<ItemSyncResponse> materialWriter() {
|
||||||
return items -> {
|
return items -> {
|
||||||
displayItemService.setItemSyncSave((List<ItemSyncResponse>) items.getItems());
|
displayItemService.setItemSyncSave(new ArrayList<>(items.getItems()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ 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.PriceSyncResponse;
|
import com.interplug.qcast.biz.displayItem.dto.PriceSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -141,7 +142,7 @@ public class PriceJobConfiguration implements JobExecutionListener {
|
|||||||
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
||||||
return items -> {
|
return items -> {
|
||||||
try {
|
try {
|
||||||
List<T> itemList = (List<T>) items.getItems();
|
List<T> itemList = new ArrayList<>(items.getItems());
|
||||||
processor.accept(itemList);
|
processor.accept(itemList);
|
||||||
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.interplug.qcast.biz.specialNote.dto.SpecialNoteItemRequest;
|
|||||||
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest;
|
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteRequest;
|
||||||
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse;
|
import com.interplug.qcast.biz.specialNote.dto.SpecialNoteSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -157,7 +158,7 @@ public class SpecialNoteDispItemJobConfiguration implements JobExecutionListener
|
|||||||
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
||||||
return items -> {
|
return items -> {
|
||||||
try {
|
try {
|
||||||
List<T> itemList = (List<T>) items.getItems();
|
List<T> itemList = new ArrayList<>(items.getItems());
|
||||||
processor.accept(itemList);
|
processor.accept(itemList);
|
||||||
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.interplug.qcast.biz.user.dto.StoreSyncResponse;
|
|||||||
import com.interplug.qcast.biz.user.dto.StoreSyncResquest;
|
import com.interplug.qcast.biz.user.dto.StoreSyncResquest;
|
||||||
import com.interplug.qcast.biz.user.dto.UserRequest;
|
import com.interplug.qcast.biz.user.dto.UserRequest;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -212,7 +213,7 @@ public class StoreJobConfiguration implements JobExecutionListener {
|
|||||||
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
||||||
return items -> {
|
return items -> {
|
||||||
try {
|
try {
|
||||||
List<T> itemList = (List<T>) items.getItems();
|
List<T> itemList = new ArrayList<>(items.getItems());
|
||||||
processor.accept(itemList);
|
processor.accept(itemList);
|
||||||
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||||||
import com.interplug.qcast.biz.user.UserService;
|
import com.interplug.qcast.biz.user.UserService;
|
||||||
import com.interplug.qcast.biz.user.dto.AdminUserSyncResponse;
|
import com.interplug.qcast.biz.user.dto.AdminUserSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.batch.core.Job;
|
import org.springframework.batch.core.Job;
|
||||||
@ -82,7 +83,7 @@ public class AdminUserConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
public ItemWriter<AdminUserSyncResponse> adminUserWriter() {
|
public ItemWriter<AdminUserSyncResponse> adminUserWriter() {
|
||||||
return items -> {
|
return items -> {
|
||||||
userService.setAdminUserSyncSave((List<AdminUserSyncResponse>) items.getItems());
|
userService.setAdminUserSyncSave(new ArrayList<>(items.getItems()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||||||
import com.interplug.qcast.biz.user.UserService;
|
import com.interplug.qcast.biz.user.UserService;
|
||||||
import com.interplug.qcast.biz.user.dto.BusinessChargerSyncResponse;
|
import com.interplug.qcast.biz.user.dto.BusinessChargerSyncResponse;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.batch.core.Job;
|
import org.springframework.batch.core.Job;
|
||||||
@ -78,7 +79,7 @@ public class BusinessChargerConfiguration implements JobExecutionListener {
|
|||||||
@Bean
|
@Bean
|
||||||
public ItemWriter<BusinessChargerSyncResponse> businessChargerWriter() {
|
public ItemWriter<BusinessChargerSyncResponse> businessChargerWriter() {
|
||||||
return items -> {
|
return items -> {
|
||||||
userService.setBusinessChargerSyncSave((List<BusinessChargerSyncResponse>) items.getItems());
|
userService.setBusinessChargerSyncSave(new ArrayList<>(items.getItems()));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.interplug.qcast.batch.system;
|
package com.interplug.qcast.batch.system;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -126,7 +127,7 @@ public class CommonCodeConfiguration implements JobExecutionListener {
|
|||||||
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
private <T> ItemWriter<T> createWriter(Consumer<List<T>> processor, String writerName) {
|
||||||
return items -> {
|
return items -> {
|
||||||
try {
|
try {
|
||||||
List<T> itemList = (List<T>) items.getItems();
|
List<T> itemList = new ArrayList<>(items.getItems());
|
||||||
processor.accept(itemList);
|
processor.accept(itemList);
|
||||||
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
log.info("{}Writer: {} items 처리 완료", writerName, items.size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.interplug.qcast.config.json;
|
|||||||
import com.fasterxml.jackson.core.SerializableString;
|
import com.fasterxml.jackson.core.SerializableString;
|
||||||
import com.fasterxml.jackson.core.io.CharacterEscapes;
|
import com.fasterxml.jackson.core.io.CharacterEscapes;
|
||||||
import com.fasterxml.jackson.core.io.SerializedString;
|
import com.fasterxml.jackson.core.io.SerializedString;
|
||||||
import org.apache.commons.lang3.StringEscapeUtils;
|
import org.springframework.web.util.HtmlUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -50,7 +50,7 @@ public class HtmlCharacterEscapes extends CharacterEscapes {
|
|||||||
sb.append(String.format("%04x", ch));
|
sb.append(String.format("%04x", ch));
|
||||||
serializedString = new SerializedString(sb.toString());
|
serializedString = new SerializedString(sb.toString());
|
||||||
} else {
|
} else {
|
||||||
serializedString = new SerializedString(StringEscapeUtils.escapeHtml4(Character.toString(charAt)));
|
serializedString = new SerializedString(HtmlUtils.htmlEscape(Character.toString(charAt)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return serializedString;
|
return serializedString;
|
||||||
|
|||||||
@ -53,6 +53,7 @@ public class InterfaceQsp {
|
|||||||
// GET 요청 시 requestObject를 쿼리 스트링으로 변환
|
// GET 요청 시 requestObject를 쿼리 스트링으로 변환
|
||||||
if (HttpMethod.GET.equals(httpMethod) && requestObject != null) {
|
if (HttpMethod.GET.equals(httpMethod) && requestObject != null) {
|
||||||
ObjectMapper om = new ObjectMapper();
|
ObjectMapper om = new ObjectMapper();
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, Object> params = om.convertValue(requestObject, Map.class); // Object -> Map 변환
|
Map<String, Object> params = om.convertValue(requestObject, Map.class); // Object -> Map 변환
|
||||||
String queryString =
|
String queryString =
|
||||||
params.entrySet().stream()
|
params.entrySet().stream()
|
||||||
@ -159,11 +160,17 @@ public class InterfaceQsp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (responseObject == null) {
|
if (responseObject == null) {
|
||||||
return (T) dataJson;
|
@SuppressWarnings("unchecked")
|
||||||
|
T result = (T) dataJson;
|
||||||
|
return result;
|
||||||
} else if (responseObject instanceof Class<?>) {
|
} else if (responseObject instanceof Class<?>) {
|
||||||
return om.readValue(dataJson, (Class<T>) responseObject);
|
@SuppressWarnings("unchecked")
|
||||||
|
Class<T> responseClass = (Class<T>) responseObject;
|
||||||
|
return om.readValue(dataJson, responseClass);
|
||||||
} else if (responseObject instanceof TypeReference<?>) {
|
} else if (responseObject instanceof TypeReference<?>) {
|
||||||
return om.readValue(dataJson, (TypeReference<T>) responseObject);
|
@SuppressWarnings("unchecked")
|
||||||
|
TypeReference<T> responseType = (TypeReference<T>) responseObject;
|
||||||
|
return om.readValue(dataJson, responseType);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Unsupported responseType");
|
throw new IllegalArgumentException("Unsupported responseType");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user