Authored by zhaojun2

Merge branch 'zj_productanalysis' into 0710

@@ -18,25 +18,25 @@ public class RecommendOnProductAnalysisController { @@ -18,25 +18,25 @@ public class RecommendOnProductAnalysisController {
18 @Autowired 18 @Autowired
19 private RecommendOnProductAnalysisService analysisService; 19 private RecommendOnProductAnalysisService analysisService;
20 20
21 - @RequestMapping(method = RequestMethod.GET, value = "/recommend/sort") 21 + @RequestMapping(method = RequestMethod.GET, value = "/sortList/recMisorts")
22 public SearchApiResult recommendSort(HttpServletRequest request) { 22 public SearchApiResult recommendSort(HttpServletRequest request) {
23 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request); 23 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
24 return analysisService.recommendSort(paramMap); 24 return analysisService.recommendSort(paramMap);
25 } 25 }
26 26
27 - @RequestMapping(method = RequestMethod.GET, value = "/recommend/shop") 27 + @RequestMapping(method = RequestMethod.GET, value = "/sortList/recShops")
28 public SearchApiResult recommendShop(HttpServletRequest request) { 28 public SearchApiResult recommendShop(HttpServletRequest request) {
29 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request); 29 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
30 return analysisService.recommendShop(paramMap); 30 return analysisService.recommendShop(paramMap);
31 } 31 }
32 32
33 - @RequestMapping(method = RequestMethod.GET, value = "/recommend/newArrivalShop") 33 + @RequestMapping(method = RequestMethod.GET, value = "/newArrival/recShops")
34 public SearchApiResult recommendNewArrivalShop(HttpServletRequest request) { 34 public SearchApiResult recommendNewArrivalShop(HttpServletRequest request) {
35 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request); 35 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
36 return analysisService.recommendNewArrivalShop(paramMap); 36 return analysisService.recommendNewArrivalShop(paramMap);
37 } 37 }
38 38
39 - @RequestMapping(method = RequestMethod.GET, value = "/recommend/newArrivals") 39 + @RequestMapping(method = RequestMethod.GET, value = "/newArrival/preferenceShops")
40 public SearchApiResult recommendNewArrivals(HttpServletRequest request) { 40 public SearchApiResult recommendNewArrivals(HttpServletRequest request) {
41 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request); 41 Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
42 return analysisService.recommendNewArrivals(paramMap); 42 return analysisService.recommendNewArrivals(paramMap);
@@ -62,7 +62,7 @@ public class RecommendOnProductAnalysisService { @@ -62,7 +62,7 @@ public class RecommendOnProductAnalysisService {
62 62
63 List<Integer> sortIds = getRecommendSortWithPersonal(paramMap, viewNum, uid, udid); 63 List<Integer> sortIds = getRecommendSortWithPersonal(paramMap, viewNum, uid, udid);
64 JSONObject data = new JSONObject(); 64 JSONObject data = new JSONObject();
65 - data.put("sortIds", sortIds); 65 + data.put("misortIds", sortIds);
66 return new SearchApiResult().setData(data); 66 return new SearchApiResult().setData(data);
67 }catch (Exception e) { 67 }catch (Exception e) {
68 LOGGER.error(e.getMessage(), e); 68 LOGGER.error(e.getMessage(), e);
@@ -96,9 +96,9 @@ public class RecommendOnProductAnalysisService { @@ -96,9 +96,9 @@ public class RecommendOnProductAnalysisService {
96 List<Integer> hotShopIds = getHotShops(paramMap); 96 List<Integer> hotShopIds = getHotShops(paramMap);
97 List<Integer> newOpenShopIds = getNewOpenShops(paramMap); 97 List<Integer> newOpenShopIds = getNewOpenShops(paramMap);
98 JSONObject data = new JSONObject(); 98 JSONObject data = new JSONObject();
99 - data.put("seenShopIds", seenShopIds); 99 + data.put("viewedShopIds", seenShopIds);
100 data.put("hotShopIds", hotShopIds); 100 data.put("hotShopIds", hotShopIds);
101 - data.put("newOpenShopIds", newOpenShopIds); 101 + data.put("newShopIds", newOpenShopIds);
102 return new SearchApiResult().setData(data); 102 return new SearchApiResult().setData(data);
103 } 103 }
104 104
@@ -107,7 +107,6 @@ public class RecommendOnProductAnalysisService { @@ -107,7 +107,6 @@ public class RecommendOnProductAnalysisService {
107 paramMapClone.putAll(paramMap); 107 paramMapClone.putAll(paramMap);
108 List<Integer> shopIds = new ArrayList<>(); 108 List<Integer> shopIds = new ArrayList<>();
109 try { 109 try {
110 - addShopCreateTime(paramMapClone);  
111 addDefaultParamsToParamMap(paramMapClone); 110 addDefaultParamsToParamMap(paramMapClone);
112 JSONObject aggResult = aggregationsService.getShopAggregationResult(paramMapClone, 8); 111 JSONObject aggResult = aggregationsService.getShopAggregationResult(paramMapClone, 8);
113 if (aggResult != null && !CollectionUtils.isEmpty(aggResult.getJSONArray("shopAgg"))) { 112 if (aggResult != null && !CollectionUtils.isEmpty(aggResult.getJSONArray("shopAgg"))) {
@@ -445,12 +444,6 @@ public class RecommendOnProductAnalysisService { @@ -445,12 +444,6 @@ public class RecommendOnProductAnalysisService {
445 paramMap.put(SearchRequestParams.PARAM_SEARCH_SHELVETIME, begin + "," + end); 444 paramMap.put(SearchRequestParams.PARAM_SEARCH_SHELVETIME, begin + "," + end);
446 } 445 }
447 446
448 - private void addShopCreateTime(Map<String, String> paramMap) {  
449 - long end = DateUtil.getLastTimeSecond(new Date());  
450 - long begin = DateUtil.getFirstTimeSecond(DateUtil.addDay(new Date(), -50));  
451 - paramMap.put(SearchRequestParams.PARAM_SEARCH_SHOP_CREATE_TIME, begin + "," + end);  
452 - }  
453 -  
454 //获取用户行为 447 //获取用户行为
455 private UserPersonalFactorRspNew getUserPersonalFactor(int uid, String udid) { 448 private UserPersonalFactorRspNew getUserPersonalFactor(int uid, String udid) {
456 return userComponent.queryUserPersionalFactor(uid, udid, null); 449 return userComponent.queryUserPersionalFactor(uid, udid, null);