展示10个

This commit is contained in:
2025-11-24 14:14:46 +08:00
parent 57d4c8f794
commit ee41fd2253
3 changed files with 4 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ public class DataSummaryController {
@SaAdminCheckPermission(value = "dataSummary:productSaleData", name = "商品销售-右下") @SaAdminCheckPermission(value = "dataSummary:productSaleData", name = "商品销售-右下")
public CzgResult<List<ShopProdStatistic>> getProductSaleData(@RequestParam Integer day) { public CzgResult<List<ShopProdStatistic>> getProductSaleData(@RequestParam Integer day) {
Long shopId = StpKit.USER.getShopId(); Long shopId = StpKit.USER.getShopId();
List<ShopProdStatistic> data = prodStatisticService.getArchiveTradeDataBy20(shopId,day); List<ShopProdStatistic> data = prodStatisticService.getArchiveTradeDataBy10(shopId,day);
return CzgResult.success(data); return CzgResult.success(data);
} }

View File

@@ -39,7 +39,7 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
* @return 商品数据 * @return 商品数据
*/ */
List<ShopProdStatistic> getArchiveTradeData(Long shopId, String productName, String rangeType, LocalDate start, LocalDate end); List<ShopProdStatistic> getArchiveTradeData(Long shopId, String productName, String rangeType, LocalDate start, LocalDate end);
List<ShopProdStatistic> getArchiveTradeDataBy20(Long shopId, Integer day); List<ShopProdStatistic> getArchiveTradeDataBy10(Long shopId, Integer day);
//------------------------------------------------------------下列为 后台使用------------------------------------------------------------ //------------------------------------------------------------下列为 后台使用------------------------------------------------------------

View File

@@ -31,7 +31,7 @@ import java.util.stream.Stream;
public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticMapper, ShopProdStatistic> implements ShopProdStatisticService { public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticMapper, ShopProdStatistic> implements ShopProdStatisticService {
@Override @Override
public List<ShopProdStatistic> getArchiveTradeDataBy20(Long shopId, Integer day) { public List<ShopProdStatistic> getArchiveTradeDataBy10(Long shopId, Integer day) {
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
LocalDate startDate = currentDate.minusDays(day - 1); LocalDate startDate = currentDate.minusDays(day - 1);
List<ShopProdStatistic> archiveTradeData = getArchiveTradeData(shopId, null, "", startDate, currentDate); List<ShopProdStatistic> archiveTradeData = getArchiveTradeData(shopId, null, "", startDate, currentDate);
@@ -43,7 +43,7 @@ public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticM
Comparator.nullsLast(BigDecimal::compareTo).reversed() Comparator.nullsLast(BigDecimal::compareTo).reversed()
) )
) )
.limit(20) .limit(10)
.toList(); .toList();
} }