Authored by 胡古飞

fix shopsNew

... ... @@ -288,33 +288,35 @@ public class ShopsServiceImpl extends BaseService implements IShopsService, Appl
// 3、查询店铺和全球购品牌
SearchApiResult shopListApiResult = shopListService.searchShopList(paramMap);
if (shopListApiResult == null) {
if (shopListApiResult != null) {
JSONObject jsonObject = (JSONObject) shopListApiResult.getData();
JSONArray shop_list = jsonObject.getJSONArray("shop_list");
for (int i = 0; i < shop_list.size(); i++) {
JSONObject shop_info = shop_list.getJSONObject(0);
if (shop_info.getJSONObject("yoho_shop") != null) {
JSONObject yohoShop = this.getShopDataMapFromMap(shop_info.getJSONObject("yoho_shop"));
returnMap.put("shop", yohoShop);
return searchApiResult.setData(returnMap);
}
if (shop_info.getJSONObject("tbl_brand") != null) {
JSONObject tblBrand = this.getTblBrandFromMap(shop_info.getJSONObject("tbl_brand"));
returnMap.put("tblBrand", tblBrand);
return searchApiResult.setData(returnMap);
if (shop_list != null && !shop_list.isEmpty()) {
for (int i = 0; i < shop_list.size(); i++) {
JSONObject shop_info = shop_list.getJSONObject(0);
if (shop_info.getJSONObject("yoho_shop") != null) {
JSONObject yohoShop = this.getShopDataMapFromMap(shop_info.getJSONObject("yoho_shop"));
returnMap.put("shop", yohoShop);
return searchApiResult.setData(returnMap);
}
if (shop_info.getJSONObject("tbl_brand") != null) {
JSONObject tblBrand = this.getTblBrandFromMap(shop_info.getJSONObject("tbl_brand"));
returnMap.put("tblBrand", tblBrand);
return searchApiResult.setData(returnMap);
}
}
}
}
}
// 4、获取有货品牌信息
returnMap.put("brand", this.getYohoBrand(paramMap));
//5、返回结果
// 5、返回结果
return searchApiResult.setData(returnMap);
} catch (Exception e) {
return SearchApiResultUtils.errorSearchApiResult("searchShopsNew", paramMap, e);
}
}
private JSONObject getShopDataMapFromMap(Map<String, Object> shopInfo) {
JSONObject shopDataMap = new JSONObject();
shopDataMap.put("shop_id", shopInfo.getOrDefault("shop_id", 0));
... ...