9 天以前 1c1daebcb9f89138a84e9a7643d1909bb1a5a342
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.mes.service.wm.itemconsume;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.wm.itemconsume.vo.MesWmItemConsumeLinePageReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemconsume.MesWmItemConsumeDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemconsume.MesWmItemConsumeLineDO;
import cn.iocoder.yudao.module.mes.dal.mysql.wm.itemconsume.MesWmItemConsumeLineMapper;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
 
import java.util.List;
 
/**
 * MES 物料消耗记录行 Service 实现类
 *
 * @author 芋道源码
 */
@Service
@Validated
public class MesWmItemConsumeLineServiceImpl implements MesWmItemConsumeLineService {
 
    @Resource
    private MesWmItemConsumeLineMapper itemConsumeLineMapper;
 
    @Resource
    @Lazy
    private MesWmItemConsumeService itemConsumeService;
 
    @Override
    public void createItemConsumeLineBatch(List<MesWmItemConsumeLineDO> lines) {
        itemConsumeLineMapper.insertBatch(lines);
    }
 
    @Override
    public PageResult<MesWmItemConsumeLineDO> getItemConsumeLinePage(MesWmItemConsumeLinePageReqVO pageReqVO) {
        // 1. 先通过 feedbackId 找到消耗头(通过 Service 调用,不直接注入 Mapper)
        MesWmItemConsumeDO consume = itemConsumeService.getByFeedbackId(pageReqVO.getFeedbackId());
        if (consume == null) {
            return PageResult.empty();
        }
        // 2. 分页查询消耗行
        return itemConsumeLineMapper.selectPage(pageReqVO, consume.getId());
    }
 
    @Override
    public List<MesWmItemConsumeLineDO> getItemConsumeLineListByConsumeId(Long consumeId) {
        return itemConsumeLineMapper.selectListByConsumeId(consumeId);
    }
 
}