| | |
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.common.CommonContentNav;
|
| | | import com.yeshi.fanli.dto.common.CommonContentResult;
|
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
|
| | |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoHongBaoInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class CommonTemplateContentServiceImpl implements CommonTemplateContentService {
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaobaoMeterialService taobaoMeterialService;
|
| | |
| | | } else if (type == CommonContentTypeEnum.haoQuan) {
|
| | | result = getHaoQuanContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.mianDan) {
|
| | | result = getHaoQuanContent(cid, page, pageSize);
|
| | | result = getMianDanContent(page, pageSize);
|
| | | }
|
| | |
|
| | | if (result != null) {// 商品信息过滤
|
| | |
| | |
|
| | | DaTaoKeGoodsResult result = null;
|
| | | if ("-1".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(
|
| | | daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | |
|
| | | } else if ("0".equalsIgnoreCase(cid)) {
|
| | | result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", null, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_CREATETIME);
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(null, new BigDecimal("10"), "createTime",
|
| | | page, pageSize));
|
| | | result.setTotalCount(daTaoKeGoodsDetailV2Service.countByMaxPrice(null, new BigDecimal("10")));
|
| | | }
|
| | | } else {
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(Integer.parseInt(cid));
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, new BigDecimal("10"), page, pageSize,
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, new BigDecimal("10"), null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | if (result == null || result.getGoodsList() == null || result.getGoodsList().size() == 0) {
|
| | | result = new DaTaoKeGoodsResult();
|
| | | result.setGoodsList(daTaoKeGoodsDetailV2Service.listByMaxPrice(Integer.parseInt(cid),
|
| | | new BigDecimal("10"), null, page, pageSize));
|
| | | result.setTotalCount(
|
| | | daTaoKeGoodsDetailV2Service.countByMaxPrice(Integer.parseInt(cid), new BigDecimal("10")));
|
| | | }
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(4);// 居家生活
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(6);// 美食
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | if ("1".equalsIgnoreCase(cid)) {// 大淘客数据
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(2);// 母婴
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize,
|
| | | DaTaoKeApiUtil.SORT_DEFAULT);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(1);// 女装
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("内衣 女", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | |
| | | cidList.add(7);
|
| | | cidList.add(13);
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | result = DaTaoKeApiUtil.getGoodsList("", cidList, null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | for (TaoBaoGoodsBrief goods : listTaoKeGoods)
|
| | | goodsMap.put(goods.getAuctionId(), goods);
|
| | | if (listTaoKeGoods != null)
|
| | | for (TaoBaoGoodsBrief goods : listTaoKeGoods)
|
| | | goodsMap.put(goods.getAuctionId(), goods);
|
| | | for (int i = 0; i < goodsList.size(); i++) {
|
| | | if (goodsMap.get(goodsList.get(i).getAuctionId()) == null) {
|
| | | goodsList.remove(i--);
|