liyong
2026-07-03 7085354cb7e6283f72e99d7eff8e73b8c7ba0cb9
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
package cn.iocoder.yudao.module.mes.service.wm.itemconsume;
 
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.feedback.MesProFeedbackDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemconsume.MesWmItemConsumeDO;
 
/**
 * MES 物料消耗记录 Service 接口
 *
 * @author 芋道源码
 */
public interface MesWmItemConsumeService {
 
    /**
     * 根据报工单生成物料消耗记录
     *
     * 1. 查询当前工序的 BOM 物料配置
     * 2. 生成消耗单头 + 行(消耗数量 = BOM 用料比例 × 报工数量)
     *
     * @param feedback 报工记录
     * @return 生成的消耗记录,无 BOM 时返回 null
     */
    MesWmItemConsumeDO generateItemConsume(MesProFeedbackDO feedback);
 
    /**
     * 完成物料消耗(库存扣减)
     *
     * 遍历消耗明细(detail),按批次精确扣减线边库库存,更新消耗单状态为已完成
     *
     * @param consumeId 消耗记录编号
     */
    void finishItemConsume(Long consumeId);
 
    /**
     * 根据报工记录编号获取消耗记录
     *
     * @param feedbackId 报工记录编号
     * @return 消耗记录,不存在返回 null
     */
    MesWmItemConsumeDO getByFeedbackId(Long feedbackId);
 
}