Authored by zhaojun2

Merge branch 'zj_productanalysis' into 0710

... ... @@ -18,25 +18,25 @@ public class RecommendOnProductAnalysisController {
@Autowired
private RecommendOnProductAnalysisService analysisService;
@RequestMapping(method = RequestMethod.GET, value = "/recommend/sort")
@RequestMapping(method = RequestMethod.GET, value = "/sortList/recMisorts")
public SearchApiResult recommendSort(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return analysisService.recommendSort(paramMap);
}
@RequestMapping(method = RequestMethod.GET, value = "/recommend/shop")
@RequestMapping(method = RequestMethod.GET, value = "/sortList/recShops")
public SearchApiResult recommendShop(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return analysisService.recommendShop(paramMap);
}
@RequestMapping(method = RequestMethod.GET, value = "/recommend/newArrivalShop")
@RequestMapping(method = RequestMethod.GET, value = "/newArrival/recShops")
public SearchApiResult recommendNewArrivalShop(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return analysisService.recommendNewArrivalShop(paramMap);
}
@RequestMapping(method = RequestMethod.GET, value = "/recommend/newArrivals")
@RequestMapping(method = RequestMethod.GET, value = "/newArrival/preferenceShops")
public SearchApiResult recommendNewArrivals(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return analysisService.recommendNewArrivals(paramMap);
... ...
... ... @@ -62,7 +62,7 @@ public class RecommendOnProductAnalysisService {
List<Integer> sortIds = getRecommendSortWithPersonal(paramMap, viewNum, uid, udid);
JSONObject data = new JSONObject();
data.put("sortIds", sortIds);
data.put("misortIds", sortIds);
return new SearchApiResult().setData(data);
}catch (Exception e) {
LOGGER.error(e.getMessage(), e);
... ... @@ -96,9 +96,9 @@ public class RecommendOnProductAnalysisService {
List<Integer> hotShopIds = getHotShops(paramMap);
List<Integer> newOpenShopIds = getNewOpenShops(paramMap);
JSONObject data = new JSONObject();
data.put("seenShopIds", seenShopIds);
data.put("viewedShopIds", seenShopIds);
data.put("hotShopIds", hotShopIds);
data.put("newOpenShopIds", newOpenShopIds);
data.put("newShopIds", newOpenShopIds);
return new SearchApiResult().setData(data);
}
... ... @@ -107,7 +107,6 @@ public class RecommendOnProductAnalysisService {
paramMapClone.putAll(paramMap);
List<Integer> shopIds = new ArrayList<>();
try {
addShopCreateTime(paramMapClone);
addDefaultParamsToParamMap(paramMapClone);
JSONObject aggResult = aggregationsService.getShopAggregationResult(paramMapClone, 8);
if (aggResult != null && !CollectionUtils.isEmpty(aggResult.getJSONArray("shopAgg"))) {
... ... @@ -445,12 +444,6 @@ public class RecommendOnProductAnalysisService {
paramMap.put(SearchRequestParams.PARAM_SEARCH_SHELVETIME, begin + "," + end);
}
private void addShopCreateTime(Map<String, String> paramMap) {
long end = DateUtil.getLastTimeSecond(new Date());
long begin = DateUtil.getFirstTimeSecond(DateUtil.addDay(new Date(), -50));
paramMap.put(SearchRequestParams.PARAM_SEARCH_SHOP_CREATE_TIME, begin + "," + end);
}
//获取用户行为
private UserPersonalFactorRspNew getUserPersonalFactor(int uid, String udid) {
return userComponent.queryUserPersionalFactor(uid, udid, null);
... ...