日期范围
This commit is contained in:
@@ -31,8 +31,10 @@ import java.util.stream.Stream;
|
||||
public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticMapper, ShopProdStatistic> implements ShopProdStatisticService {
|
||||
|
||||
@Override
|
||||
public List<ShopProdStatistic> getArchiveTradeDataBy20(Long shopId, String rangeType, LocalDate start, LocalDate end) {
|
||||
List<ShopProdStatistic> archiveTradeData = getArchiveTradeData(shopId, null, rangeType, start, end);
|
||||
public List<ShopProdStatistic> getArchiveTradeDataBy20(Long shopId, Integer day) {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalDate startDate = currentDate.minusDays(day - 1);
|
||||
List<ShopProdStatistic> archiveTradeData = getArchiveTradeData(shopId, null, "", startDate, currentDate);
|
||||
// 按照 saleCount 降序排序
|
||||
return archiveTradeData.stream()
|
||||
.sorted(
|
||||
@@ -110,7 +112,7 @@ public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticM
|
||||
realTimeData = realTimeData.stream()
|
||||
.filter(ShopProdStatistic::isValid)
|
||||
.toList();
|
||||
if(CollUtil.isNotEmpty(realTimeData)) {
|
||||
if (CollUtil.isNotEmpty(realTimeData)) {
|
||||
boolean exists = exists(QueryWrapper.create().eq(ShopProdStatistic::getShopId, shopId).eq(ShopProdStatistic::getCreateDay, day));
|
||||
if (exists) {
|
||||
remove(QueryWrapper.create().eq(ShopProdStatistic::getShopId, shopId).eq(ShopProdStatistic::getCreateDay, day));
|
||||
|
||||
Reference in New Issue
Block a user