From 8222e8b237c5dfb0affcdc03335bfadc06403bf8 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 19 七月 2019 15:49:39 +0800 Subject: [PATCH] 奖励券使用优化类型 --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java index 38cc76b..ae795c3 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java @@ -62,7 +62,16 @@ @Cacheable(value = "commonContentCache", key = "'tljBuy-listByDay'+#day") @Override public List<TLJBuyGoods> listByDay(String day) { - return listByDay(day, 10); + 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; + } } @Override @@ -70,19 +79,8 @@ 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); -- Gitblit v1.8.0