admin
2019-07-09 531d93708df8017e59830f15b41f3cc42d6126e6
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -19,6 +19,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.exception.ShareGoodsException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
@@ -77,6 +78,23 @@
   @Resource
   private UserTaoLiJinRecordService userTaoLiJinRecordService;
   
   private void doTaoLiJinBuy(Long uid, Long auctionId, PrintWriter out) {
      JSONObject data = new JSONObject();
      TaoBaoLink taoBaoLink;
      try {
         taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuyWithOutFanLi(uid, auctionId);
      } catch (ShareGoodsException e) {
         out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
         return;
      }
      data.put("native", true);
      JSONObject link = new JSONObject();
      link.put("clickUrl", taoBaoLink.getClickUrl());
      link.put("couponUrl", taoBaoLink.getCouponLink());
      data.put("type", 1);
      data.put("link", link);
      out.print(JsonUtil.loadTrueResult(data));
   }
   
   /**
    * 获取淘宝的分享链接
@@ -121,6 +139,11 @@
         }
      }
      if ("taolijin_buy".equalsIgnoreCase(source)) {
         doTaoLiJinBuy(uid, auctionId, out);
         return;
      }
      JSONObject data = new JSONObject();
      boolean isNative = false;
      String pid = null;
@@ -159,13 +182,15 @@
         pidType = PidUser.TYPE_FANLI_IOS;
      try {
         TaoBaoLink taoBaoLink = null;
         // 是返利商品库的商品
         if (specialConvert) {
            if (!StringUtil.isNullOrEmpty(specialId)) {
               if (source != null && "taolijin".equals(source)) {
                  boolean isNewUser = userInfoExtraService.isNewUser(uid);
                  if (isNewUser) {
                     // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
                     // 判定为老用户:
                     // 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
                     long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
                     if (countRecord == 0) {
                        taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId);
@@ -274,9 +299,6 @@
         businessEmergent110Service.buyTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
      }
   } 
   /**
    * 是否在参与推广