admin
2021-03-22 b861b9126bc9adf6eb2417156412ac7b48e67940
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());