| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | | public class ShareHotGoodsController {
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private ShareHotGoodsService shareHotGoodsService;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listPreGoods", method = RequestMethod.GET)
|
| | | public void listPreGoods(String callback, AcceptData acceptData, String kw, PrintWriter out) {
|
| | | public void listPreGoods(String callback, AcceptData acceptData, String kw, Integer page, PrintWriter out) {
|
| | | // 大淘客数据,更新
|
| | | List<TaoBaoGoodsBrief> list = shareHotGoodsService.listPreGoods();
|
| | | List<TaoBaoGoodsBrief> list = shareHotGoodsService.listPreGoods(page);
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = new Gson();
|
| | | for (TaoBaoGoodsBrief goods : list) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, "100", null)));
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | |
| | | |
| | |
|
| | |
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (goods != null && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {
|
| | |
|
| | | if (TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate())
|
| | | .compareTo(new BigDecimal("734")) >= 0) {
|
| | | if (TaoBaoUtil.canAddToTLJBuyGoods(goods)) {
|
| | | count++;
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods).getGoods();
|
| | | shareHotGoodsService.addShareHotGoods(new ShareHotGoods(null, day, new Date(), goods));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | // 最多30个商品
|
| | | List<ShareHotGoods> listGoods = shareHotGoodsService.listByDay(day, 30);
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate();
|
| | | JSONArray array = new JSONArray();
|
| | | for (ShareHotGoods sh : listGoods) {
|
| | | TaoBaoGoodsBriefExtra item = TaoBaoUtil.getTaoBaoGoodsBriefExtra(sh.getGoods(), rate + "", null);
|
| | | TaoBaoGoodsBriefExtra item = TaoBaoUtil.getTaoBaoGoodsBriefExtra(sh.getGoods(), 100 + "", null);
|
| | | if (!StringUtil.isNullOrEmpty(item.getPictUrlWhite()))
|
| | | item.setPictUrl(item.getPictUrlWhite());
|
| | | item.setAuctionUrl(sh.getId());
|
| | | array.add(item);
|
| | | }
|