9 天以前 2e84a447af471fe5ada907c28849838a6bc3a340
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
package cn.iocoder.yudao.module.mes.service.mdm;
 
import cn.iocoder.yudao.module.mes.dal.dataobject.mdm.MesMdmItemDO;
 
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
/**
 * MDM 物料 Service 接口
 *
 * 专门用于查询 mdm_item 表
 */
public interface MesMdmItemService {
 
    /**
     * 获得物料
     *
     * @param id 编号
     * @return 物料
     */
    MesMdmItemDO getItem(Long id);
 
    /**
     * 校验物料存在
     *
     * @param id 编号
     * @return 物料
     */
    MesMdmItemDO validateItemExists(Long id);
 
    /**
     * 校验物料存在且启用
     *
     * @param id 编号
     * @return 物料
     */
    MesMdmItemDO validateItemExistsAndEnable(Long id);
 
    /**
     * 获得物料列表
     *
     * @param ids 编号数组
     * @return 物料列表
     */
    List<MesMdmItemDO> getItemList(Collection<Long> ids);
 
    /**
     * 获得物料 Map
     *
     * @param ids 编号数组
     * @return 物料 Map
     */
    default Map<Long, MesMdmItemDO> getItemMap(Collection<Long> ids) {
        return convertMap(getItemList(ids), MesMdmItemDO::getId);
    }
 
}