| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TaoBaoAuthUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | | import com.yeshi.fanli.entity.bus.search.HotSearch;
|
| | | import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | | import com.yeshi.fanli.service.inter.config.HotSearchService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | |
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private SuperHotSearchService superHotSearchSerivce;
|
| | |
|
| | | private HotSearchService hotSearchService;
|
| | | |
| | | @Resource
|
| | | private HistorySearchService historySearchService;
|
| | | private HistorySearchService historySearchService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | |
| | | /**
|
| | | * 热门搜索
|
| | | * @param acceptData
|
| | | * @param goodsType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
|
| | | public void getHotSearch(AcceptData acceptData, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | public void getHotSearch(AcceptData acceptData, Integer goodsType, PrintWriter out) {
|
| | | // 默认淘宝
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | | List<SuperHotSearch> superHotSearchList = superHotSearchSerivce
|
| | | .getSuperHotSearchBySystemIdCache(system.getId());
|
| | | if (superHotSearchList == null || superHotSearchList.size() == 0) {
|
| | | |
| | | List<HotSearch> list = hotSearchService.getHotSearchCache(goodsType);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("没有数据"));
|
| | | return;
|
| | | }
|
| | | List<HotSearch> hotSearchList = new ArrayList<HotSearch>();
|
| | | for (SuperHotSearch superHotSearch : superHotSearchList) {
|
| | | HotSearch hotSearch = superHotSearch.getHotSearch();
|
| | | if (hotSearch != null)
|
| | | hotSearchList.add(hotSearch);
|
| | | }
|
| | |
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", hotSearchList.size());
|
| | | data.put("hotSearchList", hotSearchList);
|
| | | String result = JsonUtil.loadTrueResult(data);
|
| | | out.print(result);
|
| | | return;
|
| | | data.put("count", list.size());
|
| | | data.put("hotSearchList", list);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping("specialSearch")
|
| | |
| | | // }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
|
| | | out.print(JsonUtil.loadFalseResult("无法搜索链接"));
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", new JSONArray());
|
| | | data.put("count", 0);
|
| | | data.put("nav", new JSONArray());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | listRecommendWords = new ArrayList<String>();
|
| | | }
|
| | |
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
|
| | | List<TaoBaoShopVO> listShop =taoBaoShopService.getShopByKey(kw);
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoods() != null
|
| | | && listShop.get(0).getListGoods().size() > 2) {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
|
| | |
| | | List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | |
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null,null,null, page, 20, sort);
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, null, null, page, 20, sort);
|
| | | if (result != null && result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 goods : result.getGoodsList()) {
|
| | | listExtra.add(
|