From a7bf2b211cefab27df0d8c324cb6e70ec9643fc8 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期二, 29 一月 2019 12:32:27 +0800 Subject: [PATCH] Merge branch 'div' --- fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java index c17c6f4..0286b5a 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java @@ -74,17 +74,21 @@ JSONObject data = new JSONObject(); boolean isNative = false; String pid = null; - + boolean specialConvert = false; + + String specialId = null; // 鏌ヨ鐢ㄦ埛ID鏄惁缁戝畾浜嗕細鍛樿繍钀D UserExtraTaoBaoInfo userInfo = userExtraTaoBaoInfoService.getByUid(uid); if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getSpecialId()) && userInfo.getSpecialValid() != null && userInfo.getSpecialValid() == true) { + specialId = userInfo.getSpecialId(); // 宸茬粡缁戝畾 try { TaoBaoGoodsBrief goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId); if (goods.getMaterialLibType() != null && goods.getMaterialLibType() == 1) { isNative = true; + specialConvert = true; } else isNative = false; } catch (TaobaoGoodsDownException e) { @@ -97,16 +101,28 @@ } else {// 灏氭湭缁戝畾 isNative = true; } - - data.put("native", isNative); - + data.put("native", isNative); try { int pidType = PidUser.TYPE_FANLI_ANDROID; if (acceptData.getPlatform().equalsIgnoreCase("ios")) pidType = PidUser.TYPE_FANLI_IOS; - - TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType); + + TaoBaoLink taoBaoLink = null; + if (!StringUtil.isNullOrEmpty(specialId) && specialConvert) { + taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId); + } else { + 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(); link.put("clickUrl", taoBaoLink.getClickUrl()); link.put("couponUrl", taoBaoLink.getCouponLink()); @@ -115,6 +131,7 @@ out.print(JsonUtil.loadTrueResult(data)); } catch (Exception e) { + isNative = false; try { monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "璐拱娣樺疂鍟嗗搧杞摼鍑洪敊")); } catch (Exception e1) { @@ -128,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]; -- Gitblit v1.8.0