yujian
2019-03-27 cdcbed9af813b2a02cdc01eefa24db8bec6b51a9
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java
@@ -180,4 +180,51 @@
   }
   /**
    * 是否在参与推广
    */
   /**
    * 是否在参与推广
    *
    * @param goodsId
    *            -商品ID
    * @param goodsType
    *            -TB/JD
    * @param out
    */
   @RequestMapping(value = "isGoodsExtend")
   public void isGoodsExtend(AcceptData acceptData,String goodsId, String goodsType, PrintWriter out) {
      if (StringUtil.isNullOrEmpty(goodsId)) {
         out.print(JsonUtil.loadFalseResult(1, "未参与推广"));
         return;
      }
      if (StringUtil.isNullOrEmpty(goodsType)) {
         out.print(JsonUtil.loadFalseResult(2, "缺少goodsType"));
         return;
      }
      if ("TB".equalsIgnoreCase(goodsType)) {
         TaoBaoGoodsBrief goods = null;
         try {
            goods = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(goodsId));
         } catch (NumberFormatException e) {
            e.printStackTrace();
         } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
         }
         JSONObject data = new JSONObject();
         if (goods == null) {
            data.put("extend", false);
            data.put("url", "https://h5.m.taobao.com/awp/core/detail.htm?id=" + goodsId);
         } else {
            data.put("extend", true);
         }
         out.print(JsonUtil.loadTrueResult(data));
      } else {
         out.print(JsonUtil.loadFalseResult(3, "暂不支持其他商品类型"));
      }
   }
}