From 4e9f593c3d1bd4a2689887fd304a2a418ff4a4fe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 20 一月 2022 15:16:08 +0800 Subject: [PATCH] 拼多多搜索链接问题 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java | 35 +++++++++++++++++++++++------------ 1 files changed, 23 insertions(+), 12 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java index 9ab8bf7..fc51314 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java @@ -171,7 +171,7 @@ // 鍘婚櫎鍓嶅悗绌烘牸 text = text.trim(); String originalText = text; - if (acceptData.getSystem() == SystemEnum.yhqjx||acceptData.getSystem() == SystemEnum.hsb) { + if (acceptData.getSystem() == SystemEnum.yhqjx || acceptData.getSystem() == SystemEnum.hsb) { Integer sourceType = clipboardAnalysisManager.tejiaParseSourceType(text); JSONObject root = new JSONObject(); root.put("type", 2); @@ -188,7 +188,7 @@ @Override public void onResult(GoodsDocParseResultVO result) { - if (uid == null || (acceptData.getSystem() == SystemEnum.yhqjx||acceptData.getSystem() == SystemEnum.hsb)) { + if (uid == null || (acceptData.getSystem() == SystemEnum.yhqjx || acceptData.getSystem() == SystemEnum.hsb)) { out.print(JsonUtil.loadFalseResult("鏃犳帹鑽�")); return; } @@ -201,7 +201,7 @@ int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); int version = Integer.parseInt(acceptData.getVersion()); JumpDetailContentVO convert = new JumpDetailContentVO(); - convert.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version,acceptData.getSystem())); + convert.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version, acceptData.getSystem())); JSONObject convertParams = new JSONObject(); convertParams.put("url", configService.getValue(ConfigKeyEnum.convertDocWebLink.getKey(), acceptData.getSystem())); convertParams.put("clipboard", false); @@ -223,17 +223,17 @@ if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { view = new JumpDetailContentVO(); view.setJumpDetail( - jumpDetailV2Service.getByTypeCache("goodsdetail", platformCode, version,acceptData.getSystem())); + jumpDetailV2Service.getByTypeCache("goodsdetail", platformCode, version, acceptData.getSystem())); view.setParams(params); } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_JD) { view = new JumpDetailContentVO(); view.setJumpDetail( - jumpDetailV2Service.getByTypeCache("goodsdetail_jd", platformCode, version,acceptData.getSystem())); + jumpDetailV2Service.getByTypeCache("goodsdetail_jd", platformCode, version, acceptData.getSystem())); view.setParams(params); } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_PDD) { view = new JumpDetailContentVO(); view.setJumpDetail( - jumpDetailV2Service.getByTypeCache("goodsdetail_pdd", platformCode, version,acceptData.getSystem())); + jumpDetailV2Service.getByTypeCache("goodsdetail_pdd", platformCode, version, acceptData.getSystem())); view.setParams(params); } @@ -241,7 +241,7 @@ state = 2; data.put("stateDesc", "閫夋嫨鎼滃埜鎴栬浆閾�"); view = new JumpDetailContentVO(); - view.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version,acceptData.getSystem())); + view.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version, acceptData.getSystem())); JSONObject params = new JSONObject(); params.put("url", result.getFirstLink()); view.setParams(params); @@ -301,7 +301,7 @@ acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem())); - goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO,false); + goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO, false); data.put("goods", gson.toJson(goodsDetailVO)); @@ -439,7 +439,7 @@ } RecommendJumpInfoVO left = new RecommendJumpInfoVO("鍘荤湅鐪�", jumpDetailV2Service.getByTypeCache(type, - Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()), params); + Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()), params); data.put("left", gson.toJson(left)); // 鍘荤綉椤� @@ -453,7 +453,7 @@ params.put("url", rightValue); RecommendJumpInfoVO right = new RecommendJumpInfoVO("鏈夋洿楂樿繑鍒╋紵", jumpDetailV2Service.getByTypeCache("web", - Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()), + Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()), params); data.put("right", gson.toJson(right)); } @@ -528,7 +528,7 @@ */ @RequestMapping(value = "searchGoods") public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter, - Integer order, Long uid, String notifyType, HttpSession session,HttpServletRequest request, PrintWriter out) { + Integer order, Long uid, String notifyType, HttpSession session, HttpServletRequest request, PrintWriter out) { if (goodsType == null || goodsType < 1 || goodsType > 5) { out.print(JsonUtil.loadFalseResult(1, "璇蜂紶閫掓纭钩鍙板弬鏁�")); @@ -878,7 +878,7 @@ GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion(), acceptData.getSystem()); - List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefList, paramsDTO,false); + List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBriefList, paramsDTO, false); Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) .excludeFieldsWithoutExposeAnnotation().create(); @@ -1177,6 +1177,17 @@ } } catch (PDDApiException e) { e.printStackTrace(); + if (e.getCode() == PDDApiException.CODE_NOT_AUTH) { + try { + PDDGoodsDetail pddGoodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(goodsId), PinDuoDuoApiUtil.PID_DEFAULT, Constant.PDD_SEARCH_CUSTOMER_PARAMS); + if (pddGoodsDetail != null) { + count = 1; + goodsList.add(pddGoodsDetail); + } + } catch (Exception e1) { + + } + } } } else { PDDSearchFilter pddfilter = new PDDSearchFilter(); -- Gitblit v1.8.0