admin
2019-11-20 8b2191df2f7d94aa299bd43dcbe97c94e5a61bbd
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -16,6 +16,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDCategoryInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -348,7 +349,8 @@
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
      if (TaoBaoUtil.isYUShou(goods)) {
         if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
@@ -639,7 +641,8 @@
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, fanLiRate, shareRate);
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
      // 附加信息
      OtherInfo otherInfo = new OtherInfo();
@@ -813,7 +816,8 @@
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
      // 附加信息
      OtherInfo otherInfo = new OtherInfo();
@@ -971,10 +975,11 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
            for (JDGoods goods : list) {
               listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate));
               listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO));
            }
            // 取偶数个数据
@@ -1013,8 +1018,10 @@
                     BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                     BigDecimal shareRate = hongBaoManageService.getShareRate();
                     ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate,
                           Constant.MAX_REWARD_RATE);
                     for (PDDGoodsDetail goods : goodsList) {
                        listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate));
                        listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
                     }
                  }
               }
@@ -1030,7 +1037,7 @@
            return;
         }
         List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getRelationGoodsRecommend(id, 10);
         List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(id, 10);
         // 初始化
         if (goodsList == null) {
            goodsList = new ArrayList<TaoBaoGoodsBrief>();
@@ -1057,6 +1064,7 @@
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
            goodsList.parallelStream().forEach(goods -> {
               if (goods != null) {
@@ -1077,8 +1085,7 @@
                  }
                  if (taoBaoGoodsBrief != null) {
                     listExtra.add(
                           GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate));
                     listExtra.add(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO));
                  }
               }
            });