yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java
@@ -4,11 +4,16 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.yeshi.utils.taobao.TbImgUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.common.GoodsOtherInfoDTO;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.jd.JDPingouInfo;
@@ -24,7 +29,9 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.jd.JDUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
@@ -47,13 +54,14 @@
   /**
    * 淘宝商品组织
    * 
    * @param goods     淘宝商品
    * @param goods
    *            淘宝商品
    * @param pid
    * @param fanLiRate 返利比例
    * @param fanLiRate
    *            返利比例
    * @return
    */
   public static GoodsDetailVO convertCommonGoods(CommonGoods goods, String pid, BigDecimal fanLiRate,
         BigDecimal shareRate) {
   public static GoodsDetailVO convertCommonGoods(CommonGoods goods, ConfigParamsDTO params) {
      GoodsDetailVO goodsInfo = new GoodsDetailVO();
      goodsInfo.setGoodsId(goods.getGoodsId());
      goodsInfo.setTitle(goods.getTitle());
@@ -87,12 +95,12 @@
      if (goodsType == Constant.SOURCE_TYPE_JD) {
         // 月销量
         goodsInfo.setSalesType(1);
         Integer isFreeShipping = otherDTO.getIsFreeShipping();
         if (isFreeShipping != null && isFreeShipping == 1) {
            goodsInfo.setBaoyou(true);
         }
         List<ClientTextStyleVO> labels = goodsInfo.getLabels();
         // 自营
         String owner = otherDTO.getOwner();
@@ -110,7 +118,7 @@
         if (pinGouInfo != null) {
            goods.setPrice(pinGouInfo.getPingouPrice());
            goodsInfo.setPriceName("拼购价");
            if (labels == null) {
               labels = new ArrayList<ClientTextStyleVO>();
            }
@@ -155,12 +163,21 @@
      // 资金信息
      MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
      moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
      moneyInfoVO.setFanliMoney(CommonGoodsUtil.getCommissionInfo(goods, fanLiRate));
      moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, shareRate));
      BigDecimal commission = CommonGoodsUtil.getCommission(goods, params.getFanLiRate());
      moneyInfoVO.setFanliMoney("¥" + commission);
      if (params.getMaxRewardRate() != null)
         moneyInfoVO
               .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
      else
         moneyInfoVO.setMaxMoney("¥" + CommonGoodsUtil.getCommission(goods, params.getVipFanLiRate()));
      moneyInfoVO.setShareMoney(CommonGoodsUtil.getCommissionInfo(goods, params.getShareRate()));
      goodsInfo.setMoneyInfo(moneyInfoVO);
      // 券信息
      if (goods.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
      if (goods.getCouponAmount() != null && goods.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
         // 计算券后价
         BigDecimal sub = goods.getPrice().subtract(goods.getCouponStartPrice());
         if (sub.compareTo(BigDecimal.valueOf(0)) >= 0) {
@@ -179,29 +196,51 @@
         goodsInfo.setCouponInfo(coupon);
      }
      if (goodsType == Constant.SOURCE_TYPE_TAOBAO) {
         // 店铺信息
         if (!StringUtil.isNullOrEmpty(goods.getSellerName()) && goods.getSellerId() != null) {
            ShopInfoVO shop = new ShopInfoVO();
            shop.setShopName(goods.getSellerName());
      // 店铺信息
      if (!StringUtil.isNullOrEmpty(goods.getSellerName())) {
         ShopInfoVO shop = new ShopInfoVO();
         shop.setShopName(goods.getSellerName());
         if (goods.getSellerId() != null)
            shop.setId(goods.getSellerId().toString());
            goodsInfo.setShopInfo(shop);
         if (shopType == null || shopType == 0) {
            shop.setUserType(10);
         } else if (shopType == 1) {
            shop.setUserType(11);
         } else {
            shop.setUserType(goods.getShopType());
         }
         goodsInfo.setShopInfo(shop);
      }
      // if (Constant.IS_TEST) {
      // // 添加标签
      // List<ClientTextStyleVO> labels = goodsInfo.getLabels();
      // if (labels == null)
      // labels = new ArrayList<>();
      //
      // labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
      // goodsInfo.setLabels(labels);
      // }
      return goodsInfo;
   }
   /**
    * 淘宝商品组织
    * 
    * @param goods     淘宝商品
    * @param goods
    *            淘宝商品
    * @param pid
    * @param fanLiRate 返利比例
    * @param fanLiRate
    *            返利比例
    * @return
    */
   public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, BigDecimal fanLiRate,
         BigDecimal shareRate) {
   public static GoodsDetailVO convertTaoBaoGoodsBriefExtra(TaoBaoGoodsBriefExtra goods, ConfigParamsDTO params) {
      GoodsDetailVO goodsInfo = new GoodsDetailVO();
      goodsInfo.setBaoyou(true);
      goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -213,6 +252,7 @@
      goodsInfo.setState(goods.getState() == null ? 0 : goods.getState());
      goodsInfo.setSalesCount(goods.getSalesCount());
      goodsInfo.setPicUrl(goods.getPictUrl());
      goodsInfo.setDescription(goods.getDescription());
      Integer shopType = goods.getUserType();
      if (shopType != null && shopType == 1) {
@@ -231,9 +271,20 @@
         TaoBaoHongBaoInfo taoBaoHongBaoInfo = goods.getTaoBaoHongBaoInfo();
         moneyInfoVO.setFanliMoney("¥" + taoBaoHongBaoInfo.getHongbao());
         moneyInfoVO.setShareMoney("¥" + taoBaoHongBaoInfo.getHongbao());
         if (params.getMaxRewardRate() != null)
            moneyInfoVO.setMaxMoney("¥" + taoBaoHongBaoInfo.getHongbao()
                  .add(MoneyBigDecimalUtil.mul(taoBaoHongBaoInfo.getHongbao(), params.getMaxRewardRate())));
         else
            moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
      } else {
         moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
         moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
         BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
         moneyInfoVO.setFanliMoney("¥" + commission);
         if (params.getMaxRewardRate() != null)
            moneyInfoVO.setMaxMoney(
                  "¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
         else
            moneyInfoVO.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate()));
         moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
      }
      goodsInfo.setMoneyInfo(moneyInfoVO);
@@ -259,13 +310,34 @@
      // 店铺信息
      String shopTitle = goods.getShopTitle();
      Long sellerId = goods.getSellerId();
      if (!StringUtil.isNullOrEmpty(shopTitle) && sellerId != null) {
      if (!StringUtil.isNullOrEmpty(shopTitle)) {
         ShopInfoVO shop = new ShopInfoVO();
         shop.setShopName(shopTitle);
         shop.setId(goods.getSellerId().toString());
         Long sellerId = goods.getSellerId();
         if (sellerId != null)
            shop.setId(goods.getSellerId().toString());
         if (shopType != null && shopType == 1) {
            shop.setUserType(11);
         } else {
            shop.setUserType(10);
         }
         goodsInfo.setShopInfo(shop);
      }
      // if (Constant.IS_TEST) {
      // // 添加标签
      // List<ClientTextStyleVO> labels = goodsInfo.getLabels();
      // if (labels == null)
      // labels = new ArrayList<>();
      //
      // labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
      // goodsInfo.setLabels(labels);
      // }
      return goodsInfo;
   }
@@ -273,13 +345,14 @@
   /**
    * 淘宝商品组织
    * 
    * @param goods     淘宝商品
    * @param goods
    *            淘宝商品
    * @param pid
    * @param fanLiRate 返利比例
    * @param fanLiRate
    *            返利比例
    * @return
    */
   public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, String pid, BigDecimal fanLiRate,
         BigDecimal shareRate) {
   public static GoodsDetailVO convertTaoBao(TaoBaoGoodsBrief goods, ConfigParamsDTO params) {
      GoodsDetailVO goodsInfo = new GoodsDetailVO();
      goodsInfo.setBaoyou(true);
      goodsInfo.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
@@ -287,6 +360,13 @@
      goodsInfo.setTitle(goods.getTitle());
      goodsInfo.setSalesType(1); // 默认月销量
      goodsInfo.setZkPrice(goods.getZkPrice());
      goodsInfo.setDescription(goods.getDescription());
      String provcity = goods.getProvcity();
      if (!StringUtil.isNullOrEmpty(provcity)) {
         String[] arr = provcity.split("\\s+");
         goodsInfo.setProvcity(arr[arr.length - 1]);
      }
      List<String> imgList = goods.getImgList();
      if (imgList != null) {
@@ -306,6 +386,8 @@
      goodsInfo.setSalesCount(TaoBaoUtil.getSaleCount(goods.getBiz30day()));
      // 白底图可能有错误
      // https://img.alicdn.com/bao/uploaded/TB1LVqmVZbpK1RjSZFyXXX_qFXa.png
      if (!StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) {
         goodsInfo.setPicUrl(TbImgUtil.getTBSize320Img(goods.getPictUrlWhite()));
      } else {
@@ -324,8 +406,25 @@
      // 资金信息
      MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
      moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
      moneyInfoVO.setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, fanLiRate));
      moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, shareRate));
      BigDecimal commission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getFanLiRate());
      moneyInfoVO.setFanliMoney("¥" + commission);
      if (params.getMaxRewardRate() != null)
         moneyInfoVO
               .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
      else {// 只有有VIP后的版本才会显示返利比
         BigDecimal price = TaoBaoUtil.getAfterUseCouplePrice(goods);
         BigDecimal rate = MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setRateInfo("返利比 " + rate + "%");
         BigDecimal maxCommission = TaoBaoUtil.getGoodsHongBaoMoney(goods, params.getVipFanLiRate());
         BigDecimal maxRate = MoneyBigDecimalUtil.div(maxCommission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setMaxRateInfo("返利比 " + maxRate + "%");
         moneyInfoVO.setMaxMoney("¥" + maxCommission);
      }
      moneyInfoVO.setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods, params.getShareRate()));
      goodsInfo.setMoneyInfo(moneyInfoVO);
      // 券信息
@@ -351,7 +450,7 @@
            coupon.setStartTime(goods.getCouponEffectiveStartTime().replace("-", "."));
         }
         coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), pid, goods.getAuctionId() + ""));
         coupon.setLink(TaoBaoCouponUtil.getCoupleUrl(goods.getCouponActivityId(), null, goods.getAuctionId() + ""));
         coupon.setStartFee(goods.getCouponStartFee());
         goodsInfo.setHasCoupon(true);
