|
@@ -74,16 +74,13 @@ public class QueryUserPersionalFactorBean { |
|
@@ -74,16 +74,13 @@ public class QueryUserPersionalFactorBean { |
74
|
//2、构造推荐的skn列表
|
74
|
//2、构造推荐的skn列表
|
75
|
List<Integer> recommendSknList = userFactor.getRecommendSknList();
|
75
|
List<Integer> recommendSknList = userFactor.getRecommendSknList();
|
76
|
List<Integer> realTimeSimilarSknList = userFactor.getRealTimeSimilarSknList();
|
76
|
List<Integer> realTimeSimilarSknList = userFactor.getRealTimeSimilarSknList();
|
77
|
-
|
|
|
78
|
//3、获取页面中存在的所有的key
|
77
|
//3、获取页面中存在的所有的key
|
79
|
Set<String> pageSortBrandKeys = new HashSet<>();
|
78
|
Set<String> pageSortBrandKeys = new HashSet<>();
|
80
|
for (SortBrand pageSortBrand : pageFactor.getSortBrandList()) {
|
79
|
for (SortBrand pageSortBrand : pageFactor.getSortBrandList()) {
|
81
|
pageSortBrandKeys.add(pageSortBrand.key());
|
80
|
pageSortBrandKeys.add(pageSortBrand.key());
|
82
|
}
|
81
|
}
|
83
|
-
|
|
|
84
|
//4、构造临时过滤对象
|
82
|
//4、构造临时过滤对象
|
85
|
Set<String> filterSortBrandKeys = new HashSet<>();
|
83
|
Set<String> filterSortBrandKeys = new HashSet<>();
|
86
|
-
|
|
|
87
|
//5、构造实时【品类+品牌】
|
84
|
//5、构造实时【品类+品牌】
|
88
|
int recSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.REC_SORT_BRAND, 12);
|
85
|
int recSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.REC_SORT_BRAND, 12);
|
89
|
List<SortBrand> realTimeSortBrandList = this.queryRealTimeSortBrandList(pageSortBrandKeys, filterSortBrandKeys, userFactor.getRealTimeSortBrandList(), recSortBrandCount);
|
86
|
List<SortBrand> realTimeSortBrandList = this.queryRealTimeSortBrandList(pageSortBrandKeys, filterSortBrandKeys, userFactor.getRealTimeSortBrandList(), recSortBrandCount);
|
|
@@ -105,11 +102,19 @@ public class QueryUserPersionalFactorBean { |
|
@@ -105,11 +102,19 @@ public class QueryUserPersionalFactorBean { |
105
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
102
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
106
|
filterSortBrandKeys.add(existSortBrand.key());
|
103
|
filterSortBrandKeys.add(existSortBrand.key());
|
107
|
}
|
104
|
}
|
108
|
- //8、构造基于配置的【品牌+品牌】,去除其他类型的品类和品牌
|
105
|
+ //8、构造个性化结果[如果个性化结果为空,则取配置的品类品牌数据]
|
|
|
106
|
+ UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
|
|
107
|
+ if (userPersonalFactor.isUserPersonalFactorEmpty()) {
|
|
|
108
|
+ this.fillConfigSortBrandList(userPersonalFactor, pageId, pageFactor, pageSortBrandKeys, filterSortBrandKeys);
|
|
|
109
|
+ }
|
|
|
110
|
+ //10、返回最终结果
|
|
|
111
|
+ return userPersonalFactor;
|
|
|
112
|
+ }
|
|
|
113
|
+
|
|
|
114
|
+ private void fillConfigSortBrandList(UserPersonalFactor userPersonalFactor, int pageId, PagePersonalFactor pageFactor, Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys) {
|
109
|
int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 0);
|
115
|
int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 0);
|
110
|
- List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor,pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
|
|
|
111
|
- //9、返回最终结果
|
|
|
112
|
- return new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList, configSortBrandList);
|
116
|
+ List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
|
|
|
117
|
+ userPersonalFactor.setConfigSortBrandList(configSortBrandList);
|
113
|
}
|
118
|
}
|
114
|
|
119
|
|
115
|
private List<SortBrand> queryRealTimeSortBrandList(Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|
120
|
private List<SortBrand> queryRealTimeSortBrandList(Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|