|
@@ -107,21 +107,28 @@ public class QueryUserPersionalFactorBean { |
|
@@ -107,21 +107,28 @@ public class QueryUserPersionalFactorBean { |
107
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
107
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
108
|
filterSortBrandKeys.add(existSortBrand.key());
|
108
|
filterSortBrandKeys.add(existSortBrand.key());
|
109
|
}
|
109
|
}
|
110
|
- //8、构造个性化结果[如果个性化结果为空,则取配置的品类品牌数据]
|
110
|
+ //8、构造个性化结果
|
111
|
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, realTimeYoutubeSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
111
|
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, realTimeYoutubeSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
|
|
112
|
+
|
|
|
113
|
+ //9、如果个性化结果为空,再取配置的品类品牌数据
|
112
|
if (userPersonalFactor.isUserPersonalFactorEmpty()) {
|
114
|
if (userPersonalFactor.isUserPersonalFactorEmpty()) {
|
113
|
- this.fillConfigSortBrandList(userPersonalFactor, pageId, pageFactor, pageSortBrandKeys, filterSortBrandKeys);
|
115
|
+ int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 12);
|
|
|
116
|
+ List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
|
|
|
117
|
+ userPersonalFactor.setConfigSortBrandList(configSortBrandList);
|
114
|
}
|
118
|
}
|
115
|
- //9、返回最终结果
|
|
|
116
|
- return userPersonalFactor;
|
|
|
117
|
- }
|
|
|
118
|
|
119
|
|
119
|
- private void fillConfigSortBrandList(UserPersonalFactor userPersonalFactor, int pageId, PagePersonalFactor pageFactor, Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys) {
|
|
|
120
|
- int configSortBrandCount = recallConfigService.querySortBrandConfigCount(pageId, SortBrandType.CONFIG_SORT_BRAND, 0);
|
|
|
121
|
- List<SortBrand> configSortBrandList = recallConfigService.queryConfigSortBrandList(pageFactor, pageSortBrandKeys, filterSortBrandKeys, configSortBrandCount);
|
|
|
122
|
- userPersonalFactor.setConfigSortBrandList(configSortBrandList);
|
120
|
+ //10、返回最终结果
|
|
|
121
|
+ return userPersonalFactor;
|
123
|
}
|
122
|
}
|
124
|
|
123
|
|
|
|
124
|
+ /**
|
|
|
125
|
+ * 生成用户实时的品类*品牌数据【join页面已有的】
|
|
|
126
|
+ *
|
|
|
127
|
+ * @param pageSortBrandKeys
|
|
|
128
|
+ * @param userSortBrands
|
|
|
129
|
+ * @param maxCount
|
|
|
130
|
+ * @return
|
|
|
131
|
+ */
|
125
|
private List<SortBrand> joinRealTimeSortBrandList(Set<String> pageSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|
132
|
private List<SortBrand> joinRealTimeSortBrandList(Set<String> pageSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|
126
|
List<SortBrand> results = new ArrayList<>();
|
133
|
List<SortBrand> results = new ArrayList<>();
|
127
|
if (pageSortBrandKeys == null || pageSortBrandKeys.isEmpty() || userSortBrands == null || userSortBrands.isEmpty() || maxCount <= 0) {
|
134
|
if (pageSortBrandKeys == null || pageSortBrandKeys.isEmpty() || userSortBrands == null || userSortBrands.isEmpty() || maxCount <= 0) {
|
|
@@ -139,6 +146,7 @@ public class QueryUserPersionalFactorBean { |
|
@@ -139,6 +146,7 @@ public class QueryUserPersionalFactorBean { |
139
|
return results;
|
146
|
return results;
|
140
|
}
|
147
|
}
|
141
|
|
148
|
|
|
|
149
|
+
|
142
|
/**
|
150
|
/**
|
143
|
* 【品类+价格带】
|
151
|
* 【品类+价格带】
|
144
|
*
|
152
|
*
|