yujian
2020-06-09 554de444b87aab5f93cb1593a8095612cf9479a7
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HotSellControllerV2.java
@@ -12,14 +12,19 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
@@ -37,7 +42,7 @@
public class HotSellControllerV2 {
   @Resource
   private HongBaoManageService hongBaoManageService;
   private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
   @Resource
   private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
@@ -48,6 +53,8 @@
   @Resource
   private DaTaoKeGoodsService daTaoKeGoodsService;
   
   /**
    * 获取动态列表
@@ -67,13 +74,20 @@
         if (subId != null && subId == 0)
            subId = null;
         List<DaTaoKeDetail> detailList = null;
         List<DaTaoKeDetailV2> detailList = null;
         if (cid == 1) {
            detailList = daTaoKeGoodsService.getCurrentHotSalesRankGoodsList();
            DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_HOT, null);
            if (result != null)
               detailList = result.getGoodsList();
         } else if (cid == 2) {
            detailList = daTaoKeGoodsService.getCurrentSalesRankGoodsList(subId);
            DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_TIME, subId);
            if (result != null)
               detailList = result.getGoodsList();
         } else {
            detailList = daTaoKeGoodsService.getCurrentDaySalesRankGoodsList(subId);
            DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_DAY, subId);
            if (result != null)
               detailList = result.getGoodsList();
         }
         if (detailList == null)
@@ -83,12 +97,12 @@
         List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
         if (detailList != null) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
             ConfigParamsDTO paramsDTO =  orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            for (DaTaoKeDetail detail : detailList) {
            for (DaTaoKeDetailV2 detail : detailList) {
               TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(detail);
               GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
               GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
               if (cid == 2)
                  detailVO.setSalesType(2);
               else if (cid == 3)
@@ -98,7 +112,6 @@
               list.add(detailVO);
            }
         }
         LogHelper.test("最终商品数据:" + list.size());
         JSONObject data = new JSONObject();
         data.put("count", detailList.size());