Authored by hugufei

fix bug

... ... @@ -46,7 +46,7 @@ public class DefaultProductListService {
*/
@SearchCacheAble(cacheName = "PRODUCT_LIST_NOT_PERSIONAL", cacheType = CacheType.SEARCH_REDIS, cacheInMinute = 10, excludeParams = { "uid", "firstProductSkn" })
public SearchApiResult productListNotPersional(Map<String, String> paramMap) {
return this.productList(paramMap);
return this.productList(paramMap,false);
}
/**
... ... @@ -57,10 +57,10 @@ public class DefaultProductListService {
*/
@SearchCacheAble(cacheName = "PRODUCT_LIST_DEFAULT_PERSIONAL", cacheType = CacheType.SEARCH_REDIS, cacheInMinute = 10)
public SearchApiResult productListForDefaultPersional(Map<String, String> paramMap) {
return this.productList(paramMap);
return this.productList(paramMap,true);
}
private SearchApiResult productList(Map<String, String> paramMap){
private SearchApiResult productList(Map<String, String> paramMap,boolean reSort){
try {
// 1)获取分页参数
int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
... ... @@ -84,7 +84,10 @@ public class DefaultProductListService {
dataMap.put("page_size", searchParam.getSize());
dataMap.put("page_total", searchResult.getTotalPage());
List<Map<String, Object>> product_list = productIndexBaseService.getProductListWithPricePlan(searchResult.getResultList());
dataMap.put("product_list", productListSortService.sortProductList(product_list));// 处理一下商品的顺序;
if(reSort){
product_list = productListSortService.sortProductList(product_list);// 处理一下商品的顺序;
}
dataMap.put("product_list",product_list);
return new SearchApiResult().setData(dataMap);
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ...