| | |
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Cacheable(value = "pddSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
|
| | | public List<PDDGoodsDetail> specialSearch(Integer page, Long cid) throws PDDOrderException {
|
| | | if (cid == null) {
|
| | |
| | | if (cid == 1) {
|
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result == null) {
|
| | | return null;
|
| | | } else {
|
| | |
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | pddfilter.setOptId(Long.parseLong(pddcid));
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result == null) {
|
| | | return null;
|
| | | } else {
|
| | |
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(10);
|
| | | pddfilter.setOptId(Long.parseLong(arrayId[i]));
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null) {
|
| | | List<PDDGoodsDetail> listGoods = result.getGoodsList();
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | |
| | | @Override
|
| | | @Cacheable(value = "pddSpecialCache", key = "'getTopGoodsList-' + #page + '-' + #sortType")
|
| | | public PDDGoodsResult getTopGoodsList(int page, Integer sortType) {
|
| | | return PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE, sortType);
|
| | | PDDGoodsResult pddResult = PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE,
|
| | | sortType);
|
| | | if (pddResult != null && pddResult.getGoodsList() != null)
|
| | | Collections.shuffle(pddResult.getGoodsList());
|
| | | return pddResult;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "pddSpecialCache", key = "'getTodaySaleGoodsList-'")
|
| | | public PDDGoodsResult getTodaySaleGoodsList() {
|
| | | return PinDuoDuoUtil.getTodaySaleGoods();
|
| | | } |
| | | }
|
| | | }
|