admin
2019-01-30 51c159793a6bf01a75e47ab6e781a0b4d70b1fb1
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java
@@ -75,6 +75,8 @@
      boolean isNative = false;
      String pid = null;
      boolean specialConvert = false;
      String specialId = null;
      // 查询用户ID是否绑定了会员运营ID
      UserExtraTaoBaoInfo userInfo = userExtraTaoBaoInfoService.getByUid(uid);
@@ -86,6 +88,7 @@
            TaoBaoGoodsBrief goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId);
            if (goods.getMaterialLibType() != null && goods.getMaterialLibType() == 1) {
               isNative = true;
               specialConvert = true;
            } else
               isNative = false;
         } catch (TaobaoGoodsDownException e) {
@@ -99,16 +102,25 @@
         isNative = true;
      }
      data.put("native", isNative);
      try {
         int pidType = PidUser.TYPE_FANLI_ANDROID;
         if (acceptData.getPlatform().equalsIgnoreCase("ios"))
            pidType = PidUser.TYPE_FANLI_IOS;
         TaoBaoLink taoBaoLink = null;
         if (!StringUtil.isNullOrEmpty(specialId)) {
         if (!StringUtil.isNullOrEmpty(specialId) && specialConvert) {
            taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId);
         } else {
            taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
            if (!specialConvert && !isNative) {
               if (pidType == PidUser.TYPE_FANLI_ANDROID)
                  taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                        tbPidService.getAndroidDefault().getPid());
               else
                  taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
                        tbPidService.getIOSDefault().getPid());
            } else
               taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
         }
         JSONObject link = new JSONObject();
@@ -133,6 +145,8 @@
            tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_IOS);
         }
         data.put("native", isNative);
         if (tbPid != null) {
            String siteId = tbPid.getPid().split("_")[2];
            String adzoneId = tbPid.getPid().split("_")[3];
@@ -145,7 +159,6 @@
            out.print(JsonUtil.loadFalseResult(1, "请求失败"));
         }
      }
      data.put("native", isNative);
   }