| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsTB(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | Date date = new Date();
|
| | | SearchFilter filter = new SearchFilter();
|
| | | filter.setKey(brandInfo.getName());
|
| | | filter.setKey(searchKey);
|
| | | filter.setPage(1);
|
| | | filter.setPageSize(100);
|
| | | filter.setTmall(true);
|
| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsJD(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | int count = 0;
|
| | | JDSearchResult result = null;
|
| | | String way = configService.get("jd_api_search_key");
|
| | |
| | | for (int i=0; i < 2;i ++) {
|
| | | if ("1".equals(way)) {
|
| | | JDFilter filterAPI = new JDFilter();
|
| | | filterAPI.setKeyword(SearchFilterUtil.filterSearchContent(brandInfo.getName()));
|
| | | filterAPI.setKeyword(SearchFilterUtil.filterSearchContent(searchKey));
|
| | | filterAPI.setPageIndex(1);
|
| | | filterAPI.setPageSize(30);
|
| | | filterAPI.setSort(JDFilter.SORT_DESC);
|
| | |
| | | } else {
|
| | | // 网页爬取
|
| | | JDSearchFilter jdfilter = new JDSearchFilter();
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(brandInfo.getName()));
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(searchKey));
|
| | | jdfilter.setPageNo(1);
|
| | | jdfilter.setPageSize(30);
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | |
| | | * @return
|
| | | */
|
| | | private int addBrandGoodsPDD(BrandInfo brandInfo) {
|
| | | String searchKey = brandInfo.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | searchKey = brandInfo.getName();
|
| | | |
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(brandInfo.getName());
|
| | | pddfilter.setKw(searchKey);
|
| | | pddfilter.setPage(1);
|
| | | pddfilter.setPageSize(100);
|
| | | pddfilter.setSortType(6);
|