From 81082e03207761edff6b317df8268dc3f968c20a Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期日, 05 五月 2019 12:35:29 +0800 Subject: [PATCH] 淘宝后台搜索增加分类ID填写 --- fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 42 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java index 63ca51b..2ff7f31 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java @@ -31,6 +31,7 @@ import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.ThreadUtil; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import com.yeshi.fanli.util.taobao.TaoKeApiUtil; @@ -97,7 +98,7 @@ out.print(JsonUtil.loadFalseResult("搴楅摵id涓虹┖")); return; } - taoBaoShopHistoryService.addHistory(sid, uid, acceptData.getDevice()); + out.print(JsonUtil.loadTrueResult("璁板綍鎴愬姛")); } catch (Exception e) { out.print(JsonUtil.loadFalseResult("璁板綍澶辫触")); @@ -164,6 +165,22 @@ for (TaoBaoShopHistory history : listHistory) { TaoBaoShop taoBaoShop = history.getTaoBaoShop(); if (taoBaoShop != null) { + + String shopLink = taoBaoShop.getShopLink(); + if (StringUtil.isNullOrEmpty(shopLink)) { + taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId())); + } + + String shopNameCustom = taoBaoShop.getShopNameCustom(); + if (!StringUtil.isNullOrEmpty(shopNameCustom)) { + taoBaoShop.setShopName(shopNameCustom); + } + + String shopIconCustom = taoBaoShop.getShopIconCustom(); + if (!StringUtil.isNullOrEmpty(shopIconCustom)) { + taoBaoShop.setShopIcon(shopIconCustom); + } + list.add(taoBaoShop); } } @@ -207,7 +224,7 @@ * @param out */ @RequestMapping(value = "getShopInfo", method = RequestMethod.POST) - public void getShopInfo(AcceptData acceptData, Integer page, Long sid, PrintWriter out) { + public void getShopInfo(AcceptData acceptData, Integer page, Long sid, Long uid, PrintWriter out) { try { JSONObject data = new JSONObject(); if (page == 1) { @@ -215,8 +232,30 @@ if (taoBaoShop == null) { out.print(JsonUtil.loadFalseResult("搴楅摵淇℃伅鑾峰彇澶辫触")); } - taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId())); + String shopLink = taoBaoShop.getShopLink(); + if (StringUtil.isNullOrEmpty(shopLink)) { + taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId())); + } + + String shopNameCustom = taoBaoShop.getShopNameCustom(); + if (!StringUtil.isNullOrEmpty(shopNameCustom)) { + taoBaoShop.setShopName(shopNameCustom); + } + + String shopIconCustom = taoBaoShop.getShopIconCustom(); + if (!StringUtil.isNullOrEmpty(shopIconCustom)) { + taoBaoShop.setShopIcon(shopIconCustom); + } data.put("shop", taoBaoShop); + + + ThreadUtil.run(new Runnable() { + public void run() { + // 娣诲姞瓒宠抗 + taoBaoShopHistoryService.addHistory(sid, uid, acceptData.getDevice()); + } + }); + } int pageSize = Constant.PAGE_SIZE; -- Gitblit v1.8.0