admin
2019-12-31 6d17fb69b25cd74c4598784a6cf6fe7a9b651e34
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -340,6 +340,11 @@
      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());
@@ -362,10 +367,9 @@
         LogHelper.errorDetailInfo(e);
      }
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
            hongBaoManageService.getVIPFanLiRate());
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
@@ -528,13 +532,12 @@
         RewardCouponVO rewardCoupon = new RewardCouponVO();
         rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
         JSONObject params1 = new JSONObject();
         if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
         if (!VersionUtil.greaterThan_2_0_5(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())) {
         rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
         if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
            rewardCoupon.setDesc("返");
            params1.put("url", configService.get("vip_link"));
            rewardCoupon.getJumpDetail().setNeedLogin(true);
@@ -619,10 +622,8 @@
      // 保存缓存
      jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
            hongBaoManageService.getVIPFanLiRate());
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
@@ -646,12 +647,14 @@
            if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
               jdGoods.setCommissionPlus(threeClass.getSelfComm());
               // plus返利
               BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
               BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
                     hongBaoManageService.getFanLiRate());
               otherInfo.setFanliMoneyPlus("京东plus返¥" + fanliMoneyPlus);
               // 使用奖励券最高返
               if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
               if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
                  maxMoneyPlus = "(京东plus返¥"
                        + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
                        + JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
                              hongBaoManageService.getVIPFanLiRate())
                        + ")";
               } else
                  maxMoneyPlus = "(京东plus最高返¥"
@@ -666,13 +669,13 @@
      rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
      rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
      JSONObject params1 = new JSONObject();
      if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
      if (!VersionUtil.greaterThan_2_0_5(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())) {
      rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
      if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
         rewardCoupon.setDesc("返");
         params1.put("url", configService.get("vip_link"));
         rewardCoupon.getJumpDetail().setNeedLogin(true);
@@ -815,10 +818,8 @@
         return;
      }
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
            hongBaoManageService.getVIPFanLiRate());
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
      if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
         goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
@@ -831,14 +832,13 @@
      RewardCouponVO rewardCoupon = new RewardCouponVO();
      rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
      JSONObject params1 = new JSONObject();
      if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
      if (!VersionUtil.greaterThan_2_0_5(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()));
      if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
      rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
      if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
         rewardCoupon.setDesc("返");
         params1.put("url", configService.get("vip_link"));
         rewardCoupon.getJumpDetail().setNeedLogin(true);
@@ -989,10 +989,8 @@
               list = list.subList(0, 10);
            }
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
                  hongBaoManageService.getVIPFanLiRate());
            ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
            for (JDGoods goods : list) {
@@ -1033,10 +1031,8 @@
                        goodsList = goodsList.subList(0, 10);
                     }
                     BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                     BigDecimal shareRate = hongBaoManageService.getShareRate();
                     ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate,
                           Constant.MAX_REWARD_RATE, hongBaoManageService.getVIPFanLiRate());
                     ConfigParamsDTO paramsDTO = hongBaoManageService
                           .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
                     for (PDDGoodsDetail goods : goodsList) {
                        listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
                     }
@@ -1079,10 +1075,8 @@
         if (goodsList != null && goodsList.size() > 0) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
                  hongBaoManageService.getVIPFanLiRate());
            ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            goodsList.parallelStream().forEach(goods -> {
               if (goods != null) {
@@ -1360,6 +1354,7 @@
      ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
            hongBaoManageService.getShareRate(), new BigDecimal(80), hongBaoManageService.getVIPFanLiRate());
      hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
      if (tbGoodsList.size() > 0) {
         List<TaoBaoGoodsBrief> goodsList = null;