|
@@ -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
|
|