Authored by hugufei

fix QueryUserPersionalFactorBean

@@ -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 *
@@ -34,7 +34,7 @@ public class RecallConfigService { @@ -34,7 +34,7 @@ public class RecallConfigService {
34 } 34 }
35 35
36 /** 36 /**
37 - * 获取某些策略的召回数量 37 + * 获取策略的召回数量
38 * 38 *
39 * @param userRecallRequest 39 * @param userRecallRequest
40 * @param strategyEnum 40 * @param strategyEnum
@@ -51,7 +51,7 @@ public class RecallConfigService { @@ -51,7 +51,7 @@ public class RecallConfigService {
51 } 51 }
52 52
53 /** 53 /**
54 - * 获取某些策略的间隔 54 + * 获取策略的间隔
55 * 55 *
56 * @param userRecallRequest 56 * @param userRecallRequest
57 * @param strategyEnum 57 * @param strategyEnum
@@ -68,7 +68,7 @@ public class RecallConfigService { @@ -68,7 +68,7 @@ public class RecallConfigService {
68 } 68 }
69 69
70 /** 70 /**
71 - * 获取推荐的【品类*品牌】的数量 71 + * 获取【品类*品牌】的数量
72 * 72 *
73 * @param pageId 73 * @param pageId
74 * @return 74 * @return