|
@@ -156,11 +156,15 @@ public class SearchProductServiceImpl implements SearchProductService {
|
|
if (1 == resultJson.getInt("status")) {
|
|
if (1 == resultJson.getInt("status")) {
|
|
JSONArray pageData = resultJson.getJSONArray("items");
|
|
JSONArray pageData = resultJson.getJSONArray("items");
|
|
for (int i = 0; i < pageData.length(); i++) {
|
|
for (int i = 0; i < pageData.length(); i++) {
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
|
JSONObject json = pageData.getJSONObject(i);
|
|
JSONObject json = pageData.getJSONObject(i);
|
|
- map.put("id", json.getInt("p_brand_id"));
|
|
|
|
- map.put("name", json.getString("p_brand_name"));
|
|
|
|
- maps.add(map);
|
|
|
|
|
|
+ int brandId = json.getInt("p_brand_id");
|
|
|
|
+ String brandName = json.getString("p_brand_name");
|
|
|
|
+ if (brandId > 0 && StringUtils.isNotEmpty(brandName)) {
|
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("id", brandId);
|
|
|
|
+ map.put("name", brandName);
|
|
|
|
+ maps.add(map);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 阿里云查询出json转换成商品pojo
|
|
// 阿里云查询出json转换成商品pojo
|
|
result = ResponseJson.success(maps);
|
|
result = ResponseJson.success(maps);
|