2026-07-01 6b5f7c66fc40d7f6099d561e31a34fbd50dd20d3
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package cn.iocoder.yudao.module.mes.service.wm.itemreceipt;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.MesWmItemReceiptPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.MesWmItemReceiptSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt.MesWmItemReceiptDO;
import jakarta.validation.Valid;
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
/**
 * MES 采购入库单 Service 接口
 */
public interface MesWmItemReceiptService {
 
    /**
     * 创建采购入库单
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createItemReceipt(@Valid MesWmItemReceiptSaveReqVO createReqVO);
 
    /**
     * 修改采购入库单
     *
     * @param updateReqVO 修改信息
     */
    void updateItemReceipt(@Valid MesWmItemReceiptSaveReqVO updateReqVO);
 
    /**
     * 删除采购入库单(级联删除行+明细)
     *
     * @param id 编号
     */
    void deleteItemReceipt(Long id);
 
    /**
     * 获得采购入库单
     *
     * @param id 编号
     * @return 采购入库单
     */
    MesWmItemReceiptDO getItemReceipt(Long id);
 
    /**
     * 获得采购入库单分页
     *
     * @param pageReqVO 分页参数
     * @return 采购入库单分页
     */
    PageResult<MesWmItemReceiptDO> getItemReceiptPage(MesWmItemReceiptPageReqVO pageReqVO);
 
    /**
     * 提交采购入库单(草稿 → 待上架)
     *
     * @param id 编号
     */
    void submitItemReceipt(Long id);
 
    /**
     * 执行上架(待上架 → 待入库)
     *
     * @param id 编号
     */
    void stockItemReceipt(Long id);
 
    /**
     * 执行入库(待入库 → 已完成),更新库存台账
     *
     * @param id 编号
     */
    void finishItemReceipt(Long id);
 
    /**
     * 取消采购入库单(任意非已完成/已取消状态 → 已取消)
     *
     * @param id 编号
     */
    void cancelItemReceipt(Long id);
 
    /**
     * 校验采购入库单存在且处于可编辑状态(草稿或待上架)
     *
     * @param id 编号
     * @return 采购入库单
     */
    MesWmItemReceiptDO validateItemReceiptEditable(Long id);
 
    /**
     * 查询指定供应商的采购入库单数量
     *
     * @param vendorId 供应商编号
     * @return 数量
     */
    Long getItemReceiptCountByVendorId(Long vendorId);
 
    /**
     * 查询指定供应商的采购入库单列表
     *
     * @param vendorId 供应商编号
     * @return 入库单列表
     */
    List<MesWmItemReceiptDO> getItemReceiptListByVendorId(Long vendorId);
 
    /**
     * 批量获得采购入库单列表
     *
     * @param ids 编号数组
     * @return 入库单列表
     */
    List<MesWmItemReceiptDO> getItemReceiptList(Collection<Long> ids);
 
    /**
     * 批量获得采购入库单 Map
     *
     * @param ids 编号数组
     * @return 入库单 Map
     */
    default Map<Long, MesWmItemReceiptDO> getItemReceiptMap(Collection<Long> ids) {
        return convertMap(getItemReceiptList(ids), MesWmItemReceiptDO::getId);
    }
 
}