...
|
...
|
@@ -3,12 +3,11 @@ package com.yoho.search.consumer.service.logic.productIndex.viewBuilder; |
|
|
import com.yoho.search.consumer.service.bo.ProductIBO;
|
|
|
import com.yoho.search.consumer.service.bo.ProductIndexBO;
|
|
|
import com.yoho.search.consumer.service.logic.ProductIndexLogicService;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -25,13 +24,7 @@ public class GeneralDataBuilder { |
|
|
public void buildDataFromProductI(List<ProductIndexBO> productIndexBOs, List<ProductIBO> productIBOs) {
|
|
|
for (ProductIBO p : productIBOs) {
|
|
|
ProductIndexBO productIndexBO = new ProductIndexBO();
|
|
|
try {
|
|
|
BeanUtils.copyProperties(productIndexBO,p);
|
|
|
} catch (IllegalAccessException e) {
|
|
|
logger.error("ProductIBO to ProductIndexBO copyProperties fail,id=[{}]",p.getId());
|
|
|
} catch (InvocationTargetException e) {
|
|
|
logger.error("ProductIBO to ProductIndexBO copyProperties fail,id=[{}]",p.getId());
|
|
|
}
|
|
|
BeanUtils.copyProperties(productIndexBO,p);
|
|
|
productIndexBOs.add(productIndexBO);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -113,20 +106,5 @@ public class GeneralDataBuilder { |
|
|
}
|
|
|
|
|
|
|
|
|
public static void main(String[] args){
|
|
|
ProductIndexBO productIndexBO = new ProductIndexBO();
|
|
|
ProductIBO productIBO = new ProductIBO();
|
|
|
productIBO.setId(1);
|
|
|
productIBO.setProductName("123");
|
|
|
try {
|
|
|
BeanUtils.copyProperties(productIndexBO,productIBO);
|
|
|
} catch (IllegalAccessException e) {
|
|
|
e.printStackTrace();
|
|
|
} catch (InvocationTargetException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
System.out.println(productIndexBO.getId());
|
|
|
System.out.println(productIndexBO.getProductName());
|
|
|
|
|
|
}
|
|
|
} |
...
|
...
|
|