Authored by hugufei

新增一种召回

... ... @@ -14,6 +14,7 @@ import com.yoho.search.service.recall.beans.strategy.StrategyEnum;
import com.yoho.search.service.recall.beans.persional.PageSknCodeBitSetComponent;
import com.yoho.search.service.recall.beans.strategy.impls.IRecallSknStrategy;
import com.yoho.search.service.recall.beans.strategy.impls.RealTimeSimilarSknStrategy;
import com.yoho.search.service.recall.beans.strategy.impls.RealTimeYoutuboSknStrategy;
import com.yoho.search.service.recall.beans.strategy.impls.RecommendSknStrategy;
import com.yoho.search.service.recall.config.RecallConfigService;
import com.yoho.search.service.recall.models.common.ParamQueryFilter;
... ... @@ -75,21 +76,27 @@ public class SknRecallCacheBean {
if (rtSimSknCount > 0 && userPersonalFactor.getRealTimeSimilarSknList() != null) {
filterSknList.addAll(userPersonalFactor.getRealTimeSimilarSknList());
}
//3、获取相似skn的配置
int youtubeSknCount = recallConfigService.queryStrategyConfigSize(userRecallRequest, StrategyEnum.RT_YOUTUBE_SKN);
if (youtubeSknCount > 0 && userPersonalFactor.getRealTimeYoutubeSknList() != null) {
filterSknList.addAll(userPersonalFactor.getRealTimeYoutubeSknList());
}
if(filterSknList.isEmpty()){
return new ArrayList<>();
}
//3、执行查询
//4、执行查询
List<Integer> filterSknResults;
if (recallWithCache) {
filterSknResults = this.filterRecommendWithCache(userRecallRequest, filterSknList);
} else {
filterSknResults = this.filterRecommedSknListByEs(userRecallRequest, filterSknList);
}
//3、构造结果
//5、构造结果
List<RecallRequestResponse> results = new ArrayList<>();
ParamQueryFilter paramQueryFilter = userRecallRequest.getParamQueryFilter();
results.addAll(this.buildResults(paramQueryFilter, userPersonalFactor.getRecommendSknList(), RecommendSknStrategy.class, filterSknResults, recSknCount));
results.addAll(this.buildResults(paramQueryFilter, userPersonalFactor.getRealTimeSimilarSknList(), RealTimeSimilarSknStrategy.class, filterSknResults, rtSimSknCount));
results.addAll(this.buildResults(paramQueryFilter, userPersonalFactor.getRealTimeYoutubeSknList(), RealTimeYoutuboSknStrategy.class, filterSknResults, youtubeSknCount));
return results;
} catch (Exception e) {
RECALL_NEW_LOGGER.error(e.getMessage(), e);
... ...
... ... @@ -12,7 +12,7 @@ public class StrategyHelper {
}
public static List<StrategyEnum> getIntervalStrategyEnums() {
return Arrays.asList(StrategyEnum.REC_SKN, StrategyEnum.RT_SIM_SKN, StrategyEnum.DIRECT_TRAIN, StrategyEnum.ADD_FLOW, StrategyEnum.NEW_SHOP);
return Arrays.asList(StrategyEnum.REC_SKN, StrategyEnum.RT_SIM_SKN,StrategyEnum.RT_YOUTUBE_SKN, StrategyEnum.DIRECT_TRAIN, StrategyEnum.ADD_FLOW, StrategyEnum.NEW_SHOP);
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.service.recall.beans.persional;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.SortPriceAreas;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.service.recall.beans.strategy.SortBrandType;
import com.yoho.search.service.recall.beans.vector.SortBrandVectorComponent;
import com.yoho.search.service.recall.config.RecallConfigService;
... ... @@ -14,7 +14,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Component
public class QueryUserPersionalFactorBean {
... ... @@ -53,7 +56,7 @@ public class QueryUserPersionalFactorBean {
RECALL_NEW_LOGGER.info("QueryUserPersionalFactorBean[1]:queryPagePersionalFactor. uid is[{}],udid is[{}], cost is[{}]] ms", uid, udid, cost);
//2、获取用户的个性化因子
begin = System.currentTimeMillis();
UserPersonalFactorRspNew userFactor = userComponent.queryUserPersionalFactor(userRecallRequest.getUid(), userRecallRequest.getUdid(), pageFactor.getMisortIds());
UserPersonalFactorRsp userFactor = userComponent.queryUserPersionalFactor(userRecallRequest.getUid(), userRecallRequest.getUdid(), pageFactor.getMisortIds());
cost = System.currentTimeMillis() - begin;
RECALL_NEW_LOGGER.info("QueryUserPersionalFactorBean[2]:queryUserPersionalFactor. uid is[{}],udid is[{}], cost is[{}]", uid, udid, cost);
//3、构造结果
... ... @@ -68,15 +71,15 @@ public class QueryUserPersionalFactorBean {
}
}
private UserPersonalFactor buildUserPersonalFactor(int pageId, PagePersonalFactor pageFactor, UserPersonalFactorRspNew userFactor) {
private UserPersonalFactor buildUserPersonalFactor(int pageId, PagePersonalFactor pageFactor, UserPersonalFactorRsp userFactor) {
//1、构造品类价格带
List<SortPriceAreas> sortPriceAreasList = this.getSortPriceAreasListWithSort(userFactor, pageFactor);
//2、构造推荐的skn列表
List<Integer> recommendSknList = userFactor.getRecommendSknList();
List<Integer> realTimeSimilarSknList = userFactor.getRealTimeSimilarSknList();
List<Integer> realTimeYoutubeSknList = userFactor.getRealTimeYoutubeSknList();
//TODO remove
//realTimeSimilarSknList.addAll(Arrays.asList(50003513,50013179,50018239,50023799));
//3、获取页面中存在的所有的key
Set<String> pageSortBrandKeys = new HashSet<>();
for (SortBrand pageSortBrand : pageFactor.getSortBrandList()) {
... ... @@ -106,11 +109,11 @@ public class QueryUserPersionalFactorBean {
filterSortBrandKeys.add(existSortBrand.key());
}
//8、构造个性化结果[如果个性化结果为空,则取配置的品类品牌数据]
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(recommendSknList, realTimeSimilarSknList,realTimeYoutubeSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
if (userPersonalFactor.isUserPersonalFactorEmpty()) {
this.fillConfigSortBrandList(userPersonalFactor, pageId, pageFactor, pageSortBrandKeys, filterSortBrandKeys);
}
//10、返回最终结果
//9、返回最终结果
return userPersonalFactor;
}
... ... @@ -147,7 +150,7 @@ public class QueryUserPersionalFactorBean {
* @param userFactorNew
* @return
*/
private List<SortPriceAreas> getSortPriceAreasListWithSort(UserPersonalFactorRspNew userFactorNew, PagePersonalFactor pageFactor) {
private List<SortPriceAreas> getSortPriceAreasListWithSort(UserPersonalFactorRsp userFactorNew, PagePersonalFactor pageFactor) {
List<SortPriceAreas> sortPriceAreas = userFactorNew.getSortPriceAreasList();
if (sortPriceAreas == null || sortPriceAreas.isEmpty()) {
return new ArrayList<>();
... ...
package com.yoho.search.service.recall.beans.persional;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.core.personalized.service.BidataServiceCaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -25,16 +25,24 @@ public class UserPersionalFactorComponent {
* @param udid
* @return
*/
public UserPersonalFactorRspNew queryUserPersionalFactor(int uid, String udid, List<Integer> misortIds) {
public UserPersonalFactorRsp queryUserPersionalFactor(int uid, String udid, List<Integer> misortIds) {
try {
UserPersonalFactorRspNew rsp = bidataServiceCaller.queryUserPersionalFactor(uid, udid, misortIds);
UserPersonalFactorRsp rsp = bidataServiceCaller.queryUserPersionalFactor(uid, udid, misortIds);
if (rsp == null) {
rsp = new UserPersonalFactorRspNew();
rsp = new UserPersonalFactorRsp();
}
//skn
//recommendSknList
if (rsp.getRecommendSknList() == null) {
rsp.setRecommendSknList(new ArrayList<>());
}
//realTimeSimilarSknList
if (rsp.getRealTimeSimilarSknList() == null) {
rsp.setRealTimeSimilarSknList(new ArrayList<>());
}
//realTimeYoutubeSknList
if (rsp.getRealTimeYoutubeSknList() == null) {
rsp.setRealTimeYoutubeSknList(new ArrayList<>());
}
//价格带
if (rsp.getSortPriceAreasList() == null) {
rsp.setSortPriceAreasList(new ArrayList<>());
... ... @@ -60,7 +68,7 @@ public class UserPersionalFactorComponent {
return rsp;
} catch (Exception e) {
RECALL_NEW_LOGGER.error(e.getMessage(), e);
return new UserPersonalFactorRspNew();
return new UserPersonalFactorRsp();
}
}
... ...
... ... @@ -6,8 +6,9 @@ public enum StrategyEnum {
DIRECT_TRAIN(109),//直通车
REC_SKN(108),//实时推荐的skn
RT_SIM_SKN(107),//实时推荐的skn的相似skn
ADD_FLOW(106),//流量补偿
NEW_SHOP(105),//新开店铺
RT_YOUTUBE_SKN(106),//实时推荐的skn的相似skn
ADD_FLOW(105),//流量补偿
NEW_SHOP(104),//新开店铺
REC_S_B_NEW(89),//实时的品牌+品类的新品
REC_S_B_PROMOTION(88),//实时的品牌+品类的新开促销
... ...
package com.yoho.search.service.recall.beans.strategy.impls;
import com.yoho.search.service.recall.beans.strategy.StrategyEnum;
public class RealTimeYoutuboSknStrategy extends IRecallSknStrategy {
public RealTimeYoutuboSknStrategy(Integer recommendSkn) {
super(recommendSkn);
}
@Override
public StrategyEnum strategtEnum() {
return StrategyEnum.RT_YOUTUBE_SKN;
}
}
... ...
... ... @@ -9,6 +9,8 @@ public class RecallConfigConstants {
public static final String DIRECT_TRAIN = "DIRECT_TRAIN";
public static final String REC_SKN = "REC_SKN";
public static final String RT_SIM_SKN = "RT_SIM_SKN";
public static final String RT_YOUTUBE_SKN = "RT_YOUTUBE_SKN";
public static final String ADD_FLOW = "ADD_FLOW";
public static final String NEW_SHOP = "NEW_SHOP";
... ...
... ... @@ -73,6 +73,9 @@ public class RecallConfigService {
if (strategyEnum.equals(StrategyEnum.RT_SIM_SKN)) {
return RecallConfigConstants.RT_SIM_SKN;
}
if (strategyEnum.equals(StrategyEnum.RT_YOUTUBE_SKN)) {
return RecallConfigConstants.RT_YOUTUBE_SKN;
}
if (strategyEnum.equals(StrategyEnum.DIRECT_TRAIN)) {
return RecallConfigConstants.DIRECT_TRAIN;
}
... ...
... ... @@ -11,6 +11,8 @@ public class UserPersonalFactor {
private List<Integer> recommendSknList;
private List<Integer> realTimeSimilarSknList;
private List<Integer> realTimeYoutubeSknList;
private List<SortPriceAreas> sortPriceAreasList;
private List<SortBrand> realTimeSortBrandList;
... ... @@ -21,6 +23,8 @@ public class UserPersonalFactor {
public UserPersonalFactor() {
this.recommendSknList = new ArrayList<>();
this.realTimeSimilarSknList = new ArrayList<>();
this.realTimeYoutubeSknList = new ArrayList<>();
this.sortPriceAreasList = new ArrayList<>();
this.realTimeSortBrandList = new ArrayList<>();
... ... @@ -29,9 +33,10 @@ public class UserPersonalFactor {
this.configSortBrandList = new ArrayList<>();
}
public UserPersonalFactor(List<Integer> recommendSknList, List<Integer> realTimeSimilarSknList, List<SortPriceAreas> sortPriceAreasList, List<SortBrand> realTimeSortBrandList, List<SortBrand> vectorRnnSortBrandList, List<SortBrand> vectorW2vSortBrandList) {
public UserPersonalFactor(List<Integer> recommendSknList, List<Integer> realTimeSimilarSknList,List<Integer> realTimeYoutubeSknList, List<SortPriceAreas> sortPriceAreasList, List<SortBrand> realTimeSortBrandList, List<SortBrand> vectorRnnSortBrandList, List<SortBrand> vectorW2vSortBrandList) {
this.recommendSknList = recommendSknList;
this.realTimeSimilarSknList = realTimeSimilarSknList;
this.realTimeYoutubeSknList = realTimeYoutubeSknList;
this.sortPriceAreasList = sortPriceAreasList;
this.realTimeSortBrandList = realTimeSortBrandList;
this.vectorRnnSortBrandList = vectorRnnSortBrandList;
... ... @@ -62,6 +67,9 @@ public class UserPersonalFactor {
return vectorW2vSortBrandList;
}
public List<Integer> getRealTimeYoutubeSknList() {
return realTimeYoutubeSknList;
}
/**
* 判断用户个性化数据是否都为空
... ... @@ -74,6 +82,9 @@ public class UserPersonalFactor {
if(!CollectionUtils.isEmpty(this.realTimeSimilarSknList)){
return false;
}
if(!CollectionUtils.isEmpty(this.realTimeYoutubeSknList)){
return false;
}
if(!CollectionUtils.isEmpty(this.realTimeSortBrandList)){
return false;
}
... ...
... ... @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.common.SearchRequestParams;
import org.apache.commons.collections.MapUtils;
... ... @@ -51,7 +51,7 @@ public class PageSelectionsBrandsService {
String udid = MapUtils.getString(paramMap, "udid", "");
int recommendBrandCount = Integer.parseInt(paramMap.getOrDefault(SearchRequestParams.PARAM_SEARCH_VIEWNUM, "8"));
JSONArray recBrands = new JSONArray(recommendBrandCount);
UserPersonalFactorRspNew userFactor = userPersionalFactorComponent.queryUserPersionalFactor(uid, udid, null);
UserPersonalFactorRsp userFactor = userPersionalFactorComponent.queryUserPersionalFactor(uid, udid, null);
List<Integer> brandIds = new ArrayList<>();
if (userFactor != null && userFactor.getRealTimeSortBrandList()!=null) {
List<SortBrand> sortBrandList = new ArrayList<>(userFactor.getRealTimeSortBrandList());
... ...
... ... @@ -3,7 +3,7 @@ package com.yoho.search.service.scene.recommend;
import com.yoho.search.base.helper.RnnVectorCalculator;
import com.yoho.search.base.helper.Word2VectorCalculator;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.service.recall.beans.vector.BrandVectorCacheBean;
import com.yoho.search.service.scene.shopbrand.ShopBrandRelation;
import com.yoho.search.service.scene.shopbrand.ShopBrandRelationCacheComponent;
... ... @@ -24,24 +24,24 @@ public class PersionalShopService {
private static final Logger logger = LoggerFactory.getLogger(PersionalShopService.class);
public List<Integer> buildPersionalShopIdsByBrandIds(Map<String, String> paramMap, List<Integer> brandIds, UserPersonalFactorRspNew userPersonalFactorRspNew) {
public List<Integer> buildPersionalShopIdsByBrandIds(Map<String, String> paramMap, List<Integer> brandIds, UserPersonalFactorRsp userPersonalFactorRsp) {
List<ShopBrandRelation> relations = shopBrandRelationCacheComponent.queryActivityShopBrandList(paramMap, brandIds);
List<Integer> shopIds = buildPersionalShopIds(relations, userPersonalFactorRspNew);
List<Integer> shopIds = buildPersionalShopIds(relations, userPersonalFactorRsp);
return shopIds == null ? new ArrayList<>() : shopIds;
}
public List<Integer> buildPersionalShopIds(List<ShopBrandRelation> shopBrandList, UserPersonalFactorRspNew userPersonalFactorRspNew) {
public List<Integer> buildPersionalShopIds(List<ShopBrandRelation> shopBrandList, UserPersonalFactorRsp userPersonalFactorRsp) {
//1、获取品牌-店铺的对应关系
Map<Integer, Integer> brandId2ShopIdMap = new HashMap<>();
for (ShopBrandRelation shopBrandRelation : shopBrandList) {
brandId2ShopIdMap.put(shopBrandRelation.getBrandId(), shopBrandRelation.getShopId());
}
//2、获取实时推荐的品牌
List<Integer> recBrandIds = this.getRecBrandIds(userPersonalFactorRspNew);
List<Integer> recBrandIds = this.getRecBrandIds(userPersonalFactorRsp);
//3、计算店铺得分并排序
List<Double> brandVector = userPersonalFactorRspNew.getBrandVector();
List<Double> brandVectorW2v = userPersonalFactorRspNew.getBrandVectorW2v();
List<Double> brandVector = userPersonalFactorRsp.getBrandVector();
List<Double> brandVectorW2v = userPersonalFactorRsp.getBrandVectorW2v();
if (brandVectorW2v != null && !brandVectorW2v.isEmpty()) {
this.calScore(shopBrandList, brandVectorW2v, false);
} else {
... ... @@ -72,10 +72,10 @@ public class PersionalShopService {
return shopIds;
}
private List<Integer> getRecBrandIds(UserPersonalFactorRspNew userPersonalFactorRspNew) {
private List<Integer> getRecBrandIds(UserPersonalFactorRsp userPersonalFactorRsp) {
List<Integer> realBrandId = new ArrayList<>();
try {
List<SortBrand> realTimeSortBrand = userPersonalFactorRspNew.getRealTimeSortBrandList();
List<SortBrand> realTimeSortBrand = userPersonalFactorRsp.getRealTimeSortBrandList();
for (SortBrand sortBrand : realTimeSortBrand) {
if (!realBrandId.contains(sortBrand.getBrandId())) {
realBrandId.add(sortBrand.getBrandId());
... ...
... ... @@ -11,7 +11,7 @@ import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.core.es.agg.IAggregation;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.aggregations.AggregationsService;
import com.yoho.search.service.aggregations.impls.ProductAnalysisBrandAggregation;
... ... @@ -159,7 +159,7 @@ public class RecommendOnProductAnalysisService {
//获取用户有行为的品类 排序sort, RealTimeSort加分放前面
private List<Integer> reorderSortOnUserPersonalSort(final List<Integer> sortIds, final Map<Integer, Integer> miSort2SortMap, int uid, String udid) {
UserPersonalFactorRspNew userFactor = getUserPersonalFactor(uid, udid);
UserPersonalFactorRsp userFactor = getUserPersonalFactor(uid, udid);
if (userFactor == null || CollectionUtils.isEmpty(userFactor.getRealTimeSortBrandList())) {
return sortIds;
}
... ... @@ -233,7 +233,7 @@ public class RecommendOnProductAnalysisService {
return new ArrayList<>();
}
Map<String, String> productIndexParamsWithDefault = genProductIndexParamsWithDefault(paramMap);
UserPersonalFactorRspNew userFactor = getUserPersonalFactor(uid, udid);
UserPersonalFactorRsp userFactor = getUserPersonalFactor(uid, udid);
List<Integer> shopIds = persionalShopService.buildPersionalShopIdsByBrandIds(productIndexParamsWithDefault, aggBestBrandIds, userFactor);
List<Integer> shopIdList = checkShopIds(shopIds);
return shopIdList == null ? new ArrayList<>() : shopIdList;
... ... @@ -349,7 +349,7 @@ public class RecommendOnProductAnalysisService {
try {
int uid = MapUtils.getIntValue(paramMap, "uid", 0);
String udid = MapUtils.getString(paramMap, "udid", "");
UserPersonalFactorRspNew userFactor = getUserPersonalFactor(uid, udid);
UserPersonalFactorRsp userFactor = getUserPersonalFactor(uid, udid);
if (userFactor == null || CollectionUtils.isEmpty(userFactor.getRealTimeSortBrandList())) {
return new ArrayList<>();
}
... ... @@ -459,11 +459,11 @@ public class RecommendOnProductAnalysisService {
}
//获取用户行为
private UserPersonalFactorRspNew getUserPersonalFactor(int uid, String udid) {
private UserPersonalFactorRsp getUserPersonalFactor(int uid, String udid) {
if (uid > 0 || StringUtils.isNotBlank(udid)) {
return userComponent.queryUserPersionalFactor(uid, udid, null);
}
return new UserPersonalFactorRspNew();
return new UserPersonalFactorRsp();
}
public static void main(String[] args) {
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.service.scene.recommend.activity;
import com.yoho.search.base.utils.SearchCollectionUtils;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.index.ShopsIndexBaseService;
import com.yoho.search.service.recall.beans.persional.UserPersionalFactorComponent;
... ... @@ -41,9 +41,9 @@ public class ActivityRecommendShopService {
//2、查询用户的品牌向量
int uid = MapUtils.getIntValue(paramMap, "uid", 0);
String udid = MapUtils.getString(paramMap, "udid", "");
UserPersonalFactorRspNew userPersonalFactorRspNew = userComponent.queryUserPersionalFactor(uid, udid, null);
UserPersonalFactorRsp userPersonalFactorRsp = userComponent.queryUserPersionalFactor(uid, udid, null);
//3、按相关性聚合品牌
List<Integer> shopIds = persionalShopService.buildPersionalShopIds(shopBrandList, userPersonalFactorRspNew);
List<Integer> shopIds = persionalShopService.buildPersionalShopIds(shopBrandList, userPersonalFactorRsp);
//4、查询店铺
List<Map<String, Object>> shopsList = shopsIndexBaseService.getShopListByIdsWithSortAndStatus(shopIds);
//5、数量截取
... ...
... ... @@ -5,7 +5,7 @@ import com.yoho.search.base.utils.SearchCollectionUtils;
import com.yoho.search.cache.beans.AbstractCacheBean;
import com.yoho.search.core.personalized.models.PersonalizedSearch;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.UserPersonalFactorRspNew;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.service.recall.beans.persional.ProductFeatureFactorComponent;
import com.yoho.search.service.recall.beans.persional.UserPersionalFactorComponent;
import com.yoho.search.service.recall.beans.strategy.IStrategy;
... ... @@ -75,7 +75,7 @@ public class AggBrandProductCacheBean extends AbstractCacheBean<BrandProductRequ
List<Integer> aggBrandIds = aggBrands.stream().map(AggBrand::getBrandId).filter(Objects::nonNull).collect(Collectors.toList());
List<Integer> userPersonalbrandIds = new ArrayList<>();
if (brandProductRequest.hasUidOrUdid()) {
UserPersonalFactorRspNew userFactor = userComponent.queryUserPersionalFactor(brandProductRequest.getUid(), brandProductRequest.getUdid(), null);
UserPersonalFactorRsp userFactor = userComponent.queryUserPersionalFactor(brandProductRequest.getUid(), brandProductRequest.getUdid(), null);
userPersonalbrandIds = buildUserPersonalBrandIds(aggBrandIds, userFactor, brandProductRequest.getBrandCount());
}
if (userPersonalbrandIds.size() < brandProductRequest.getBrandCount()) {
... ... @@ -143,7 +143,7 @@ public class AggBrandProductCacheBean extends AbstractCacheBean<BrandProductRequ
}
private List<Integer> buildUserPersonalBrandIds(List<Integer> aggBrandIds, UserPersonalFactorRspNew userFactor, int count) {
private List<Integer> buildUserPersonalBrandIds(List<Integer> aggBrandIds, UserPersonalFactorRsp userFactor, int count) {
List<Integer> result = new ArrayList<>();
double userBrandVectorNorm = Word2VectorCalculator.getVectorListNorm(userFactor.getBrandVectorW2v());
List<BrandVectorScore> brandVectorScores = new ArrayList<>();
... ...