每日上新 折扣
This commit is contained in:
@@ -65,15 +65,6 @@ public class HomePageService {
|
|||||||
* 销量榜
|
* 销量榜
|
||||||
*/
|
*/
|
||||||
List<HomeVO> homeVOs = productSkuMapper.selectSale();
|
List<HomeVO> homeVOs = productSkuMapper.selectSale();
|
||||||
for (HomeVO o : homeVOs) {
|
|
||||||
BigDecimal originPrice = o.getOriginPrice();
|
|
||||||
if (originPrice.compareTo(BigDecimal.ZERO) != 0) {
|
|
||||||
o.setDiscount(BigDecimalUtils.getDiscount(o.getOriginPrice(),o.getSalePrice()));
|
|
||||||
} else {
|
|
||||||
o.setDiscount(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HotRankingVO hotRankingVO = new HotRankingVO();
|
HotRankingVO hotRankingVO = new HotRankingVO();
|
||||||
hotRankingVO.setHotList(homeVOs);
|
hotRankingVO.setHotList(homeVOs);
|
||||||
homeUpVO.setSalesList(hotRankingVO);
|
homeUpVO.setSalesList(hotRankingVO);
|
||||||
@@ -81,6 +72,14 @@ public class HomePageService {
|
|||||||
*每日榜
|
*每日榜
|
||||||
*/
|
*/
|
||||||
List<HomeVO> homeVODay = productSkuMapper.selectDay();
|
List<HomeVO> homeVODay = productSkuMapper.selectDay();
|
||||||
|
for (HomeVO o : homeVODay) {
|
||||||
|
BigDecimal originPrice = o.getOriginPrice();
|
||||||
|
if (originPrice.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
o.setDiscount(BigDecimalUtils.getDiscount(o.getOriginPrice(),o.getSalePrice()));
|
||||||
|
} else {
|
||||||
|
o.setDiscount(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
||||||
todayRankingVO.setTodayList(homeVODay);
|
todayRankingVO.setTodayList(homeVODay);
|
||||||
homeUpVO.setTodayList(todayRankingVO);
|
homeUpVO.setTodayList(todayRankingVO);
|
||||||
|
|||||||
Reference in New Issue
Block a user