From 1261c227e7ad47607ee651bbd017ea80eb6d044a Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 14 十二月 2019 18:45:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java index 4140021..cb97e00 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java @@ -29,6 +29,7 @@ import org.yeshi.utils.HttpUtil; import com.yeshi.fanli.dto.GoodsClassDTO; +import com.yeshi.fanli.dto.douyin.DouYinGoods; import com.yeshi.fanli.dto.jd.JDCommissionInfo; import com.yeshi.fanli.dto.jd.JDCouponInfo; import com.yeshi.fanli.dto.jd.JDPingouInfo; @@ -625,6 +626,35 @@ return null; } + + /** + * 閫氳繃閾炬帴id + * @param url + * @return + */ + public static String getJDGoodsIdByWeiXin(String url) { + if (StringUtil.isNullOrEmpty(url)) + return null; + + try { + String id = null; + int indexOf = url.indexOf("?"); + url = url.substring(indexOf + 1, url.length()-1); + String[] temp = url.split("&"); + for (int i =0; i < temp.length; i ++) { + String content = temp[i]; + if (content.startsWith("sku")) { + id = content.split("=")[content.split("=").length-1]; + break; + } + } + return id; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + /** * 鏌ヨ澶╃尗鍟嗗搧鍥剧墖銆佹爣棰� * -- Gitblit v1.8.0