| | |
| | |
|
| | | public static String convertLinkWithSubUnionId(String materialId, String couponUrl, String positionId,
|
| | | String subUnionId) {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | | String log = "京东转链出错:";
|
| | | try {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(subUnionId))
|
| | | json.put("subUnionId", subUnionId);
|
| | | if (!StringUtil.isNullOrEmpty(subUnionId))
|
| | | json.put("subUnionId", subUnionId);
|
| | |
|
| | | // 1:长链, 2 :短链 ,3: 长链+短链
|
| | | json.put("chainType", 3);
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | | // 1:长链, 2 :短链 ,3: 长链+短链
|
| | | json.put("chainType", 3);
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | |
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | |
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_bysubunionid_get_response").optString("result");
|
| | | System.out.println(result);
|
| | | if (result == null) {
|
| | | return null;
|
| | | log += json.toString() + "####" + result;
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_bysubunionid_get_response").optString("result");
|
| | | System.out.println(result);
|
| | | if (result == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | resultJson = JSONObject.fromObject(result);
|
| | | return resultJson.optJSONObject("data").optString("shortURL");
|
| | | } catch (Exception e) {
|
| | | LogHelper.error(log);
|
| | | }
|
| | |
|
| | | resultJson = JSONObject.fromObject(result);
|
| | | return resultJson.optJSONObject("data").optString("shortURL");
|
| | | return null;
|
| | | }
|
| | |
|
| | | public static JDGoods queryGoodsDetail(Long skuId) {
|