From 3727469752a977dde6327e2c48d761b20b565d3d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 15 七月 2022 09:19:21 +0800 Subject: [PATCH] 商品ID字符串化 --- fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java index 8b296ee..7ddae40 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java @@ -374,8 +374,13 @@ if (couponInfo != null) { // 鍒搁摼鎺ュ鐞� String materialId = "https://item.jd.com/" + id + ".html"; - String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), - null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); + String url = null; + try { + url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), + null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); + } catch (Exception e) { + e.printStackTrace(); + } couponInfo.setLink(url); } @@ -414,7 +419,7 @@ extraVO.setListShareUser(listShareUser); // 棰嗗埜浜哄垪琛� - List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); + List<ShamUser> listCouponUser = new ArrayList<>(); if (goodsDetail.isHasCoupon() && Integer.parseInt(inOrderCount30Days.toString()) >= 1000) { listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); } @@ -422,7 +427,7 @@ if (uid != null) { // 鏄惁鍔犲叆鏀惰棌 - CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, + CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", Constant.SOURCE_TYPE_JD); extraVO.setCollected(collectionGoods != null ? true : false); } @@ -568,7 +573,7 @@ if (uid != null) { // 鏄惁鍔犲叆鏀惰棌 - CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, + CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", Constant.SOURCE_TYPE_PDD); extraVO.setCollected(collectionGoods != null ? true : false); } @@ -777,7 +782,12 @@ if (share) { position = Long.parseLong(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share)); } - String jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); + String jdLink = null; + try { + jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); + } catch (Exception e) { + e.printStackTrace(); + } try { jumpLink = "/pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jdLink, "UTF-8"); } catch (Exception e) { @@ -910,7 +920,7 @@ history.setTkCode(null); history.setLink(null); history.setQuanLink(null); - history.setGoodsId(goodsId); + history.setGoodsId(goodsId+""); history.setPostPicture(goods.getPicUrl()); history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); history.setShareImg(posterLink); @@ -969,7 +979,7 @@ history.setTkCode(null); history.setLink(null); history.setQuanLink(null); - history.setGoodsId(goodsId); + history.setGoodsId(goodsId+""); history.setPostPicture(goods.getPicUrl()); history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); history.setShareImg(posterLink); -- Gitblit v1.8.0