@@ -359,25 +458,109 @@
      }
      // 店铺信息
      if (!StringUtil.isNullOrEmpty(goods.getShopTitle()) && goods.getSellerId() != null) {
      if (!StringUtil.isNullOrEmpty(goods.getShopTitle())) {
         ShopInfoVO shop = new ShopInfoVO();
         shop.setShopName(goods.getShopTitle());
         shop.setId(goods.getSellerId().toString());
         if (goods.getSellerId() != null)
            shop.setId(goods.getSellerId().toString());
         if (shopType != null && shopType == 1) {
            shop.setUserType(11);
         } else {
            shop.setUserType(10);
         }
         goodsInfo.setShopInfo(shop);
      }
      if (TaoBaoUtil.isYUShou(goods)) {// 预售商品
         goodsInfo = loadYuShouInfo(goodsInfo, goods, null, params.getFanLiRate(), params.getShareRate());
      }
      if (Constant.IS_TEST) {
         // 添加标签
         List<ClientTextStyleVO> labels = goodsInfo.getLabels();
         if (labels == null)
            labels = new ArrayList<>();
         labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
         labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
         labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
         goodsInfo.setLabels(labels);
      }
      return goodsInfo;
   }
   private static GoodsDetailVO loadYuShouInfo(GoodsDetailVO goodsInfo, TaoBaoGoodsBrief goods, String pid,
         BigDecimal fanLiRate, BigDecimal shareRate) {
      if (goodsInfo != null && goods != null) {
         // 添加标签
         if (goodsInfo.getLabels() == null)
            goodsInfo.setLabels(new ArrayList<>());
         goodsInfo.getLabels().add(new ClientTextStyleVO("预售", "#FF2B4E"));
      }
      return goodsInfo;
   }
   private static CouponInfoVO convertJDCouponInfo(JDCouponInfo couponInfo) {
      CouponInfoVO coupon = new CouponInfoVO();
      coupon.setAmount(couponInfo.getDiscount());
      coupon.setLink(couponInfo.getLink());
      coupon.setStartFee(couponInfo.getQuota());
      if (couponInfo.getGetStartTime() != null) {
         coupon.setStartTime(TimeUtil.getGernalTime(couponInfo.getGetStartTime(), "yyyy.MM.dd"));
      }
      if (couponInfo.getGetEndTime() != null) {
         coupon.setEndTime(TimeUtil.getGernalTime(couponInfo.getGetEndTime(), "yyyy.MM.dd"));
      }
      return coupon;
   }
   private static List<CouponInfoVO> filterCouponInfo(List<CouponInfoVO> couponList) {
      if (couponList == null)
         return null;
      long currentTime = System.currentTimeMillis();
      Set<String> sets = new HashSet<>();
      // 过滤掉过期券
      for (int i = 0; i < couponList.size(); i++) {
         if (couponList.get(i).getStartTime() != null && couponList.get(i).getEndTime() != null) {
            long startTime = TimeUtil.convertToTimeTemp(couponList.get(i).getStartTime(), "yyyy.MM.dd");
            long endTime = TimeUtil.convertToTimeTemp(couponList.get(i).getEndTime(), "yyyy.MM.dd")
                  + 1000 * 60 * 60 * 24L;
            if (currentTime < startTime || currentTime >= endTime) {
               couponList.remove(i--);
               continue;
            }
         }
         // 过滤掉面值相同与起始金额相同的
         String key = couponList.get(i).getStartFee() + "-" + couponList.get(i).getAmount();
         if (!sets.contains(key))
            sets.add(key);
         else {
            couponList.remove(i--);
            continue;
         }
      }
      return couponList;
   }
   /**
    * 淘宝商品组织
    * 
    * @param goods     淘宝商品
    * @param goods
    *            淘宝商品
    * @param pid
    * @param fanLiRate 返利比例
    * @param fanLiRate
    *            返利比例
    * @return
    */
   public static GoodsDetailVO convertJDGoods(JDGoods goods, BigDecimal fanLiRate, BigDecimal shareRate) {
   public static GoodsDetailVO convertJDGoods(JDGoods goods, ConfigParamsDTO params) {
      GoodsDetailVO goodsInfo = new GoodsDetailVO();
      goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD);
      goodsInfo.setGoodsId(goods.getSkuId());
@@ -398,15 +581,28 @@
      }
      goodsInfo.setSalesCount(salesCountMidea);
      // 资金信息
      MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
      moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
      moneyInfoVO.setFanliMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, fanLiRate));
      moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, shareRate));
      BigDecimal commission = JDUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
      moneyInfoVO.setFanliMoney("¥" + commission);
      if (params.getMaxRewardRate() != null)
         moneyInfoVO
               .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
      else {
         BigDecimal price = JDUtil.getQuanPrice(goods);
         BigDecimal rate = MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setRateInfo("返利比 " + rate + "%");
         BigDecimal maxCommission = JDUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate());
         BigDecimal maxRate = MoneyBigDecimalUtil.div(maxCommission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setMaxRateInfo("返利比 " + maxRate + "%");
         moneyInfoVO.setMaxMoney("¥" + maxCommission);
      }
      moneyInfoVO.setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(goods, params.getShareRate()));
      goodsInfo.setMoneyInfo(moneyInfoVO);
      JDCouponInfo couponInfo = goods.getCouponInfo();
      JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(goods);
      if (couponInfo != null) {
         BigDecimal discount = couponInfo.getDiscount();
         // 计算券后价
@@ -417,7 +613,7 @@
         coupon.setAmount(discount);
         coupon.setLink(couponInfo.getLink());
         coupon.setStartFee(couponInfo.getQuota());
         if (couponInfo.getGetStartTime() != null) {
            coupon.setStartTime(sdf.format(new Date(couponInfo.getGetStartTime())));
         }
@@ -425,10 +621,17 @@
         if (couponInfo.getGetEndTime() != null) {
            coupon.setEndTime(sdf.format(new Date(couponInfo.getGetEndTime())));
         }
         goodsInfo.setHasCoupon(true);
         goodsInfo.setCouponInfo(coupon);
      }
      if (goods.getCouponInfoList() != null && goods.getCouponInfoList().size() > 0) {
         List<CouponInfoVO> couponList = new ArrayList<>();
         for (JDCouponInfo jdCoupon : goods.getCouponInfoList()) {
            couponList.add(convertJDCouponInfo(jdCoupon));
         }
         goodsInfo.setCouponInfoList(filterCouponInfo(couponList));
      }
      List<ClientTextStyleVO> labels = goodsInfo.getLabels();
