| | |
| | | * @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, "请传递正确平台参数")); |
| | |
| | | |
| | | /*-------- 拼多多商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) { |
| | | getDetialPDD(acceptData, goodsId, uid, from, out); |
| | | getDetialPDD(acceptData, Long.parseLong(goodsId), uid, from, out); |
| | | return; |
| | | } |
| | | } |
| | |
| | | * @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); // 普通接口 |
| | | } |
| | | |
| | |
| | | |
| | | String jumpLink = null; |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) { // 京东 |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架")); |
| | | return; |
| | |
| | | } |
| | | |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) { // 京东 |
| | | createPosterJD(acceptData, Long.parseLong(goodsId), goodsType, from, type, user, inviteCode, out); |
| | | createPosterJD(acceptData, goodsId, goodsType, from, type, user, inviteCode, out); |
| | | } else if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) { // 拼多多 |
| | | createPosterPDD(acceptData, goodsId, goodsType, from, type, user, inviteCode, out); |
| | | } else { |
| | |
| | | /** |
| | | * 创建京东分享海报 |
| | | */ |
| | | 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) { |