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;
|
}
|
|
}
|