liyong
9 天以前 88e384da863bb2f7324cb1e1474885df3b7cce91
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package cn.iocoder.yudao.module.erp.api.sale;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.erp.api.sale.dto.ErpSaleOrderCreateReqDTO;
import cn.iocoder.yudao.module.erp.api.sale.dto.ErpSaleOrderItemRespDTO;
import cn.iocoder.yudao.module.erp.api.sale.dto.ErpSaleOrderRespDTO;
 
import java.math.BigDecimal;
import java.util.List;
 
/**
 * ERP 销售订单 API 接口
 *
 * @author 芋道源码
 */
public interface ErpSaleOrderApi {
 
    String PREFIX = "/rpc-api/erp/sale-order";
 
    /**
     * 创建销售订单
     *
     * @param createReqDTO 创建信息
     * @return 订单编号
     */
    CommonResult<Long> createSaleOrder(ErpSaleOrderCreateReqDTO createReqDTO);
 
    /**
     * 获取销售订单
     *
     * @param id 订单编号
     * @return 销售订单
     */
    CommonResult<ErpSaleOrderRespDTO> getSaleOrder(Long id);
 
    /**
     * 根据合同编号获取销售订单
     *
     * @param contractId 合同编号
     * @return 销售订单
     */
    CommonResult<ErpSaleOrderRespDTO> getSaleOrderByContractId(Long contractId);
 
    /**
     * 获取销售订单明细列表
     *
     * @param orderId 订单编号
     * @return 明细列表
     */
    CommonResult<List<ErpSaleOrderItemRespDTO>> getSaleOrderItemList(Long orderId);
 
    /**
     * 获取销售订单明细
     *
     * @param id 明细编号
     * @return 明细
     */
    CommonResult<ErpSaleOrderItemRespDTO> getSaleOrderItem(Long id);
 
    /**
     * 更新销售订单明细的出库数量
     *
     * @param orderItemId 明细编号
     * @param outCount    出库数量增量
     */
    CommonResult<Boolean> updateOrderItemOutCount(Long orderItemId, BigDecimal outCount);
 
    /**
     * 更新销售订单的出库状态
     *
     * 根据明细出库数量自动计算订单状态:
     * - 所有明细都完成出库 → 完成状态
     * - 部分明细完成出库 → 部分出库状态
     *
     * @param orderId 订单编号
     */
    CommonResult<Boolean> updateOrderOutStatus(Long orderId);
 
}