From d1dccd08a249b830a95eeeb04af25f87d5c056be Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 03 九月 2019 11:13:04 +0800 Subject: [PATCH] 金币明细bug --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java index d3eb9d0..465af3a 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java @@ -35,7 +35,6 @@ import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult; import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail; -import com.yeshi.fanli.exception.integral.IntegralGetException; import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; import com.yeshi.fanli.exception.user.TokenRecordException; import com.yeshi.fanli.log.LogHelper; @@ -446,12 +445,8 @@ ThreadUtil.run(new Runnable() { @Override public void run() { - try { - // 澧炲姞閲戝竵 - integralGetService.addSearchResultScan(uid, key); - } catch (IntegralGetException e) { - e.printStackTrace(); - } + // 澧炲姞閲戝竵 + integralGetService.addSearchResultScan(uid, key); } }); } @@ -628,6 +623,7 @@ private void searchJDGoods(String key, Integer page, String filter, Integer order, PrintWriter out) { JDSearchResult result = null; + boolean hasCoupon = false; String way = configService.get("jd_api_search_key"); if ("1".equals(way)) { JDFilter filterAPI = new JDFilter(); @@ -663,6 +659,7 @@ JSONObject jsonfilter = JSONObject.fromObject(filter); Boolean coupon = jsonfilter.optBoolean("coupon"); if (coupon != null && coupon) { + hasCoupon = true; filterAPI.setIsCoupon(1); // 鏈夊埜 } @@ -718,6 +715,7 @@ JSONObject jsonfilter = JSONObject.fromObject(filter); Boolean coupon = jsonfilter.optBoolean("coupon"); if (coupon != null && coupon) { + hasCoupon = true; jdfilter.setHasCoupon(1); // 鏈夊埜 } @@ -770,7 +768,13 @@ .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); for (JDGoods goods : goodsList) { GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate); - array.add(gson.toJson(goodsDetailVO)); + if (hasCoupon) { + if (goodsDetailVO.isHasCoupon()) { + array.add(gson.toJson(goodsDetailVO)); + } + } else { + array.add(gson.toJson(goodsDetailVO)); + } } } } -- Gitblit v1.8.0