liyong
5 天以前 536774eea8902efc088c5b904ff75bbe0af33418
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
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.MdmItemBatchConfigRespDTO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemBatchConfigDO;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * MDM 物料批次配置 API 接口
 *
 * @author 芋道源码
 */
public interface MdmItemBatchConfigApi {
 
    String PREFIX = "/rpc-api/mdm/item-batch-config";
 
    /**
     * 根据物料编号获取批次配置
     *
     * @param itemId 物料编号
     * @return 批次配置(不存在返回 null)
     */
    CommonResult<MdmItemBatchConfigRespDTO> getItemBatchConfigByItemId(Long itemId);
 
    /**
     * 根据物料编号获取批次配置(便捷方法)
     *
     * @param itemId 物料编号
     * @return 批次配置(不存在返回 null)
     */
    default MdmItemBatchConfigRespDTO getItemBatchConfig(Long itemId) {
        CommonResult<MdmItemBatchConfigRespDTO> result = getItemBatchConfigByItemId(itemId);
        return result != null ? result.getData() : null;
    }
 
    /**
     * 保存批次配置
     *
     * @param config 批次配置
     * @return 配置编号
     */
    CommonResult<Long> saveItemBatchConfig(MdmItemBatchConfigDO config);
 
    /**
     * 保存批次配置(便捷方法)
     *
     * @param config 批次配置
     * @return 配置编号
     */
    default Long saveItemBatch(MdmItemBatchConfigDO config) {
        CommonResult<Long> result = saveItemBatchConfig(config);
        return result != null ? result.getData() : null;
    }
 
}