...
|
...
|
@@ -74,16 +74,13 @@ public class QueryUserPersionalFactorBean { |
|
|
//2、构造推荐的skn列表
|
|
|
List<Integer> recommendSknList = userFactor.getRecommendSknList();
|
|
|
List<Integer> realTimeSimilarSknList = userFactor.getRealTimeSimilarSknList();
|
|
|
|
|
|
//3、获取页面中存在的所有的key
|
|
|
Set<String> pageSortBrandKeys = new HashSet<>();
|
|
|
for (SortBrand pageSortBrand : pageFactor.getSortBrandList()) {
|
|
|
pageSortBrandKeys.add(pageSortBrand.key());
|
|
|
}
|
|
|
|
|
|
//4、构造临时过滤对象
|
|
|
Set<String> filterSortBrandKeys = new HashSet<>();
|
|
|
|
|
|
//5、构造实时【品类+品牌】
|
|
|
int recSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.REC_SORT_BRAND, 12);
|
|
|
List<SortBrand> realTimeSortBrandList = this.queryRealTimeSortBrandList(pageSortBrandKeys, filterSortBrandKeys, userFactor.getRealTimeSortBrandList(), recSortBrandCount);
|
...
|
...
|
@@ -105,11 +102,19 @@ public class QueryUserPersionalFactorBean { |
|
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
|
|
filterSortBrandKeys.add(existSortBrand.key());
|
|
|
}
|
|
|
//8、构造基于配置的【品牌+品牌】,去除其他类型的品类和品牌
|
|
|
//8、构造个性化结果[如果个性化结果为空,则取配置的品类品牌数据]
|
|
|
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
|
|
if (userPersonalFactor.isUserPersonalFactorEmpty()) {
|
|
|
this.fillConfigSortBrandList(userPersonalFactor, pageId, pageFactor, pageSortBrandKeys, filterSortBrandKeys);
|
|
|
}
|
|
|
//10、返回最终结果
|
|
|
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);
|
|
|
//9、返回最终结果
|
|
|
return new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList, configSortBrandList);
|
|
|
List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
|
|
|
userPersonalFactor.setConfigSortBrandList(configSortBrandList);
|
|
|
}
|
|
|
|
|
|
private List<SortBrand> queryRealTimeSortBrandList(Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|
...
|
...
|
|