@@ -447,12 +650,11 @@
         goodsInfo.setShopType(20); // 京东
      }
      JDPingouInfo pinGouInfo = goods.getPinGouInfo();
      if (pinGouInfo != null) {
         goodsInfo.setZkPrice(pinGouInfo.getPingouPrice());
         goodsInfo.setPriceName("拼购价");
         if (labels == null) {
            labels = new ArrayList<ClientTextStyleVO>();
         }
@@ -465,13 +667,14 @@
         goodsInfo.setPriceName("京东价");
      }
      goodsInfo.setLabels(labels);
      // 店铺信息
      JDShopInfo shopInfo = goods.getShopInfo();
      if (shopInfo != null && !StringUtil.isNullOrEmpty(shopInfo.getShopName())) {
         ShopInfoVO shop = new ShopInfoVO();
         shop.setShopName(shopInfo.getShopName());
         shop.setId(shopInfo.getShopId().toString());
         if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
            shop.setUserType(20);
         } else {
@@ -479,24 +682,27 @@
         }
         goodsInfo.setShopInfo(shop);
      }
      // 是否包邮
      Integer isFreeShipping = goods.getIsFreeShipping();
      if (isFreeShipping != null && isFreeShipping == 1) {
         goodsInfo.setBaoyou(true);
      }
      return goodsInfo;
   }
   /**
    * 拼多多商品
    * 
    * @param goods     拼多多商品
    * @param goods
    *            拼多多商品
    * @param pid
    * @param fanLiRate 返利比例
    * @param fanLiRate
    *            返利比例
    * @return
    */
   public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, BigDecimal fanLiRate, BigDecimal shareRate) {
   public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, ConfigParamsDTO params) {
      GoodsDetailVO goodsInfo = new GoodsDetailVO();
      goodsInfo.setBaoyou(true);
      goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD);
