| | |
| | | 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;
|
| | |
| | | public class HotSellControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | |
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 获取动态列表
|
| | |
| | | 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)
|
| | |
| | |
|
| | | 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)
|
| | |
| | | list.add(detailVO);
|
| | | }
|
| | | }
|
| | | |
| | | LogHelper.test("最终商品数据:" + list.size());
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", detailList.size());
|