|
|
@@ -310,32 +310,27 @@ public class SearchServiceImpl implements SearchService{
|
|
|
result = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_KEYWORD_URL, String.class, map);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
- if(StringUtils.isEmpty(result)) {
|
|
|
- return null;
|
|
|
- }else {
|
|
|
- try {
|
|
|
- switch (type) {
|
|
|
- case ALL:
|
|
|
- List<Object> resultMapCmp = FastjsonUtils.fromJsonArray(resultCmp);
|
|
|
- List<Object> resultMapKind = FastjsonUtils.fromJsonArray(resultKind);
|
|
|
- List<Object> resultMapBrand = FastjsonUtils.fromJsonArray(resultBrand);
|
|
|
- map.clear();
|
|
|
- map.put("component",resultMapCmp);
|
|
|
- map.put("kind",resultMapKind);
|
|
|
- map.put("brand",resultMapBrand);
|
|
|
- break;
|
|
|
- default:
|
|
|
- List<Object> resultMap = FastjsonUtils.fromJsonArray(result);
|
|
|
- map.clear();
|
|
|
- map.put("result",resultMap);
|
|
|
- break;
|
|
|
- }
|
|
|
- return map;
|
|
|
- }catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return null;
|
|
|
+ try {
|
|
|
+ switch (type) {
|
|
|
+ case ALL:
|
|
|
+ List<Object> resultMapCmp = FastjsonUtils.fromJsonArray(resultCmp);
|
|
|
+ List<Object> resultMapKind = FastjsonUtils.fromJsonArray(resultKind);
|
|
|
+ List<Object> resultMapBrand = FastjsonUtils.fromJsonArray(resultBrand);
|
|
|
+ map.clear();
|
|
|
+ map.put("component",resultMapCmp);
|
|
|
+ map.put("kind",resultMapKind);
|
|
|
+ map.put("brand",resultMapBrand);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ List<Object> resultMap = FastjsonUtils.fromJsonArray(result);
|
|
|
+ map.clear();
|
|
|
+ map.put("result",resultMap);
|
|
|
+ break;
|
|
|
}
|
|
|
+ return map;
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|
|
|
|