admin
2019-07-31 46c315e26e20b1e6f255185d3a18834e2601c5b2
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -16,6 +16,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
@@ -110,8 +111,8 @@
    *            商品链接
    * @param out
    */
   @RequestMapping(value = "getNewGoodsInfo", method = RequestMethod.POST)
   public void getNewGoodsInfo(AcceptData acceptData, String text, PrintWriter out) {
   @RequestMapping(value = "getRecommendInfo", method = RequestMethod.POST)
   public void getRecommendInfo(AcceptData acceptData, String text, PrintWriter out) {
      if (StringUtil.isNullOrEmpty(text)) {
         out.print(JsonUtil.loadFalseResult("值为空"));
         return;
@@ -135,6 +136,11 @@
            int end = text.indexOf("】");
            if (end > 2)
               text = text.substring(1, end);
         }
         if (NumberUtil.isNumeric(text)) {
            out.println(JsonUtil.loadFalseResult("不支持纯数字"));
            return;
         }
         LogHelper.test("根据粘贴板推荐:" + text);
@@ -195,15 +201,16 @@
      JSONObject taoBaoGoodsJSON = new JSONObject();
      taoBaoGoodsJSON.put("title", tb.getTitle());
      taoBaoGoodsJSON.put("zkPrice", tb.getZkPrice());
      taoBaoGoodsJSON.put("auctionId", tb.getAuctionId());
      taoBaoGoodsJSON.put("id", tb.getAuctionId());
      taoBaoGoodsJSON.put("goodsType", Constant.SOURCE_TYPE_TAOBAO);
      taoBaoGoodsJSON.put("url", "http://item.taobao.com/item.htm?id=" + tb.getAuctionId());
      data.put("taoBaoGoodsBrief", taoBaoGoodsJSON);
      data.put("goods", taoBaoGoodsJSON);
      if (!StringUtil.isNullOrEmpty(tb.getPictUrl())) {
         if (tb.getImgList() == null)
            tb.setImgList(new ArrayList<>());
         tb.getImgList().add(0, TbImgUtil.getTBSize220Img(tb.getPictUrl()));
      }
      data.put("tbImgs", tb.getImgList());
      data.put("imgs", tb.getImgList());
      JSONObject root = new JSONObject();
      root.put("type", 1);
      root.put("data", data);
@@ -591,8 +598,7 @@
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                  .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            for (JDGoods goods : goodsList) {
               GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, null, fanLiRate,
                     shareRate);
               GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate);
               array.add(gson.toJson(goodsDetailVO));
            }
         }
@@ -604,7 +610,7 @@
   }
   /**
    * 京东
    * 拼多多
    * 
    * @param kw
    * @param page
@@ -668,8 +674,7 @@
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            for (PDDGoodsDetail goods : goodsList) {
               GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, null, fanLiRate,
                     shareRate);
               GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate);
               array.add(gson.toJson(goodsDetailVO));
            }
         }