销售统计增加分类区分
This commit is contained in:
@@ -40,6 +40,13 @@ public class ShopProdStatistic implements Serializable {
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Long prodId;
|
||||
|
||||
/**
|
||||
* 分类 ID
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.czg.order.param;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -14,6 +15,7 @@ import java.time.LocalDate;
|
||||
* @since 2025-03-07 16:23
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SaleSummaryCountParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -24,6 +26,11 @@ public class SaleSummaryCountParam implements Serializable {
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 分类 Id
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 开始时间 格式:yyyy-MM-dd
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.czg.order.service;
|
||||
|
||||
import com.czg.order.entity.ShopProdStatistic;
|
||||
import com.czg.order.param.SaleSummaryCountParam;
|
||||
import com.czg.order.vo.SaleSummaryCountVo;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
@@ -20,13 +21,12 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
|
||||
*
|
||||
* @return 商品数据
|
||||
*/
|
||||
SaleSummaryCountVo summaryCount(Long shopId, String productName, String rangeType, LocalDate start, LocalDate end);
|
||||
SaleSummaryCountVo summaryCount(SaleSummaryCountParam param);
|
||||
|
||||
/**
|
||||
* 获取某一段时间的商品交易数据
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param rangeType 时间范围类型
|
||||
* shopId 店铺id
|
||||
* rangeType 时间范围类型
|
||||
* TODAY, // 今天
|
||||
* YESTERDAY, // 昨天
|
||||
* LAST_7_DAYS, // 最近7天
|
||||
@@ -34,11 +34,11 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
|
||||
* THIS_WEEK, // 本周
|
||||
* THIS_MONTH // 本月
|
||||
* CUSTOM // 自定义时间范围
|
||||
* @param start 开始时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* @param end 结束时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* start 开始时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* end 结束时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* @return 商品数据
|
||||
*/
|
||||
List<ShopProdStatistic> getArchiveTradeData(Long shopId, String productName, String rangeType, LocalDate start, LocalDate end);
|
||||
List<ShopProdStatistic> getArchiveTradeData(SaleSummaryCountParam param);
|
||||
List<ShopProdStatistic> getArchiveTradeDataBy10(Long shopId, Integer day);
|
||||
|
||||
//------------------------------------------------------------下列为 后台使用------------------------------------------------------------
|
||||
@@ -46,18 +46,18 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
|
||||
/**
|
||||
* 统计某天数据并插入数据库
|
||||
*/
|
||||
void statisticAndInsert(Long shopId, LocalDate day);
|
||||
void statisticAndInsert(Long shopId, LocalDate day, Long categoryId);
|
||||
|
||||
/**
|
||||
* 实时统计某天数据
|
||||
*/
|
||||
List<ShopProdStatistic> getRealTimeDataByDay(Long shopId, LocalDate day, String productName);
|
||||
List<ShopProdStatistic> getRealTimeDataByDay(Long shopId, LocalDate day, String productName, Long categoryId);
|
||||
|
||||
/**
|
||||
* 获取某一天的数据 历史数据
|
||||
* 从ShopOrderStatistic 表中查询
|
||||
*/
|
||||
List<ShopProdStatistic> getProdStatSingleDate(Long shopId, LocalDate day, String productName);
|
||||
List<ShopProdStatistic> getProdStatSingleDate(Long shopId, LocalDate day, String productName, Long categoryId);
|
||||
|
||||
/**
|
||||
* 统计 某时间段数据 总和 不包括当日实时数据
|
||||
@@ -65,5 +65,5 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
|
||||
* @param start 开始时间
|
||||
* @param end 结束时间
|
||||
*/
|
||||
List<ShopProdStatistic> getProdStatDateRange(Long shopId, LocalDate start, LocalDate end, String productName);
|
||||
List<ShopProdStatistic> getProdStatDateRange(Long shopId, LocalDate start, LocalDate end, String productName, Long categoryId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user