2.1
yujian
2020-03-17 d0f12da013131cd291cec6e81a12d661c02c4bf4
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -62,6 +62,7 @@
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
@@ -628,8 +629,7 @@
                  return new JsonPrimitive("");
               } else {
                  // 保留2位小数
                  value = value.setScale(2);
                  return new JsonPrimitive(value.toString());
                  return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value)+"");
               }
            }
         }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
@@ -821,7 +821,7 @@
                     continue;
                  }
                  String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode);
                  String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode, imgInfo.getUrl());
                  if (!StringUtil.isNullOrEmpty(jumpLink)) {
                     list.add(jumpLink);
                  }
@@ -833,7 +833,7 @@
                     if (imgInfo.getGoodsVO() != null)
                        if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue()
                              && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) {
                           String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode);
                           String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl());
                           if (!StringUtil.isNullOrEmpty(jumpLink)) {
                              list.add(jumpLink);
                           }
@@ -843,7 +843,7 @@
               } else if (type == 2 || type == 3) {
                  for (ImgInfo imgInfo : imgs) {
                     if (imgInfo.getGoodsVO() != null) {
                        String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode);
                        String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl() );
                        if (!StringUtil.isNullOrEmpty(jumpLink)) {
                           list.add(jumpLink);
                        }
@@ -891,7 +891,7 @@
      }
   }
   private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode) {
   private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, String mainPic) {
      String jumpLink = null;
      if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
         TaoBaoLink taoBaoLink = null;
@@ -923,7 +923,7 @@
      }
      FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode,
            goodsVO);
            mainPic, goodsVO);
      if (uploadResult != null) {
         return uploadResult.getUrl();
      }
@@ -998,6 +998,20 @@
         return;
      }
      // 替换价格
      if (goodsEvaluate.getType() == EvaluateEnum.single) {
         GoodsDetailVO goods = goodsEvaluate.getGoods();
         newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) +"");
         if (!goods.isHasCoupon()) {
            newText = newText.replace("领券抢购", "抢购");
            newText = newText.replace("【券后价】[券后价]元", "");
         } else {
            newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+"");
         }
         newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
      }
      JSONObject data = new JSONObject();
      data.put("text", newText);
      out.print(JsonUtil.loadTrueResult(data));