From b861b9126bc9adf6eb2417156412ac7b48e67940 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 22 三月 2021 14:02:14 +0800 Subject: [PATCH] 支付宝调整 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java index 695f55f..50aac58 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java @@ -11,6 +11,7 @@ import com.yeshi.fanli.entity.SystemEnum; import com.yeshi.fanli.entity.SystemFunction; +import com.yeshi.fanli.exception.pdd.PDDApiException; import com.yeshi.fanli.service.inter.pdd.PDDAuthService; import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; import com.yeshi.fanli.util.*; @@ -928,7 +929,18 @@ return; } - PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, PinDuoDuoApiUtil.PID_FANLI, pddAuthService.getFanliCustomParams(uid)); + PDDGoodsDetail pddGoods = null; + try { + pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, PinDuoDuoApiUtil.PID_FANLI, pddAuthService.getFanliCustomParams(uid)); + } catch (PDDApiException e) { + e.printStackTrace(); + if (e.getCode() == PDDApiException.CODE_NOT_AUTH) { + try { + pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, PinDuoDuoApiUtil.PID_FANLI, Constant.PDD_SEARCH_CUSTOMER_PARAMS); + } catch (PDDApiException e1) { + } + } + } if (pddGoods == null) { out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧涓嶅瓨鍦�")); return; @@ -975,7 +987,7 @@ CouponInfoVO couponInfo = goodsDetail.getCouponInfo(); PDDPromotionUrl convertUrl = null; if (couponInfo != null) { - convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null, false); + convertUrl = PinDuoDuoApiUtil.convert(pddGoods.getGoodsSign(), PinDuoDuoApiUtil.PID_COUPON + "", null, false); if (convertUrl != null) couponInfo.setLink(convertUrl.getUrl()); } @@ -1097,17 +1109,18 @@ object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail)); out.print(JsonUtil.loadTrueResult(object.toString())); + final PDDGoodsDetail fGoods=pddGoods; ThreadUtil.run(new Runnable() { public void run() { // 娣诲姞娴忚璁板綍 try { - scanHistoryV2Service.addPDDScanHistory(uid, acceptData.getDevice(), pddGoods); + scanHistoryV2Service.addPDDScanHistory(uid, acceptData.getDevice(), fGoods); } catch (Exception e) { e.printStackTrace(); } try { - goodsEvaluateService.updatePDDGoods(pddGoods); + goodsEvaluateService.updatePDDGoods(fGoods); } catch (Exception e) { e.printStackTrace(); } @@ -1813,7 +1826,7 @@ //TODO 鏄惁闇�瑕佽繑鍥炵粦瀹氶摼鎺� String customParams = pddAuthService.getFanliCustomParams(uid); boolean auth = PinDuoDuoApiUtil.isAuth(pid, customParams); - PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, pid + "", customParams, !auth); + PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(goods.getGoodsSign(), pid + "", customParams, !auth); JSONObject data = new JSONObject(); data.put("native", true); data.put("jumpLink", convertUrl.getUrl()); -- Gitblit v1.8.0