Authored by hugufei

fix QueryUserPersionalFactorBean

... ... @@ -107,21 +107,28 @@ public class QueryUserPersionalFactorBean {
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
filterSortBrandKeys.add(existSortBrand.key());
}
//8、构造个性化结果[如果个性化结果为空,则取配置的品类品牌数据]
//8、构造个性化结果
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, realTimeYoutubeSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
//9、如果个性化结果为空,再取配置的品类品牌数据
if (userPersonalFactor.isUserPersonalFactorEmpty()) {
this.fillConfigSortBrandList(userPersonalFactor, pageId, pageFactor, pageSortBrandKeys, filterSortBrandKeys);
int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 12);
List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
userPersonalFactor.setConfigSortBrandList(configSortBrandList);
}
//9、返回最终结果
return userPersonalFactor;
}
private void fillConfigSortBrandList(UserPersonalFactor userPersonalFactor, int pageId, PagePersonalFactor pageFactor, Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys) {
int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 0);
List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
userPersonalFactor.setConfigSortBrandList(configSortBrandList);
//10、返回最终结果
return userPersonalFactor;
}
/**
* 生成用户实时的品类*品牌数据【join页面已有的】
*
* @param pageSortBrandKeys
* @param userSortBrands
* @param maxCount
* @return
*/
private List<SortBrand> joinRealTimeSortBrandList(Set<String> pageSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
List<SortBrand> results = new ArrayList<>();
if (pageSortBrandKeys == null || pageSortBrandKeys.isEmpty() || userSortBrands == null || userSortBrands.isEmpty() || maxCount <= 0) {
... ... @@ -139,6 +146,7 @@ public class QueryUserPersionalFactorBean {
return results;
}
/**
* 【品类+价格带】
*
... ...
... ... @@ -34,7 +34,7 @@ public class RecallConfigService {
}
/**
* 获取某些策略的召回数量
* 获取策略的召回数量
*
* @param userRecallRequest
* @param strategyEnum
... ... @@ -51,7 +51,7 @@ public class RecallConfigService {
}
/**
* 获取某些策略的间隔
* 获取策略的间隔
*
* @param userRecallRequest
* @param strategyEnum
... ... @@ -68,7 +68,7 @@ public class RecallConfigService {
}
/**
* 获取推荐的【品类*品牌】的数量
* 获取【品类*品牌】的数量
*
* @param pageId
* @return
... ...