Authored by zhaojun2

FIX BUG

@@ -47,6 +47,8 @@ public class BrandIndexBaseService { @@ -47,6 +47,8 @@ public class BrandIndexBaseService {
47 map.put("brand_keyword", MapUtils.getString(esMap, "brandKeyword", "")); 47 map.put("brand_keyword", MapUtils.getString(esMap, "brandKeyword", ""));
48 map.put("yoho_brand_id", MapUtils.getIntValue(esMap, "yohoBrandId", 0)); 48 map.put("yoho_brand_id", MapUtils.getIntValue(esMap, "yohoBrandId", 0));
49 map.put("is_global", MapUtils.getString(esMap, "isGlobal", "N")); 49 map.put("is_global", MapUtils.getString(esMap, "isGlobal", "N"));
  50 + //模糊搜索页 全球购用
  51 + map.put("shop_intro", "品牌官方授权");
50 return map; 52 return map;
51 } 53 }
52 54
@@ -45,7 +45,7 @@ public class ShopsIndexBaseService extends BaseService { @@ -45,7 +45,7 @@ public class ShopsIndexBaseService extends BaseService {
45 map.put("blk_status", MapUtils.getIntValue(esMap, "blkStatus", 0)); 45 map.put("blk_status", MapUtils.getIntValue(esMap, "blkStatus", 0));
46 map.put("check_status", MapUtils.getIntValue(esMap, "checkStatus", 0)); 46 map.put("check_status", MapUtils.getIntValue(esMap, "checkStatus", 0));
47 map.put("search_show_image", MapUtils.getString(esMap, "searchShowImage", "")); 47 map.put("search_show_image", MapUtils.getString(esMap, "searchShowImage", ""));
48 - map.put("shop_intro", MapUtils.getString(esMap, "shopIntro", "")); 48 + map.put("shop_intro", MapUtils.getString(esMap, "shopIntro", "品牌官方授权"));
49 return map; 49 return map;
50 } 50 }
51 51
@@ -136,8 +136,8 @@ public class FuzzySceneService extends AbstractPageSceneService { @@ -136,8 +136,8 @@ public class FuzzySceneService extends AbstractPageSceneService {
136 if (!CollectionUtils.isEmpty(jsonArray)) { 136 if (!CollectionUtils.isEmpty(jsonArray)) {
137 for (int i = 0; i < jsonArray.size(); i++) { 137 for (int i = 0; i < jsonArray.size(); i++) {
138 JSONObject subJsonObject = jsonArray.getJSONObject(i); 138 JSONObject subJsonObject = jsonArray.getJSONObject(i);
139 - JSONObject shopJsonObject = subJsonObject.getJSONObject("yoho_shop");  
140 - if (shopWithAdditionalImage.size() < 1 && StringUtils.isNotBlank(shopJsonObject.getString("search_show_image"))) { 139 + JSONObject yohoShopJsonObject = subJsonObject.getJSONObject("yoho_shop");
  140 + if (yohoShopJsonObject != null && shopWithAdditionalImage.size() < 1 && StringUtils.isNotBlank(yohoShopJsonObject.getString("search_show_image"))) {
141 shopWithAdditionalImage.add(subJsonObject); 141 shopWithAdditionalImage.add(subJsonObject);
142 } else { 142 } else {
143 otherShops.add(subJsonObject); 143 otherShops.add(subJsonObject);
@@ -147,6 +147,12 @@ public class FuzzySceneService extends AbstractPageSceneService { @@ -147,6 +147,12 @@ public class FuzzySceneService extends AbstractPageSceneService {
147 } 147 }
148 } 148 }
149 dataMap.put("shop_list_top", shopWithAdditionalImage); 149 dataMap.put("shop_list_top", shopWithAdditionalImage);
  150 + //如果没有top 按原来样式
  151 + if (CollectionUtils.isEmpty(shopWithAdditionalImage)) {
  152 + dataMap.put("shop_list", otherShops);
  153 + return;
  154 + }
  155 +
150 int page = getPage(paramMap); 156 int page = getPage(paramMap);
151 int pageSize = 2; 157 int pageSize = 2;
152 List<JSONObject> subShopList = SearchCollectionUtils.safeSubList(otherShops, (page - 1) * pageSize, page * pageSize); 158 List<JSONObject> subShopList = SearchCollectionUtils.safeSubList(otherShops, (page - 1) * pageSize, page * pageSize);
@@ -165,7 +171,6 @@ public class FuzzySceneService extends AbstractPageSceneService { @@ -165,7 +171,6 @@ public class FuzzySceneService extends AbstractPageSceneService {
165 int productListSize = productList == null ? 0 : productList.size(); 171 int productListSize = productList == null ? 0 : productList.size();
166 subShopList = subShopList.stream().filter(e -> e.getIntValue("index") < productListSize).collect(Collectors.toList()); 172 subShopList = subShopList.stream().filter(e -> e.getIntValue("index") < productListSize).collect(Collectors.toList());
167 } 173 }
168 -  
169 dataMap.put("shop_list", subShopList); 174 dataMap.put("shop_list", subShopList);
170 } 175 }
171 176