@@ -531,9 +737,9 @@
      // 资金信息
      MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
      moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
      moneyInfoVO.setFanliMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, fanLiRate));
      moneyInfoVO.setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate));
      goodsInfo.setMoneyInfo(moneyInfoVO);
      BigDecimal commission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getFanLiRate());
      moneyInfoVO.setFanliMoney("¥" + commission);
      moneyInfoVO.setShareMoney("¥" + commission);
      Boolean hasCoupon = goods.getHasCoupon();
      if (hasCoupon != null && hasCoupon) {
@@ -555,7 +761,7 @@
         CouponInfoVO coupon = new CouponInfoVO();
         coupon.setAmount(amount);
         coupon.setStartFee(startFree);
         if (goods.getCouponStartTime() != null) {
            coupon.setStartTime(sdf.format(new Date(goods.getCouponStartTime() * 1000)));
         }
@@ -563,7 +769,7 @@
         if (goods.getCouponEndTime() != null) {
            coupon.setEndTime(sdf.format(new Date(goods.getCouponEndTime() * 1000)));
         }
         if (goods.getCouponTotalQuantity() != null)
            coupon.setTotalCount(Integer.parseInt(goods.getCouponTotalQuantity().toString()));
@@ -574,6 +780,22 @@
         goodsInfo.setCouponInfo(coupon);
      }
      if (params.getMaxRewardRate() != null)
         moneyInfoVO
               .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
      else {
         BigDecimal price = goodsInfo.getCouponPrice() != null ? goodsInfo.getCouponPrice() : goodsInfo.getZkPrice();
         BigDecimal rate = MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setRateInfo("返利比 " + rate + "%");
         BigDecimal maxCommission = PinDuoDuoUtil.getGoodsFanLiMoney(goods, params.getVipFanLiRate());
         BigDecimal maxRate = MoneyBigDecimalUtil.div(maxCommission.multiply(new BigDecimal(100)), price);
         moneyInfoVO.setMaxRateInfo("返利比 " + maxRate + "%");
         moneyInfoVO.setMaxMoney("¥" + maxCommission);
      }
      goodsInfo.setMoneyInfo(moneyInfoVO);
      // 店铺信息
      String mallName = goods.getMallName();
      if (!StringUtil.isMobile(mallName)) {
@@ -582,10 +804,23 @@
         if (goods.getMallId() != null) {
            shop.setId(goods.getMallId().toString());
         }
         shop.setUserType(30);
         goodsInfo.setShopInfo(shop);
      }
      // if (Constant.IS_TEST) {
      // // 添加标签
      // List<ClientTextStyleVO> labels = goodsInfo.getLabels();
      // if (labels == null)
      // labels = new ArrayList<>();
      //
      // labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
      // labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
      // goodsInfo.setLabels(labels);
      // }
      return goodsInfo;
   }
}