Authored by hugufei

Merge branch 'master' into wn_promotion

... ... @@ -74,7 +74,24 @@ public class PagePersionalFactorComponent extends AbstractPageComponent<PagePers
//4、构造结果
Map<String, Aggregation> aggregationMap = searchResult.getAggMaps();
List<PageBrandSorts> sortBrands = this.getBrandSortsFromAggregationMap(aggregationMap);
return new PagePersonalFactor(sortBrands);
List<Integer> misortIds = this.getMisortIds(sortBrands);
return new PagePersonalFactor(sortBrands,misortIds);
}
private List<Integer> getMisortIds(List<PageBrandSorts> sortBrands){
if(sortBrands==null||sortBrands.isEmpty()){
return new ArrayList<>();
}
List<Integer> results = new ArrayList<>();
for (PageBrandSorts pageBrandSort : sortBrands) {
List<Integer> misortIds = pageBrandSort.getMisorts();
for(Integer misortid: misortIds){
if(!results.contains(misortid)){
results.add(misortid);
}
}
}
return results;
}
/**
... ...
... ... @@ -55,7 +55,7 @@ public class QueryUserPersionalFactorBean {
//2、获取用户的个性化因子
begin = System.currentTimeMillis();
UserPersonalFactorRspNew userFactor = userComponent.queryUserPersionalFactor(userRecallRequest.getUid(), userRecallRequest.getUdid());
UserPersonalFactorRspNew userFactor = userComponent.queryUserPersionalFactor(userRecallRequest.getUid(), userRecallRequest.getUdid(),pageFactor.getMisortIds());
cost = System.currentTimeMillis() - begin;
int forecastSortBrandSize = userFactor.getSortBrandList().size();
int realTimeSortBrandSize = userFactor.getRealTimeSortBrandList().size();
... ...
... ... @@ -35,9 +35,9 @@ public class UserPersionalFactorComponent {
* @param udid
* @return
*/
public UserPersonalFactorRspNew queryUserPersionalFactor(int uid, String udid) {
public UserPersonalFactorRspNew queryUserPersionalFactor(int uid, String udid,List<Integer> misortIds) {
try {
UserPersonalFactorReq userPersionalFactorReq = new UserPersonalFactorReq(uid, udid);
UserPersonalFactorReq userPersionalFactorReq = new UserPersonalFactorReq(uid, udid,misortIds);
JSONObject result = serviceCaller.call(SERVICE_NAME, userPersionalFactorReq, JSONObject.class, timeOut);
JSONObject userPersonalFactorRspJSon = result.getJSONObject("data");
UserPersonalFactorRspNew rsp = JSON.toJavaObject(userPersonalFactorRspJSon, UserPersonalFactorRspNew.class);
... ...
... ... @@ -10,13 +10,15 @@ public class PagePersonalFactor implements Serializable{
private static final long serialVersionUID = 89030356435559223L;
private List<Integer> misortIds;
private List<PageBrandSorts> brandSortsList;
public PagePersonalFactor() {
}
public PagePersonalFactor(List<PageBrandSorts> brandSortsList){
public PagePersonalFactor(List<PageBrandSorts> brandSortsList,List<Integer> misortIds){
this.brandSortsList = brandSortsList;
this.misortIds = misortIds;
}
public List<PageBrandSorts> getBrandSortsList() {
... ... @@ -30,4 +32,12 @@ public class PagePersonalFactor implements Serializable{
public int pageBrandSortsSize(){
return brandSortsList==null ? 0:brandSortsList.size();
}
public List<Integer> getMisortIds() {
return misortIds;
}
public void setMisortIds(List<Integer> misortIds) {
this.misortIds = misortIds;
}
}
... ...