| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import com.yeshi.goods.facade.dto.taobao.dataoke.DingDongTime; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | |
| | | |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | /** |
| | | * 新版推荐专题管理(1.5.3) |
| | |
| | | |
| | | /* 遍历列表数据 */ |
| | | |
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (DaTaoKeDetailV2 detail : listGoods) { |
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | if (detailList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (DaTaoKeDetailV2 detail : detailList) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodList") |
| | | public void getGoodList(AcceptData acceptData, Integer goodsType, Integer page, HttpServletRequest request, |
| | | public void getGoodList(AcceptData acceptData, Long uid, Integer goodsType, Integer page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | |
| | | if (goodsType == null || page == null) { |
| | |
| | | |
| | | try { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | taoBaoGuessUserLikeByDevice(acceptData, page, request, out); |
| | | taoBaoGuessUserLikeByDevice(acceptData, uid, page, request, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 根据设备信息获取猜你喜欢的内容 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void taoBaoGuessUserLikeByDevice(AcceptData acceptData, int page, HttpServletRequest request, |
| | | public void taoBaoGuessUserLikeByDevice(AcceptData acceptData, Long uid, int page, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | int pageSize = Constant.PAGE_SIZE; |
| | | JSONArray array = new JSONArray(); |
| | |
| | | } |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (TaoBaoGoodsBrief goods : goodsList) { |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | if (page < 3) |
| | | detailVO.setRecommend(true); |
| | | |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | |
| | | for (GoodsDetailVO vo : voList) { |
| | | if (page < 3) |
| | | vo.setRecommend(true); |
| | | try { |
| | | array.add(gson.toJson(detailVO)); |
| | | array.add(gson.toJson(vo)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | List<TLJBuyGoods> list = homeRecommendGoodsService.getZiGouLiJianHotGoods(acceptData.getDevice()); |
| | | if (list != null && list.size() > 0) { |
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE; |
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE, |
| | | GoodsMoneyConfigParamsDTO paramsBuy = new GoodsMoneyConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())); |
| | | for (int i = list.size() - 1; i >= 0; i--) { |
| | | TLJBuyGoods goods = list.get(i); |
| | |
| | | |
| | | // 设备推荐 |
| | | if (gList != null) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | List<TaoBaoGoodsBrief> deviceGoodsList = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : gList) { |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null |
| | | && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0 |
| | | && goods.getBiz30day() > 1000 |
| | | && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) { |
| | | deviceGoodsList.add(goods); |
| | | } |
| | | } |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO); |
| | | for (GoodsDetailVO vo : voList) { |
| | | vo.setRecommend(true); |
| | | } |
| | | goodsList.addAll(voList); |
| | | } |
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | detailVO.setRecommend(true); |
| | | goodsList.add(detailVO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, |
| | |
| | | |
| | | List<JDGoods> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | |
| | | JSONArray arrayKeys = JSONArray.fromObject(keys); |
| | | if (arrayKeys != null && arrayKeys.size() > 0) { |
| | | count = arrayKeys.size(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | int j = 1; |