| | |
| | | }
|
| | |
|
| | | private static List<DaTaoKeDetail> parseCurrent(String url) {
|
| | | |
| | | List<DaTaoKeDetail> list=new ArrayList<>();
|
| | | try {
|
| | | Document doc = Jsoup.connect(url)
|
| | | .userAgent(
|
| | |
| | | .getElementsByTag("b").get(0).text();
|
| | |
|
| | | System.out.println(id + "-" + currentSale);
|
| | | DaTaoKeDetail detail=new DaTaoKeDetail();
|
| | | detail.setId(id);
|
| | | detail.setSalesNum(Integer.parseInt(currentSale));
|
| | | list.add(detail);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // TODO 需要返回值
|
| | | return null;
|
| | | return list;
|
| | | }
|
| | |
|
| | | // 获取实时榜单
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public static List<DaTaoKeDetail> getCurrentSalesRank(Long cid) {
|
| | | public static List<DaTaoKeDetail> getCurrentSalesRank(Integer cid) {
|
| | | String url = null;
|
| | | if (cid == null)
|
| | | url = "http://www.dataoke.com/top_sell";
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public static List<DaTaoKeDetail> getCurrentDaySalesRank(Long cid) {
|
| | | public static List<DaTaoKeDetail> getCurrentDaySalesRank(Integer cid) {
|
| | | String url = null;
|
| | | if (cid == null)
|
| | | url = "http://www.dataoke.com/top_all";
|
| | |
| | | return desc;
|
| | | }
|
| | |
|
| | | |
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
|
| | | if (detail != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | goods.setCouponAmount(detail.getQuanPrice());
|
| | | if (new BigDecimal(detail.getQuanCondition()).compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", detail.getQuanCondition(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", detail.getQuanPrice()));
|
| | | }
|
| | | return goods;
|
| | | }
|
| | | |
| | | }
|