xiaoyi
3 天以前 abf1c0a35d85d38239ff5d2ed746a4e4b797c9d1
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
package cn.iocoder.yudao.module.erp.service.purchase;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchasePlanDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchasePlanItemDO;
 
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
/**
 * ERP 采购计划 Service 接口
 *
 * @author xiaoyi
 */
public interface ErpPurchasePlanService {
 
    /**
     * 创建采购计划
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createPurchasePlan(ErpPurchasePlanSaveReqVO createReqVO);
 
    /**
     * 更新采购计划
     *
     * @param updateReqVO 更新信息
     */
    void updatePurchasePlan(ErpPurchasePlanSaveReqVO updateReqVO);
 
    /**
     * 删除采购计划
     *
     * @param ids 编号数组
     */
    void deletePurchasePlan(Collection<Long> ids);
 
    /**
     * 获得采购计划
     *
     * @param id 编号
     * @return 采购计划
     */
    ErpPurchasePlanDO getPurchasePlan(Long id);
 
    /**
     * 获得采购计划明细列表
     *
     * @param planId 采购计划编号
     * @return 明细列表
     */
    List<ErpPurchasePlanItemDO> getPurchasePlanItemListByPlanId(Long planId);
 
    /**
     * 按采购计划编号集合获得明细列表
     *
     * @param planIds 采购计划编号集合
     * @return 明细列表
     */
    List<ErpPurchasePlanItemDO> getPurchasePlanItemListByPlanIds(Collection<Long> planIds);
 
    /**
     * 获得采购计划分页
     *
     * @param pageReqVO 分页查询
     * @return 采购计划分页
     */
    PageResult<ErpPurchasePlanDO> getPurchasePlanPage(ErpPurchasePlanPageReqVO pageReqVO);
 
    /**
     * 提交采购计划审批
     *
     * @param id                   编号
     * @param processDefinitionKey BPM 流程定义 Key
     * @param userId               用户编号
     */
    void submitPurchasePlan(Long id, String processDefinitionKey, Long userId);
 
    /**
     * 获取采购计划审批流程列表
     *
     * @return 流程定义列表
     */
    List<Map<String, Object>> getPurchasePlanApproveProcessDefinitionList();
 
    /**
     * BPM 审批结果回调更新采购计划状态
     *
     * @param id        采购计划编号
     * @param bpmResult BPM 审批结果
     */
    void updatePurchasePlanAuditStatus(Long id, Integer bpmResult);
 
    /**
     * 根据库存预警自动生成采购计划(草稿)
     *
     * <p>遍历启用安全库存的物料,当前库存低于安全库存下限时,
     * 按缺量生成计划明细。返回草稿计划,由编制人核对后提交审批。
     *
     * @param name       计划名称
     * @param supplierId 供应商编号(可选)
     * @return 生成的采购计划
     */
    ErpPurchasePlanDO generatePlanFromStockAlert(String name, Long supplierId);
 
    /**
     * 审批通过后生成采购申请
     *
     * @param id 采购计划编号
     * @return 生成的采购申请编号列表
     */
    List<Long> generatePurchaseRequests(Long id);
 
}