From 48a204f4c90a80c0bb4e5ba1f9f0f42939cadba8 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 01 一月 2020 10:19:34 +0800 Subject: [PATCH] 用户资金记录bug修改,京东,拼多多小程序商品转链 --- fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java index 540be68..30d3735 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java @@ -26,6 +26,7 @@ import com.yeshi.fanli.dto.jd.JDPingouInfo; import com.yeshi.fanli.dto.jd.JDSearchResult; import com.yeshi.fanli.dto.jd.JDShopInfo; +import com.yeshi.fanli.entity.bus.clazz.GoodsClass; import com.yeshi.fanli.entity.jd.JDGoods; import com.yeshi.fanli.entity.jd.JDOrder; import com.yeshi.fanli.entity.jd.JDOrderItem; @@ -154,8 +155,8 @@ if (!StringUtil.isNullOrEmpty(subUnionId)) json.put("subUnionId", subUnionId); - - //1锛氶暱閾撅紝 2 锛氱煭閾� 锛�3锛� 闀块摼+鐭摼 + + // 1锛氶暱閾撅紝 2 锛氱煭閾� 锛�3锛� 闀块摼+鐭摼 json.put("chainType", 3); JSONObject root = new JSONObject(); root.put("promotionCodeReq", json); @@ -172,7 +173,6 @@ resultJson = JSONObject.fromObject(result); return resultJson.optJSONObject("data").optString("shortURL"); } - public static JDGoods queryGoodsDetail(Long skuId) { List<Long> skuIdList = new ArrayList<>(); @@ -580,12 +580,12 @@ return searchResult; } - public static JDSearchResult getGoodsClass() { + public static List<GoodsClass> getGoodsClass(int parentId, int grade) { JDSearchResult searchResult = new JDSearchResult(); - List<JDGoods> list = new ArrayList<>(); + List<GoodsClass> list = new ArrayList<>(); JSONObject json = new JSONObject(); - json.put("parentId", 0); - json.put("grade", 0); + json.put("parentId", parentId); + json.put("grade", grade); JSONObject jsonDTO = new JSONObject(); jsonDTO.put("req", json); @@ -593,7 +593,7 @@ String result = baseRequest2("jd.union.open.category.goods.get", null, jsonDTO); System.out.println(result); JSONObject resultJson = JSONObject.fromObject(result); - resultJson = resultJson.optJSONObject("jd_union_open_goods_jingfen_query_response"); + resultJson = resultJson.optJSONObject("jd_union_open_category_goods_get_response"); if (resultJson.optInt("code") == 0) { result = resultJson.optString("result"); resultJson = JSONObject.fromObject(result); @@ -602,9 +602,11 @@ JSONArray array = resultJson.optJSONArray("data"); if (array != null) { for (int i = 0; i < array.size(); i++) { - JDGoods goods = parseJDGoods(array.optJSONObject(i)); - if (goods != null) - list.add(goods); + GoodsClass gc = new GoodsClass(); + JSONObject item = array.optJSONObject(i); + gc.setName(item.optString("name")); + gc.setId(item.optLong("id")); + list.add(gc); } } } @@ -612,11 +614,9 @@ long totalCount = resultJson.optLong("totalCount"); PageEntity pageEntity = new PageEntity(); pageEntity.setTotalCount(totalCount); - searchResult.setPageEntity(pageEntity); } - searchResult.setGoodsList(list); - return searchResult; + return list; } public static JDGoods getGoodsDetail(Long skuId) { -- Gitblit v1.8.0