|
|
package com.yoho.search.service.service.base;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
...
|
...
|
@@ -30,42 +31,26 @@ public class BrandIndexBaseService { |
|
|
|
|
|
private static final String BRAND_INDEX_NAME = ISearchConstants.INDEX_NAME_BRAND;
|
|
|
|
|
|
private Map<String, Object> getBrandMapOld(Map<String, Object> esMap) {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
map.put("id", esMap.get("id"));
|
|
|
map.put("brand_alif", esMap.get("brandAlif"));
|
|
|
map.put("brand_name_en", esMap.get("brandNameEn"));
|
|
|
map.put("brand_domain", esMap.get("brandDomain"));
|
|
|
map.put("is_hot", esMap.get("isHot"));
|
|
|
map.put("hot_keyword", esMap.get("hotKeyword"));
|
|
|
map.put("brand_name_cn", esMap.get("brandNameCn"));
|
|
|
map.put("brand_ico", esMap.get("brandIco"));
|
|
|
map.put("brand_name", esMap.get("brandName"));
|
|
|
map.put("brand_keyword", esMap.get("brandKeyword"));
|
|
|
map.put("status", esMap.get("status"));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getBrandMap(Map<String, Object> esMap) {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
map.put("id", esMap.get("id"));
|
|
|
map.put("brand_name", esMap.getOrDefault("brandName",""));
|
|
|
map.put("brand_name_en", esMap.getOrDefault("brandNameEn",""));
|
|
|
map.put("brand_name_cn", esMap.getOrDefault("brandNameCn",""));
|
|
|
map.put("brand_ico", esMap.getOrDefault("brandIco",""));
|
|
|
map.put("shelves_brand_time", esMap.getOrDefault("shelvesBrandTime",0));
|
|
|
map.put("is_hot", esMap.getOrDefault("isHot","N"));
|
|
|
map.put("status", esMap.getOrDefault("status",0));
|
|
|
map.put("brand_alif", esMap.getOrDefault("brandAlif",""));
|
|
|
map.put("brand_domain", esMap.getOrDefault("brandDomain",""));
|
|
|
map.put("hot_keyword", esMap.getOrDefault("hotKeyword",""));
|
|
|
map.put("brand_keyword", esMap.getOrDefault("brandKeyword",""));
|
|
|
map.put("yoho_brand_id", esMap.getOrDefault("yohoBrandId",0));
|
|
|
map.put("is_global", esMap.getOrDefault("isGlobal","N"));
|
|
|
map.put("brand_name", esMap.getOrDefault("brandName", ""));
|
|
|
map.put("brand_name_en", esMap.getOrDefault("brandNameEn", ""));
|
|
|
map.put("brand_name_cn", esMap.getOrDefault("brandNameCn", ""));
|
|
|
map.put("brand_ico", esMap.getOrDefault("brandIco", ""));
|
|
|
map.put("shelves_brand_time", esMap.getOrDefault("shelvesBrandTime", 0));
|
|
|
map.put("is_hot", esMap.getOrDefault("isHot", "N"));
|
|
|
map.put("status", esMap.getOrDefault("status", 0));
|
|
|
map.put("brand_alif", esMap.getOrDefault("brandAlif", ""));
|
|
|
map.put("brand_domain", esMap.getOrDefault("brandDomain", ""));
|
|
|
map.put("hot_keyword", esMap.getOrDefault("hotKeyword", ""));
|
|
|
map.put("brand_keyword", esMap.getOrDefault("brandKeyword", ""));
|
|
|
map.put("yoho_brand_id", esMap.getOrDefault("yohoBrandId", 0));
|
|
|
map.put("is_global", esMap.getOrDefault("isGlobal", "N"));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getBrandListByIds(List<?> brandIds) {
|
|
|
public List<Map<String, Object>> getBrandListByIds(Collection<?> brandIds) {
|
|
|
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
|
|
|
try {
|
|
|
List<Map<String, Object>> multiGetResults = searchCommonService.doMultiGetCommon(BRAND_INDEX_NAME, brandIds);
|
...
|
...
|
@@ -78,7 +63,7 @@ public class BrandIndexBaseService { |
|
|
return resultList;
|
|
|
}
|
|
|
|
|
|
public Map<String, Map<String, Object>> getBrandMapByIds(List<?> brandIds) {
|
|
|
public Map<String, Map<String, Object>> getBrandMapByIds(Collection<?> brandIds) {
|
|
|
List<Map<String, Object>> resultList = this.getBrandListByIds(brandIds);
|
|
|
Map<String, Map<String, Object>> resultMap = new HashMap<String, Map<String, Object>>();
|
|
|
for (Map<String, Object> result : resultList) {
|
...
|
...
|
@@ -93,7 +78,7 @@ public class BrandIndexBaseService { |
|
|
* @param globalBrandIds
|
|
|
* @return
|
|
|
*/
|
|
|
private List<Map<String, Object>> getGlobalBrandListByIds(List<?> brandIds) {
|
|
|
private List<Map<String, Object>> getGlobalBrandListByIds(Collection<?> brandIds) {
|
|
|
if (brandIds == null || brandIds.isEmpty()) {
|
|
|
return new ArrayList<Map<String, Object>>();
|
|
|
}
|
...
|
...
|
@@ -116,7 +101,7 @@ public class BrandIndexBaseService { |
|
|
return list;
|
|
|
}
|
|
|
|
|
|
public Map<String, Map<String, Object>> getGlobalBrandMapByIds(List<?> brandIds) {
|
|
|
public Map<String, Map<String, Object>> getGlobalBrandMapByIds(Collection<?> brandIds) {
|
|
|
List<Map<String, Object>> resultList = this.getGlobalBrandListByIds(brandIds);
|
|
|
Map<String, Map<String, Object>> resultMap = new HashMap<String, Map<String, Object>>();
|
|
|
for (Map<String, Object> result : resultList) {
|
...
|
...
|
|