yujian
2019-12-20 eda5d0e998204c7a49ab84d8528569b765bec2f9
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -240,7 +240,7 @@
      LogHelper.test("获取PID耗时:" + (java.lang.System.currentTimeMillis() - startTime));
      final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      // final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      // 是否在服务端进行转链
      boolean convertInServer = configService.isConvertTaoBaoLinkInServer();
@@ -309,7 +309,6 @@
      }
      if (goods != null) {
         goodsList.add(goods);
         final TaoBaoGoodsBrief newGoods = goods;
         ThreadUtil.run(new Runnable() {
            public void run() {
@@ -324,10 +323,7 @@
         });
      }
      TaoBaoGoodsBrief tb = null;
      if (goodsList.size() > 0) {
         tb = goodsList.get(0);
      }
      TaoBaoGoodsBrief tb = goods;
      if (tb == null) {
         out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
@@ -338,14 +334,31 @@
         tb.setImgList(new ArrayList<>());
      }
      tb.getImgList().add(0, tb.getPictUrl());
      // tb.getImgList().add(0, tb.getPictUrl());
      List<String> finalImgList = new ArrayList<>();
      for (String img : tb.getImgList()) {
         finalImgList.add(TbImgUtil.getTBSizeImg(img, 600));
      }
      if (finalImgList.size() == 0) {
         finalImgList.add(tb.getPictUrl());
      }
      if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
         finalImgList.add(0, tb.getPictUrlWhite());
      // 移除相同图片
      if (finalImgList.size() > 0)
         for (int i = 0; i < finalImgList.size(); i++) {
            if (i < finalImgList.size() - 1)
               if (TbImgUtil.getTBSizeImg(finalImgList.get(i), 600)
                     .equalsIgnoreCase(TbImgUtil.getTBSizeImg(finalImgList.get(i + 1), 600))) {
                  finalImgList.remove(i--);
               }
         }
      tb.setImgList(finalImgList);
      // 大淘客商品过滤
      try {
@@ -361,7 +374,8 @@
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
         goodsDetail.getMoneyInfo().setShareMoney("¥"+ TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
         goodsDetail.getMoneyInfo().setShareMoney(
               "¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
      }
      if (TaoBaoUtil.isYUShou(goods)) {
@@ -508,13 +522,21 @@
         otherInfo.setReduceHongBao(newUserHongBao);
         goodsDetail.setOtherInfo(otherInfo);
         // 专属标签
         List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
         labels.add(new ClientTextStyleVO("新人专属", "#FE0014"));
         labels.add(new ClientTextStyleVO("实付0元", "#FF9600"));
         goodsDetail.setLabels(labels);
      } else {// 普通购买
         OtherInfo otherInfo = new OtherInfo();
         RewardCouponVO rewardCoupon = new RewardCouponVO();
         rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
         JSONObject params1 = new JSONObject();
         params1.put("url", configService.get("special_guide_reward_coupon_link"));
         if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
            params1.put("url", configService.get("special_guide_reward_coupon_link"));
         else
            params1.put("url", configService.get("vip_link"));
         rewardCoupon
               .setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPFanLiRate()));
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -609,7 +631,8 @@
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
         goodsDetail.getMoneyInfo().setShareMoney("¥"+ JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
         goodsDetail.getMoneyInfo()
               .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
      }
      // 附加信息
@@ -648,7 +671,10 @@
      rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
      rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
      JSONObject params1 = new JSONObject();
      params1.put("url", configService.get("special_guide_reward_coupon_link"));
      if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
         params1.put("url", configService.get("special_guide_reward_coupon_link"));
      else
         params1.put("url", configService.get("vip_link"));
      rewardCoupon.setMaxMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate()));
      if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -801,7 +827,8 @@
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
         goodsDetail.getMoneyInfo().setShareMoney("¥"+ PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
         goodsDetail.getMoneyInfo().setShareMoney(
               "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
      }
      // 附加信息
@@ -809,7 +836,10 @@
      RewardCouponVO rewardCoupon = new RewardCouponVO();
      rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
      JSONObject params1 = new JSONObject();
      params1.put("url", configService.get("special_guide_reward_coupon_link"));
      if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
         params1.put("url", configService.get("special_guide_reward_coupon_link"));
      else
         params1.put("url", configService.get("vip_link"));
      rewardCoupon
            .setMaxMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPFanLiRate()));