使用BeanUtils.copyProperties 试试
Showing
1 changed file
with
8 additions
and
14 deletions
@@ -18,16 +18,16 @@ public class GeneralDataBuilder { | @@ -18,16 +18,16 @@ public class GeneralDataBuilder { | ||
18 | 18 | ||
19 | private final Logger logger = LoggerFactory.getLogger(ProductIndexLogicService.class); | 19 | private final Logger logger = LoggerFactory.getLogger(ProductIndexLogicService.class); |
20 | 20 | ||
21 | - /** | ||
22 | - * 拼装来自ProductI的数据 | ||
23 | - */ | ||
24 | - public void buildDataFromProductI(List<ProductIndexBO> productIndexBOs, List<ProductIBO> productIBOs) { | ||
25 | - for (ProductIBO p : productIBOs) { | 21 | + /** |
22 | + * 拼装来自ProductI的数据 | ||
23 | + */ | ||
24 | + public void buildDataFromProductI(List<ProductIndexBO> productIndexBOs, List<ProductIBO> productIBOs) { | ||
25 | + for (ProductIBO productIBO : productIBOs) { | ||
26 | ProductIndexBO productIndexBO = new ProductIndexBO(); | 26 | ProductIndexBO productIndexBO = new ProductIndexBO(); |
27 | - BeanUtils.copyProperties(productIndexBO,p); | 27 | + BeanUtils.copyProperties(productIBO, productIndexBO); |
28 | productIndexBOs.add(productIndexBO); | 28 | productIndexBOs.add(productIndexBO); |
29 | - } | ||
30 | - | 29 | + } |
30 | + } | ||
31 | // productIndexBO.setId(p.getId()); | 31 | // productIndexBO.setId(p.getId()); |
32 | // productIndexBO.setProductId(p.getProductId()); | 32 | // productIndexBO.setProductId(p.getProductId()); |
33 | // productIndexBO.setProductSkn(p.getProductSkn()); | 33 | // productIndexBO.setProductSkn(p.getProductSkn()); |
@@ -101,10 +101,4 @@ public class GeneralDataBuilder { | @@ -101,10 +101,4 @@ public class GeneralDataBuilder { | ||
101 | // productIndexBO.setPattern(p.getPattern()); | 101 | // productIndexBO.setPattern(p.getPattern()); |
102 | // productIndexBO.setPhrase(p.getPhrase()); | 102 | // productIndexBO.setPhrase(p.getPhrase()); |
103 | // productIndexBO.setIsPhraseExist(p.getIsPhraseExist()); | 103 | // productIndexBO.setIsPhraseExist(p.getIsPhraseExist()); |
104 | - | ||
105 | - | ||
106 | - } | ||
107 | - | ||
108 | - | ||
109 | - | ||
110 | } | 104 | } |
-
Please register or login to post a comment