1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package cn.iocoder.yudao.module.erp.service.statistics;
 
import cn.iocoder.yudao.module.erp.controller.admin.statistics.vo.sale.ErpSaleCustomerSummaryRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.statistics.vo.sale.ErpSaleProductSummaryRespVO;
 
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * ERP 销售统计 Service 接口
 *
 * @author 超级管理员
 */
public interface ErpSaleStatisticsService {
 
    /**
     * 获得销售金额
     *
     * 计算逻辑:销售出库的金额 - 销售退货的金额
     *
     * @param beginTime >= 开始时间
     * @param endTime < 结束时间
     * @return 销售金额
     */
    BigDecimal getSalePrice(LocalDateTime beginTime, LocalDateTime endTime);
 
    /**
     * 按客户统计销售款(销售额、已收款、未收款)
     *
     * 需求 6.7① 销售款统计、③ 客户销售统计
     *
     * @param customerId 客户编号,为空表示全部客户
     * @param beginTime  下单时间 >= 开始时间
     * @param endTime    下单时间 <= 结束时间
     * @return 客户维度统计列表(已填充客户名称)
     */
    List<ErpSaleCustomerSummaryRespVO> getCustomerSummary(Long customerId, LocalDateTime beginTime, LocalDateTime endTime);
 
    /**
     * 按产品统计销售量与销售额
     *
     * 需求 6.7② 产品销售统计
     *
     * @param productId 产品编号,为空表示全部产品
     * @param beginTime 下单时间 >= 开始时间
     * @param endTime   下单时间 <= 结束时间
     * @return 产品维度统计列表(已填充产品名称)
     */
    List<ErpSaleProductSummaryRespVO> getProductSummary(Long productId, LocalDateTime beginTime, LocalDateTime endTime);
 
}