yujian
2019-11-25 aa552facf6d833acab0d3e3e29bda2a0fb826ffe
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -30,12 +30,13 @@
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;
@@ -50,6 +51,9 @@
   @Resource
   private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
   @Resource
   private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
   @Resource
   private TaobaoMeterialService taobaoMeterialService;
@@ -212,15 +216,36 @@
      if ("-1".equalsIgnoreCase(cid)) {
         result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), 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,
               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,
               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<>();
@@ -496,7 +521,7 @@
      List<Integer> cidList = new ArrayList<>();
      cidList.add(1);// 女装
      int sort = getCommonSort(cid);
      result = DaTaoKeApiUtil.search("内衣 女", cidList, null, null, page, pageSize, sort);
      result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
      List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      long count = 0;
      if (result != null) {