Browse Source

fixbug--品牌更新同更新Goods索引时增加物料信息维护

wangyc 6 years ago
parent
commit
b1f153417e

+ 7 - 0
mall-search/src/main/java/com/uas/search/service/impl/IndexServiceImpl.java

@@ -1034,9 +1034,16 @@ public class IndexServiceImpl implements IndexService {
                     Goods goods = DocumentToObjectUtils.toGoods(document);
                     Goods goods = DocumentToObjectUtils.toGoods(document);
                     if (brand != null) {
                     if (brand != null) {
                         goods.getComponent().setBrand(brand);
                         goods.getComponent().setBrand(brand);
+                        if (goods.getProducts() != null) {
+                            goods.getProducts().setpBrandEn(brand.getNameEn());
+                            goods.getProducts().setpBrandCn(brand.getNameCn());
+                        }
                     }
                     }
                     if (kind != null) {
                     if (kind != null) {
                         goods.getComponent().setKind(kind);
                         goods.getComponent().setKind(kind);
+                        if (goods.getProducts() != null) {
+                            goods.getProducts().setKind(kind.getNameCn());
+                        }
                     }
                     }
                     if (products != null) {
                     if (products != null) {
                         goods.setProducts(products);
                         goods.setProducts(products);