| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.JDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private CommonTemplateContentService commonTemplateContentService;
|
| | |
| | | // 猜你喜欢
|
| | | String idfa = acceptData.getIdfa();
|
| | | String imei = acceptData.getImei();
|
| | | result = guessLikeDeviceTB(idfa, imei, page);
|
| | | result = guessLikeDeviceTB(idfa, imei, acceptData.getUtdid(), page);
|
| | | } else {
|
| | | // 大淘客页码只能为10,50,100,200
|
| | | result = commonTemplateContentService.getContentList(type, cid, page, 10);
|
| | |
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | | List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (result != null)
|
| | | goodsList = result.getGoodsList();
|
| | |
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | if (type == CommonContentTypeEnum.mianDan)// 免单商品
|
| | |
| | | }
|
| | |
|
| | | root.put("list", array);
|
| | | root.put("count", result.getCount());
|
| | | root.put("count", result != null ? result.getCount() : 0);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | |
| | |
|
| | | List<JDGoods> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (JDGoods goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
|
| | | }
|
| | |
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> bannerList = null;
|
| | | if (Constant.IS_TEST) {
|
| | | bannerList = swiperPictureService.getByBannerCardAndVersion("index_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | bannerList = swiperPictureService.getByBannerCardAndVersion("index_top", acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | |
|
| | | if (bannerList == null) {
|
| | |
| | |
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | @Cacheable(value = "commonContentCache", key = "#idfa+'-'+#imei+'-'+#page")
|
| | | private CommonContentResult guessLikeDeviceTB(String idfa, String imei, Integer page) {
|
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa);
|
| | | private CommonContentResult guessLikeDeviceTB(String idfa, String imei, String utdid, Integer page) {
|
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa, utdid);
|
| | | if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null
|
| | | && searchResult.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | CommonContentResult result = new CommonContentResult();
|