yujian
2019-09-03 d1dccd08a249b830a95eeeb04af25f87d5c056be
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));
               }
            }
         }
      }