admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java
@@ -268,7 +268,7 @@
     * @param out
     */
    @RequestMapping(value = "getGoodsDetial")
    public void getGoodsDetial(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Long uid,
    public void getGoodsDetial(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Long uid,
                               PrintWriter out) {
        if (goodsType == null || goodsType < 2 || goodsType > 3) {
            out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
@@ -283,7 +283,7 @@
        /*-------- 拼多多商品  -------*/
        if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
            getDetialPDD(acceptData, goodsId, uid, from, out);
            getDetialPDD(acceptData, Long.parseLong(goodsId), uid, from, out);
            return;
        }
    }
@@ -297,10 +297,10 @@
     * @param from
     * @param out
     */
    private void getDetialJD(WXMPAcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
    private void getDetialJD(WXMPAcceptData acceptData, String id, Long uid, String from, PrintWriter out) {
        JDGoods jdGoods = JDApiUtil.queryGoodsDetail(id); // 高级接口
        if (jdGoods == null) {
            jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页
//            jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页
            // jdGoods = JDApiUtil.getGoodsDetail(id); // 普通接口
        }
@@ -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);
        }
@@ -727,7 +732,7 @@
     * @param out
     */
    @RequestMapping(value = "getBuyLink", method = RequestMethod.POST)
    public void getBuyLink(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, String couponUrl,
    public void getBuyLink(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, String couponUrl,
                           Long uid, String inviteCode, PrintWriter out) {
        if (goodsId == null || goodsType == null) {
            out.print(JsonUtil.loadFalseResult(1, "商品信息传递错误"));
@@ -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) {
@@ -823,7 +833,7 @@
     * @param out
     */
    @RequestMapping(value = "sharePoster", method = RequestMethod.POST)
    public void sharePoster(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type,
    public void sharePoster(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type,
                            Long uid, PrintWriter out) {
        if (uid == null || uid < 1) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
@@ -864,7 +874,7 @@
    /**
     * 创建京东分享海报
     */
    private void createPosterJD(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type,
    private void createPosterJD(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type,
                                UserInfo user, String inviteCode, PrintWriter out) {
        JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
        if (jdGoods == null) {
@@ -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);
@@ -922,7 +932,7 @@
    /**
     * 创建拼多多分享海报
     */
    private void createPosterPDD(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type,
    private void createPosterPDD(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type,
                                 UserInfo user, String inviteCode, PrintWriter out) {
        PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
        if (pddGoods == null) {
@@ -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);