...
|
...
|
@@ -43,14 +43,15 @@ public class QueryUserPersionalFactorBean { |
|
|
try {
|
|
|
boolean openDetailLog = this.openDetailLog(userRecallRequest);
|
|
|
int uid = userRecallRequest.getUid();
|
|
|
String udid = userRecallRequest.getUdid();
|
|
|
//1、获取页面上的个性化因子
|
|
|
long begin = System.currentTimeMillis();
|
|
|
PagePersonalFactor pageFactor = pageComponent.queryPagePersionalFactor(userRecallRequest.getParamQueryFilter());
|
|
|
long cost = System.currentTimeMillis() - begin;
|
|
|
if (!openDetailLog) {
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[1]:queryPageFactor. uid is[{}], cost is[{}] ",uid, cost);
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[1]:queryPageFactor. uid is[{}],udid is[{}], cost is[{}] ",uid, udid,cost);
|
|
|
} else {
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[1]:queryPageFactor. uid is[{}], cost is[{}], pageFactor is[{}] ",uid, cost, JSON.toJSONString(pageFactor));
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[1]:queryPageFactor. uid is[{}],udid is[{}], cost is[{}], pageFactor is[{}] ",uid, udid,cost, JSON.toJSONString(pageFactor));
|
|
|
}
|
|
|
//2、获取用户的个性化因子
|
|
|
begin = System.currentTimeMillis();
|
...
|
...
|
@@ -59,12 +60,12 @@ public class QueryUserPersionalFactorBean { |
|
|
int userSortBrandSize = userFactor.getSortBrandList().size();
|
|
|
int userRealSortBrandSize = userFactor.getRealTimeSortBrandList().size();
|
|
|
if (!openDetailLog) {
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[2]:queryUserFactor. uid is[{}], cost is[{}], sortBrand size is[{}],userRealSortBrandSize is[{}] ", uid , cost, userSortBrandSize,userRealSortBrandSize);
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[2]:queryUserFactor. uid is[{}],udid is[{}], cost is[{}], sortBrand size is[{}],userRealSortBrandSize is[{}] ", uid ,udid, cost, userSortBrandSize,userRealSortBrandSize);
|
|
|
} else {
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[2]:queryUserFactor. uid is[{}], cost is[{}],sortBrand size is[{}] , userRealSortBrandSize is[{}] , userFactor is[{}] ",uid, cost,userSortBrandSize,userRealSortBrandSize,JSON.toJSONString(userFactor));
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[2]:queryUserFactor. uid is[{}],udid is[{}], cost is[{}],sortBrand size is[{}] , userRealSortBrandSize is[{}] , userFactor is[{}] ",uid,udid, cost,userSortBrandSize,userRealSortBrandSize,JSON.toJSONString(userFactor));
|
|
|
}
|
|
|
//3、join获取最终的结果
|
|
|
UserPersonalFactor userPersonalFactor = this.buildUserPersonalFactor(pageFactor,userFactor,uid,openDetailLog);
|
|
|
UserPersonalFactor userPersonalFactor = this.buildUserPersonalFactor(pageFactor,userFactor,uid,udid,openDetailLog);
|
|
|
return userPersonalFactor;
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|
...
|
...
|
@@ -73,10 +74,16 @@ public class QueryUserPersionalFactorBean { |
|
|
}
|
|
|
|
|
|
private boolean openDetailLog(UserRecallRequest userRecallRequest) {
|
|
|
return userRecallRequest.getUid() == 13420925;
|
|
|
if( userRecallRequest.getUid() == 13420925){
|
|
|
return true;
|
|
|
}
|
|
|
if("00bcfa1e5d7745ad8c4188929134da18f8485dbd".equalsIgnoreCase(userRecallRequest.getUdid())){
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
private UserPersonalFactor buildUserPersonalFactor(PagePersonalFactor pageFactor,UserPersonalFactorRspNew userFactor,int uid, boolean openDetailLog){
|
|
|
private UserPersonalFactor buildUserPersonalFactor(PagePersonalFactor pageFactor,UserPersonalFactorRspNew userFactor,int uid,String udid, boolean openDetailLog){
|
|
|
//1、构造页面中的品牌品类map
|
|
|
Map<Integer, List<Integer>> pageBrand2MiSortIdsMap = this.getPageBrand2MiSortIdsMap(pageFactor);
|
|
|
//2、构造实时【品类+品牌】
|
...
|
...
|
@@ -92,9 +99,9 @@ public class QueryUserPersionalFactorBean { |
|
|
sortBrands.addAll(forecastSortBrandList);
|
|
|
UserPersonalFactor userPersonalFactor = new UserPersonalFactor(sortBrands,sortPriceAreasList, userFactor.getVector());
|
|
|
if(!openDetailLog){
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[3]:after join. uid is[{}], forecastSortBrand size is[{}],realTimeSortBrand size is[{}],sortPriceAreas size is [{}] ", uid, forecastSortBrandList.size(),realTimeSortBrandList.size(),sortPriceAreasList.size());
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[3]:after join. uid is[{}],udid is[{}], forecastSortBrand size is[{}], realTimeSortBrand size is[{}], sortPriceAreas size is [{}] ", uid,udid, forecastSortBrandList.size(),realTimeSortBrandList.size(),sortPriceAreasList.size());
|
|
|
}else{
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[3]:after join. uid is[{}], forecastSortBrand size is[{}],realTimeSortBrand size is[{}],sortPriceAreas size is [{}], results is [{}] ", uid, forecastSortBrandList.size(),realTimeSortBrandList.size(),sortPriceAreasList.size(),JSON.toJSONString(userPersonalFactor));
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactor[3]:after join. uid is[{}],udid is[{}], forecastSortBrand size is[{}], realTimeSortBrand size is[{}], sortPriceAreas size is [{}], results is [{}] ", uid,udid, forecastSortBrandList.size(),realTimeSortBrandList.size(),sortPriceAreasList.size(),JSON.toJSONString(userPersonalFactor));
|
|
|
}
|
|
|
return userPersonalFactor;
|
|
|
}
|
...
|
...
|
|