2026-06-29 940c8481d2fdcf51341db4ccd6fd6fcc2d43debb
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
package cn.iocoder.yudao.module.mdm.api.item;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemSkuRespDTO;
 
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
/**
 * MDM 物料 SKU API 接口
 *
 * @author 芋道源码
 */
public interface MdmItemSkuApi {
 
    String PREFIX = "/rpc-api/mdm/item-sku";
 
    /**
     * 获取 SKU
     *
     * @param id SKU 编号
     * @return SKU
     */
    CommonResult<MdmItemSkuRespDTO> getItemSku(Long id);
 
    /**
     * 获取 SKU 列表
     *
     * @param ids SKU 编号列表
     * @return SKU 列表
     */
    CommonResult<List<MdmItemSkuRespDTO>> getItemSkuList(Collection<Long> ids);
 
    /**
     * 获取 SKU Map
     *
     * @param ids SKU 编号列表
     * @return SKU Map
     */
    default Map<Long, MdmItemSkuRespDTO> getItemSkuMap(Collection<Long> ids) {
        List<MdmItemSkuRespDTO> list = getItemSkuList(ids).getCheckedData();
        return convertMap(list, MdmItemSkuRespDTO::getId);
    }
 
    /**
     * 获取物料的 SKU 列表
     *
     * @param itemId 物料编号
     * @return SKU 列表
     */
    CommonResult<List<MdmItemSkuRespDTO>> getItemSkuListByItemId(Long itemId);
 
    /**
     * 校验 SKU 存在
     *
     * @param id SKU 编号
     * @return SKU
     */
    CommonResult<MdmItemSkuRespDTO> validateItemSkuExists(Long id);
 
    /**
     * 校验 SKU 存在且启用
     *
     * @param id SKU 编号
     * @return SKU
     */
    CommonResult<MdmItemSkuRespDTO> validateItemSkuExistsAndEnable(Long id);
 
    /**
     * 根据编码获取 SKU
     *
     * @param code SKU 编码
     * @return SKU
     */
    CommonResult<MdmItemSkuRespDTO> getItemSkuByCode(String code);
 
    /**
     * 根据条码获取 SKU
     *
     * @param barCode SKU 条码
     * @return SKU
     */
    CommonResult<MdmItemSkuRespDTO> getItemSkuByBarCode(String barCode);
 
}