| | |
| | | @Cacheable(value = "commonContentCache", key = "'tljBuy-listByDay'+#day")
|
| | | @Override
|
| | | public List<TLJBuyGoods> listByDay(String day) {
|
| | | List<TLJBuyGoods> list = listByDay(day, 30);
|
| | | if (list.size() <= 10)
|
| | | return list;
|
| | | else {
|
| | | List<TLJBuyGoods> newList = new ArrayList<>();
|
| | | for (int i = 0; i < 10; i++) {
|
| | | newList.add(list.get(i));
|
| | | }
|
| | | return newList;
|
| | | }
|
| | | List<TLJBuyGoods> list = listByDay(day, 10);
|
| | | // if (list.size() <= 10)
|
| | | // return list;
|
| | | // else {
|
| | | // List<TLJBuyGoods> newList = new ArrayList<>();
|
| | | // for (int i = 0; i < 10; i++) {
|
| | | // newList.add(list.get(i));
|
| | | // }
|
| | | // return newList;
|
| | | // }
|
| | | return list;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | List<TLJBuyGoods> list = tljBuyGoodsDao.listByDayOrderByUpdateTime(day, 1, count);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (TLJBuyGoods shg : list) {
|
| | | // 计算推广红包
|
| | | BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(shg.getGoods(),
|
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
|
| | | BigDecimal finalPrice = TaoBaoUtil.getAfterUseCouplePrice(shg.getGoods());
|
| | |
|
| | | // 推广红包 不能小于1,价格不能大于30
|
| | | if (spreadMoney.compareTo(new BigDecimal(1.0)) < 0 || finalPrice.compareTo(new BigDecimal(30)) >= 0) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | for (TLJBuyGoods shg : list)
|
| | | goodsList.add(shg.getGoods());
|
| | | }
|
| | | }
|
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|