| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.jd.JDGoodsException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Cacheable(value = "jdSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public List<JDGoods> specialSearch(Integer page, Long cid) throws JDGoodsException {
|
| | | if (cid == null) {
|
| | | throw new JDGoodsException(1, "分类id为空");
|
| | |
| | |
|
| | | private List<JDGoods> search(int page, int pageSize, String jdcid) {
|
| | | JDSearchResult result = null;
|
| | | String way = configService.get("jd_api_search_key");
|
| | | String way = configService.get(ConfigKeyEnum.jdApiSearchKey.getKey());
|
| | | if ("1".equals(way)) { // API搜索
|
| | | JDFilter filterAPI = new JDFilter();
|
| | | filterAPI.setPageIndex(page);
|
| | |
| | | @Override
|
| | | public JDSearchResult getIndexJDGoods(int page) {
|
| | | JDSearchResult result = null;
|
| | | String way = configService.get("jd_api_search_key");
|
| | | String way = configService.get(ConfigKeyEnum.jdApiSearchKey.getKey());
|
| | | // TODO 需要调整规则
|
| | | way = "0";
|
| | | if ("1".equals(way)) {
|
| | | JDFilter filterAPI = new JDFilter();
|
| | | filterAPI.setPageIndex(page);
|
| | |
| | | JDSearchFilter jdfilter = new JDSearchFilter();
|
| | | jdfilter.setPageNo(page);
|
| | | jdfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | result = JDUtil.searchByKey(jdfilter);
|
| | | result =JDApiUtil.getJingFenGoods(page,125); //JDUtil.searchByKey(jdfilter);
|
| | | }
|
| | | if (result != null && result.getGoodsList() != null)
|
| | | Collections.shuffle(result.getGoodsList());
|